Page 1 of 2

limit gpu usage !

PostPosted: Fri Apr 03, 2020 11:16 pm
by empleat
i started crunching on my geforce 780, it was okay on full, or medium, while i am watching tv shows... But now i have lag, even on medium. So i can't crunch at all, because i am all time on my pc. It is so weird, that there wouldn't be any option to limit gpu usage. It is either nothing when i put it on light, or 99% usage. WTH ? Overheating isn't a problem.

I know gpu is different from cpu and there is no way to limit usage, but isn't it possible to give gpu work more slowly ? Wtf how is it possible there isn't way to do it ??? Because it is either 99% usage, when my computer is useless, or 0%. Btw i heard there is some command, but tutorial's pictures are dead and it is not working anyways supposedly.

There is open cl and cuda index in configurations/slots, but i have no idea, where to find these indexes. I though maybe enable only open cl and disable cuda, or rather opposite way around. No idea if it would help...

I went to cmd to find out indexes:
Code: Select all
GPU 0: Bus:1 Slot:0 Func:0 NVIDIA:3 GK110 [GeForce GTX 780]
  CUDA Device 0: Platform:0 Device:0 Bus:1 Slot:0 Compute:3.5 Driver:11.0
OpenCL Device 0: Platform:0 Device:0 Bus:1 Slot:0 Compute:1.2 Driver:445.75

I tried to put under cuda 1, in hope that it would make it not work, but cpu usage still 99%, or it didn't helped.

Re: limit gpu usage !

PostPosted: Fri Apr 03, 2020 11:49 pm
by JimboPalmer
Since the 1950s, Computer Science has been working on sharing CPUs, and we have gotten very good at it.

Sadly, almost no work has been devoted to sharing GPUs. Neither Windows, nor MacOS nor Linux even try.

I do read about more hardware support from Video Card designers, but driver support is lacking for one very good reason.

Gamers would object if their games got even 1 FPS slower, and gamers make up 99% of video card purchasers. (Bit Coin miners would also be angry they were making fewer coins, so I lump them with the gamers)

Distributed Computing just is not a market any company can cater to, and stay afloat financially,

Here are hardware features introduced in Pascal cards (GTX 10x0):

Dynamic load balancing scheduling system. This allows the scheduler to dynamically adjust the amount of the GPU assigned to multiple tasks, ensuring that the GPU remains saturated with work except when there is no more work that can safely be distributed to distribute. Nvidia therefore has safely enabled asynchronous compute in Pascal's driver.
Instruction-level and thread-level preemption

I am not as aware of AMD's micro-architecture, but a hypothetical Core_23 with multitasking could be written for Pascal and above, omitting support for all Nvidia cards with 3 digit names (GTXxx0 like your GTX 780) I am not sure that would be popular among volunteers. I bet such a Core would need to be written with Nvidia support.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 12:13 am
by empleat
Why this program can't just limit amount of work it gives to gpu ? I really don't get it, why this wouldn't work.
Btw i tried command: FAHClient --gpu-usage 50, but i heard it doesn't work. Why that command even exists, if it doesn't work i can only wonder :D
Btw i will be getting 2070 super, but it will be same problem again. 2020 no gpu usage limit :?: :o :D :mrgreen: Since i will have 2 pc, maybe i could run 2070 idle...
And i heard, goverment gives no money to science and companies cares just about money, smarphones etc. sad

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 12:27 am
by JimboPalmer
empleat wrote:Btw i tried command: FAHClient --gpu-usage 50, but i heard it doesn't work. Why that command even exists, if it doesn't work i can only wonder

F@H tried giving the GPU work in short batches, the thermal shock of heating then cooling over and over was found not to be good for the hardware. So it no longer works.

F@H wants to do better, it just can't without OS/driver support.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 1:04 am
by empleat
What about running stress test on one cpu core, but i am not sure you can limit usage of one core to 50%. Because i noticed similarly like with boinc project, gpu uses still 1 cpu core to crunch. I would have also find what cpu core uses FAH and bind it to core22 if possible. Maybe some old application would give me usage like 50% on one core.
Hmm couldn't that thermal shock being avoided, dropping down gpu fan rpm to 0%. If this program would be synchonized with gpu fan control. Because it takes like 1 minute before gpu cools down. Or running yet stress test based on gpu usage, so when gpu usage drops it is still used. That would be kinda hard to implement, because you can't predict gpu usage.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 1:22 am
by JimboPalmer
AMD does better, but sadly Nvidia runs a busy wait loop, polling for data on the PCI-E bus. No matter how fast or slow your CPU is, Nvidia is going to use it all. AMD uses interrupts, a much more graceful plan.

What F@H can and does do, is give itself a very low priority. the CPU part of F@H is very 'nice'. It allows almost any other program to run first.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 1:24 am
by empleat
I have already nvidia super 2070 :/, but not whole pc yet. But not sure if i would go for amd gpu anyways.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 1:35 am
by JimboPalmer
All my current cards are Nvidia as well. I am not ragging on either vendor, just showing how much is out of F@H's control.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 1:45 am
by empleat
JimboPalmer wrote:No matter how fast or slow your CPU is, Nvidia is going to use it all. AMD uses interrupts, a much more

Wait a minute... Wait a f#@#@ minute ! I just did cpu stress test and gpu usage dropped to 0%. So gpu usage is tied to cpu usage. HAHAHA man i need stress one core, which is used by gpu to a like 50% if possible.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 2:11 am
by JimboPalmer
I am a programmer by trade, mostly inventory and accounting. We found that the programmers for the Oracle G/L reporting used busy wait polling while you had a report running. At month end they could stop all other work on the server. We implemented client/server reporting and put the G/L reporting system on the oldest, slowest, Unix box we owned. It still used 100% of it, but no one else was inconvenienced.

(Nvidia has a language protocol they wish you would use called CUDA, it is Nvidia specific. They support an industry standard as well called OpenCL. But they hobble it with this polling I/O.)

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 2:14 am
by ipkh
Every GPU WU needs some CPU time. As a crazy way to drop usage try setting a single core to a really low multiplier and park the thread there.
Many core22 WUs use 100% of a CPU, at least on my system.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 2:17 am
by empleat
Dude you won't believe this
I figured it out. I ran stress test program in c++ i found on internet and now my gpu usage is 40-70%, frequency stable 863mhz and temp 60C stable.
I can't believe it, computer scientists couldn't figure this and i just solved it in 5 minutes :lol: :lol: :lol:

Nooooooo man, it worked for like 5-10 minutes but than:
Code: Select all
01:14:44:FS00:Shutting core down
01:14:44:WU00:FS00:0xa7:WARNING:Console control signal 1 on PID 7748
01:14:44:WU00:FS00:0xa7:Exiting, please wait. . .
01:14:45:WU00:FS00:0xa7:Folding@home Core Shutdown: INTERRUPTED
01:14:45:WU00:FS00:FahCore returned: INTERRUPTED (102 = 0x66)
01:14:46:WARNING:WU00:Slot ID 0 no longer exists and there are no other matching slots, dumping
01:14:46:WU00:Sending unit results: id:00 state:SEND error:DUMPED project:14307 run:3 clone:398 gen:5 core:0xa7 unit:0x000000079bf7a4d55e66c58080eaf97a

Dudes just add cpu load limit for single core, or stress test and gpu will run at custom load. I just demostrated, gpu load is tied to 1 cpu core load, which is showing under FahCore22. Which is gpu crunching process.

EDIT: Great !!! I was able to fix it i think, i am running another wu like for a hour, after previous was terminated after 5-10 min. I changed priority in FAH client to higher and i also gave FahCore22 process - below medium priority and select 1 cpu core in affinity menu, than i ran stress test and gave it same priority and affinity. It was very balanced from start, both processes had approximately same CPU core usage. Stress test program has only 3% cpu usage now and FahCore22 9%. I would rather so it was 5/7, but not too low so it doesn't crash like previously. I have 74% - 90% gpu usage when doing nothing, which is still too high. But temperatures are very stable 60-63C and clocks fairly stable, don't know if clocks matters. I am using this program, but i know only very basics in c++ and i wasn't able to find how this program works exactly. Whole project says 18 hours to complete, so i will continue running it tommorow and see if it finishes.

Also someone know how to ran only gpu, without cpu ? Even i allowed only 1 cpu core. I am hitting 100% cpu usage when watching tv shows. But problem is when i remove cpu slot, no project starts, while i read on reddit you can do that... EDIT: i was able to pause cpu, but still i would rather remove slot, so it doesn't autostart each time.

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 2:19 am
by PantherX
ipkh wrote:...Many core22 WUs use 100% of a CPU, at least on my system.

FYI, as JimboPalmer mentioned, if you have a Nvidia GPU and it is running FahCore_22, it will always be using 1 CPU regardless of how many CPUs you have. If you have 2 Nvidia GPUs running FahCore_22, then it will use 2 CPUs. While I don't like it at all, it this something that the vendor does and I do hope that it changes but that's me just being optimistic :)

Re: limit gpu usage !

PostPosted: Sat Apr 04, 2020 2:59 pm
by empleat
Code: Select all
13:51:08:WU00:FS00:0x22:ERROR:exception: clWaitForEvents
13:51:08:WU00:FS00:0x22:Saving result file ..\logfile_01.txt
13:51:08:WU00:FS00:0x22:Saving result file checkpointState.xml
13:51:09:WU00:FS00:0x22:Saving result file checkpt.crc
13:51:09:WU00:FS00:0x22:Saving result file positions.xtc
13:51:09:WU00:FS00:0x22:Saving result file science.log
13:51:09:WU00:FS00:0x22:Folding@home Core Shutdown: BAD_WORK_UNIT
13:51:12:WARNING:WU00:FS00:FahCore returned: BAD_WORK_UNIT (114 = 0x72)
13:51:12:WU00:FS00:Sending unit results: id:00 state:SEND error:FAULTY project:11776 run:0 clone:5232 gen:13 core:0x22 unit:0x0000001e287234c95e7433a37d5b8b29
13:51:12:WU00:FS00:Uploading 40.59MiB to

Seems because stressing cpu core where work is assigment, wu crashes. I had 6% usage on FahCore22 and 6% on stress test, same priority - below medium, otherwise my gpu usage is too high, if i set stress test priority to low. It worked like 2-3 hours, i was able to crunch 20% of wu. Why is it crashing ? It was pefect, i was able to achieve 80% gpu usage in average, stable temp 3~. And it was working, problem is FAH is not liking, that resources to cpu core are being denied. Couldn't there be workaround for this ? Many people gets dissuaded, or can't crunch, because you can't set gpu usage.

Re: limit gpu usage !

PostPosted: Sun Apr 05, 2020 7:35 pm
by toTOW
You can't limit GPU usage by design. There's nothing you can do to change it.

You can just use the power limit of your GPU (with MSI Afterburner for instance) to reduce the power consumption or heat.

Jamming the CPU part of the code is a very bad idea : if your CPU is too busy to talk with the GPU on time, all you'll achieve is to trash your WU or crash your system.