GPU restriction code

Is there a command / function / variable that can be set in CUDA code that limits the percentage of GPU usage? I would like to modify an open source project called Flam4CUDA so that this option exists. Now, as now, he uses as many GPUs as possible, since, apparently, the temperature rises sharply. To keep pace for long periods of time, I would like to tell the program to use, say, 50% of each GPU (or even have different percentages for different GPUs, or perhaps also be able to choose which GPU to use). Any ideas?

If you want to see the code, it is available using "svn co https://flam4.svn.sourceforge.net/svnroot/flam4 flam4".

+3
source share
2 answers

There is no easy way to do what you ask. CPU usage is controlled by temporarily dividing context switches, while GPUs do not have such small-scale context switching. GPUs are jointly multitasking. This is why the nvidia-smi tool for boards for workstations and server classes has “exclusive” and “forbidden” modes for controlling the number of GPU contexts that are allowed on this board.

/ , , , ​​( ), .

+2

gpu CUDA . , .

-1

All Articles