Setting CUDA device compute mode in JESON NANO

Hi.

I am trying to evaluate a heavy kernel that runs on CUDA GPU.
I work on JETSON NANO device.

Usually I got running time of 11milli, but sometimes I get 20milli and sometimes even 3milii.

I thought that maybe the display card also uses the GPU and that’s why I get different timing, so I tried to disconnect the HDMI cable, and power-up without it, but it didn’t help.

So I thought that maybe other LINUX processes also uses the GPU.

Is there a way to set the compute mode in JESON NANO to exclusive, such that only my process can use the GPU ?

My application is real-time and needs to work deterministically.

I read that the nvidia-smi utility doesn’t work on JETSON NANO.

Did you try to use the standard linux process priority mechanisms ?

I didn’t try it.
But will the standard Linux process priority mechanism controls also the GPU usage ?
And what if I need my system to be deterministic and want my process to have exclusive GPU usage,
so I can count on GPU execution time to be the same all the time and not to change due to other system GPU needs ?

The standard OS priorities indirectly affect GPU work, because GPU activity is initiated by a host thread. GPU programs that want to run in the background (e.g. Folding@Home client) therefore run with low-priority host threads.

Generally speaking the CUDA software stack is not designed for hard real-time requirements (i.e. guarantee to always hit deadlines). Various soft real-time use cases work in practice. Use of high-priority host threads and keeping system load otherwise low will help.

Ok. Thanks.
But is there a way for a process to gain exclusive access to GPU, and to prevent all other processes even OS processes to use the GPU ?

If you work in dockers only and enable gpu just for a single docker it will work

But if I want to run my application without docker ?
Can I get gain sole access to GPU and prevent other applications from using it ?
It’s so frustrating that my application can run in 3ms but sometimes runs in 20ms.

Apart from linux governors an important thing that reduces performance jitter is to use “jetson_clocks” command to maximize performance

thanks. it solved the problem.