How to change Fahcore_22.exe priority in Windows?

Moderators: Site Moderators, FAHC Science Team

Post Reply
def1nity
Posts: 2
Joined: Thu Apr 06, 2023 11:13 pm

How to change Fahcore_22.exe priority in Windows?

Post by def1nity »

Hi,

I noticed Fahcore_22.exe always starts in "Low" priority when I check taskmgr.

The CPU is used for mining, i've left only the GPU slot for FAH. The miner takes all available idle cpu time (constantly 90-100%) and generally doesn't disturb the usage of the pc.

I suspect this arrangement confuses the FAH client :roll:

Obviously on Low prio the GPU is @ 30-40% load and my PPD tanks... More importantly the room temp drops, as the PC is my main heat source :D

Switching to Normal prio manually helps a lot and the GPU load jumps to ~70% ; High prio adds another 10%

The problem is that at some point (maybe between WUs, not sure) the priority returns to Low...

How can I force it to always stick with Normal prio? I tried the priority argument and either I'm not using it properly, or it doesn't affect the GPU Fahcore_22.exe as I read somewhere?

Appreciate any pointers before it annoys me completely and I setup a janky tasksch/script as a workaround :lol:
def1nity
Posts: 2
Joined: Thu Apr 06, 2023 11:13 pm

Re: How to change Fahcore_22.exe priority in Windows?

Post by def1nity »

Well... Just FYI if anyone else has this "problem", here is how I solved it:

1. Simple PS script that will look for and check the prio of "Fahcore_22.exe" every 15min and set it to normal if it is anything else. Save that in a .ps1 file:

Code: Select all

while($true) {
    $process = Get-Process | where {$_.ProcessName -eq "FahCore_22"}
    if ($process) {
        if ($process.PriorityClass -ne "Normal") {
            $process.PriorityClass = "Normal"
            Write-Host "Process priority changed to Normal"
        }
        else {
            Write-Host "Process already at Normal priority"
        }
    }
    else {
        Write-Host "Process not found"
    }
    Start-Sleep -Seconds 900 # Wait for 15 minutes
}
2. To have it start automatically with Windows and keep running in the background *silently* i.e. there will be no window/powershell instance visible anywhere except in taskmgr, this is what I did:

Press "Win+R" to open the Run dialog.

Type "shell:startup" and press Enter. This will open the Startup folder for the current user.

Right-click inside the folder and select "New > Shortcut".

In the "Create Shortcut" dialog, enter the full path to the PowerShell executable (powershell.exe) followed by the full path to the PowerShell script file (surrounded by double quotes) and click "Next":

Code: Select all

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -WindowStyle Hidden -File "C:\Scripts\check-fahcore-priority.ps1"
Enter a name for the shortcut, such as "Check Fahcore Priority" and click "Finish".

Enjoy :)
toTOW
Site Moderator
Posts: 6365
Joined: Sun Dec 02, 2007 10:38 am
Location: Bordeaux, France
Contact:

Re: How to change Fahcore_22.exe priority in Windows?

Post by toTOW »

You can also use tools like Process Lasso ...
Image

Folding@Home beta tester since 2002. Folding Forum moderator since July 2008.
firereverie
Posts: 2
Joined: Sat Apr 22, 2023 4:24 pm

Re: How to change Fahcore_22.exe priority in Windows?

Post by firereverie »

Thank you for this. I added a second if statement to mine that also keeps it locked to my preferred core affinity. I suspect that since no matter what else I do, whatever CPU core22 is tied to maxes out, that I'm bottlenecking here and that's the root cause of my 4090 underperforming. That said, might as well keep it locked to the fastest cores.

Code: Select all

while($true) {
    $process = Get-Process | where {$_.ProcessName -eq "FahCore_22"}
    if ($process) {
        if ($process.PriorityClass -ne "High") {
            $process.PriorityClass = "High"
            Write-Host "Process priority changed to High"
        }
        else {
            Write-Host "Process already at High priority"
        }
	if ($process.ProcessorAffinity -ne 3075) {
			$process.ProcessorAffinity = 3075
			Write-Host "Process CPU affinity changed to C0 & C5"
		}
		else {
			Write-Host "Process CPU affinity already at C0 & C5"
		}
    }
    else {
        Write-Host "Process not found"
    }
    Start-Sleep -Seconds 900 # Wait for 15 minutes
}
firereverie
Posts: 2
Joined: Sat Apr 22, 2023 4:24 pm

Re: How to change Fahcore_22.exe priority in Windows?

Post by firereverie »

def1nity wrote: Thu Apr 06, 2023 11:39 pm The problem is that at some point (maybe between WUs, not sure) the priority returns to Low...
Changes to Priority and Affinity are volatile and do not persist through process restarts, so it makes sense that it would reset between WUs when processing ends on one instance and anouther is started to facilitate the next.
firereverie wrote: Fri May 12, 2023 7:22 pm

Code: Select all

	if ($process.ProcessorAffinity -ne 3075) {
			$process.ProcessorAffinity = 3075
			Write-Host "Process CPU affinity changed to C0 & C5"
		}
		else {
			Write-Host "Process CPU affinity already at C0 & C5"
Threads/cores for processor affinity are addressed as 2^x where x is the logical processor number, to set affinity for multiple logical processors these are added together. I wanted mine to have some options so it's set to use C0T0, C0T1, C5T0, and C5T1, or Logical Processors 0, 1, 10 & 11. To get 3075== 2^0(C0T0-LP0)+2^1(C0T1-LP1)+2^10(C5T0-LP10)+2^11(C5T1-LP11)==1(C0T0-LP0)+2(C0T1-LP1)+1024(C5T0-LP10)+2048(C5T1-LP11)
Post Reply