Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit GPU usage to % value #1451

Open
c0ke543 opened this issue Dec 14, 2015 · 20 comments
Open

limit GPU usage to % value #1451

c0ke543 opened this issue Dec 14, 2015 · 20 comments

Comments

@c0ke543
Copy link

c0ke543 commented Dec 14, 2015

Please add the ability to limit overall GPU usage to % value. I would contribute GPU if it didn't use 100% all the time. This would allow the GPU to perform tasks while watching netflix or such. I spend a great deal of time watching video with occasional gaming. I have 960 GTX that's close to idle most of the time, but I won't donate it's time if I can't enjoy my videos at the same time.

I've seen this request on multiple forums with no way to effectively control this.

@AenBleidd
Copy link
Member

As I know there is no possibility to limit GPU usage.

@informatorius
Copy link

@c0ke543: I think netflix video is running in internet browser like Firefox and using plugins like Flash or Silverlight. Firefox and these plugins use GPU hw acceleration which is in conflict with Boinc GPU tasks.

To solve this conflict you have to disable GPU hw acceleration in e.g. Firefox and flash or silverlight. Then your videos are processed by CPU and run smooth while GPU processes Boinc.
It is the same for browser games. For standalone games you need to pause Boinc while gaming.

I don't know which forum you asked for that problem but they should have told you this :-)

@informatorius
Copy link

@AenBleidd: A possibility that worked with folding@home is to suspend the work process and resume again. e.g. 2 sec work process running and 1 sec work process suspended.
But this could make problems on some projects.
So maybe the boinc client adds this option but it is only available for projects which support this.

@davidpanderson
Copy link
Contributor

Isn't that the same as CPU throttling, i.e. "use the CPU at most N% of the time"?
http://boinc.berkeley.edu/wiki/Preferences#Computing

@informatorius
Copy link

It is similar but meant for GPU projects.
I tried to set a limit on CPU time of 1% (the min value) but it didn't help.

e.g. poem@home is a Boinc GPU project and runs a process "poemcl_2.21_windows_intelx86__opencl_ati_101".

It runs with 5% CPU usage and feeds the GPU which has a usage of 93%.
If I suspend the poemcl_2.21_windows_intelx86__opencl_ati_101 process then CPU usage is 0% and the GPU is not feed anymore so load falls to 0%.
Then on process resume CPU usage is 5% again and GPU usage is 93% again.

So CPU usage is only a small percentage like 5% but I want to limit GPU usage.
I need something like "use the GPU at most N% of the time" which will suspend the CPU to GPU feeder process. In my example the process runs 5% CPU time but with a GPU limit of e.g. 50% the process would only run "CPU time x GPU limit" that is 2.5% of CPU time.

But the CPU to GPU feeder process must support this or at least not fail.
It is similar to PC Standby where all processes are suspended until PC resume.

You can test this with a process suspend tool manually e.g. in Windows using Process Explorer or in Linux by command line

@ChristianBeer
Copy link
Member

Such an option would also depend on how the GPU App is configured to use the GPU. If it needs exclusive access to the GPU, throttling wouldn't help. The Einstein@home GPU apps are setup that they can "share" the GPU. That's why we can easily run several GPU tasks on one GPU at the same time.

If there where an option like "use the GPU at most N% of the time" it is still unclear how a GPU app would implement such a behavior. It would be interesting to know how TThrottle does it. But this tool is Windows only and not Open Source.

@informatorius
Copy link

Oh I didn't know the TThrottle tool, so my idea is already invented (like so often) ;-)
@c0ke543: Maybe TThrottle solves your issue?
I tried TThrottle but it is not working for my AMD R9 280 on Windows 7.
It tries to throttle in UI but the GPU temp stays the same.

@ChristianBeer ChristianBeer added this to the Client/Manager 8.0 milestone Apr 11, 2017
@ChristianBeer ChristianBeer changed the title GPU Optimization limit GPU usage to % value Apr 11, 2017
@hmijail
Copy link

hmijail commented Sep 16, 2017

I would also love to have this.

My BOINC and other background apps are configured to keep working all the time (even when the computer is in use) without reaching the point where the computer fans get distractingly noisy; however the lack of GPU throttling just makes the fans go nuts for minutes at a time (and then off for a while, and then on again), even if all the other background processes are disabled.

So I have had GPU crunching disabled for about 2 years now, which is a pity.

@informatorius
Copy link

informatorius commented Sep 16, 2017

Isn't it possible to limit power usage using tools like MSI Afterburner and so limit gpu fan speed?

@hmijail
Copy link

hmijail commented Sep 16, 2017

Thank you, but I guess I should have specified that I'm in a Mac. MSI Afterburner seems to be a Windows-only application.

@c0ke543
Copy link
Author

c0ke543 commented Dec 6, 2017

Providing some feedback. So far my current work around was to join a team pool for grcpool specifically. They have some nice config options by UI that let you choose which task types projects can send you. CPU, Nvidia GPU, Intel GPU, ATI GPU. I turned off GPU for certain projects like Asteroids. I allow the projects that don't cause stuttering video often.

Using afterburner or EVGA precision doesn't work since their approach is to throttle everything. I just want Bionic to be less greedy in the GPU space. I understand the technical limitations. Maybe this is something someone can take up with Nvidia as a charity project in their HW architecture. You'd be surprised how open companies are to good PR. So it might slip in to be addressed for some positive PR. I'd do it, but I don't understand the technical issues behind it enough to even request the right thing. Way outside my field (web application development).

I'm going to try out TThrottle just haven't gotten around to that one. Any other creative solutions is appreciated. I think this will really help this program gain more adoption by the gamer/home theater/ other enthusiasts communities. For the larger general audience, as intel GPUs with OpenCL support gain adoption. There could be a lot of untapped potential in GFLOPs and reducing abandonment with the casual user.

@seamlik
Copy link

seamlik commented Mar 11, 2018

This feature is so important to me. If only I could limit GPU usage to, maybe 40%, thus it fixes my overheat problem, and I can also turn it on when if I'm currently using my computer.

@davidpanderson
Copy link
Contributor

Although a separate GPU setting might be useful, CPU throttling should apply to GPUs as well.

However, it currently doesn't, because CPU throttling is disabled for apps that use a GPU.
The reason for this (commit notes from 2014) is:

  • Don't throttle GPU apps. GPU apps spend all their time in a
    critical section, during which they can't be suspended.
    They length of these critical sections (i.e. of GPU kernels)
    may be a significant part of a second, or more,
    so sub-second throttling isn't possible.

I'm not sure this is valid reasoning.
For starters, CPU throttling is not sub-second.
I think we should re-enable throttling of GPU apps,
see if there are problems, and if so try to solve them.

@cristipurdel
Copy link

Instead of GPU throttling, would it not be easier to reserve some of the computing units (or to disable work on the first ones used by normal processes like flash/firefox/chrome).
Instead of doing start/stop on the GPU kernel, my guess is that is better to let the GPU kernel run on only a smaller amount of compute units. Something like computing / CPU usage limits implementation

@AenBleidd
Copy link
Member

Such compute units usage limitations can't be done on BOINC side, I'm afraid.

@cminnoy
Copy link

cminnoy commented Feb 11, 2021

On NVIDIA GPUs you can use nvml APIs to limit power usage:
nvmlDeviceSetPowerManagementLimit()

Professional GPUs also allow to set their clock frequency; but most gaming GPUs (GeForce) you can't.
What PowerLimit does is trottle the clock freq automatically to reduce the power consumption.
You can also request the power consumption of the GPU die (but not the total card power).

@svrnwnsch
Copy link

I assume that this should be only applied for the boinc application and not for other tasks running on the computer using the GPU.

@cminnoy
Copy link

cminnoy commented Feb 15, 2021

On some NVIDIA GPUs you can make profiles, where you can select certain tasks to have higher priority than others.
But again, on most consumer GPUs you can't do that.

Sub-second control of GPU tasks is possible (tried it on Linux), but it depends on the tasks at hand if it works well (computer versus graphics task, high or low communication through the PCIe bus). So it ain't gonna be a 'works for all very smooth' experience.

@cminnoy
Copy link

cminnoy commented Feb 15, 2021

See also ticket: #4181

@Chamiu
Copy link

Chamiu commented Feb 13, 2023

Please add the ability to limit overall GPU usage to % value. I would contribute GPU if it didn't use 100% all the time. This would allow the GPU to perform tasks while watching netflix or such. I spend a great deal of time watching video with occasional gaming. I have 960 GTX that's close to idle most of the time, but I won't donate it's time if I can't enjoy my videos at the same time.

I hope this enhance at reference on 2023.
Because I think it is necessary to consider protecting the environment and semiconductor elements. After 2022, it is also necessary to consider the increase in financial burden on volunteers due to the rise in electricity prices associated with Russia's invasion of Ukraine.

Sorry. Apple translate from Japanese.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests