I can't change my GPU frequency on Jetson Orin

I’ve tried to change the frequency of GPU by using ‘echo <gpu_freq> >/sys/devices/17000000.ga10b/devfreq/17000000.ga10b/min_freq’ and ‘echo <gpu_freq> >/sys/devices/17000000.ga10b/devfreq/17000000.ga10b/max_freq’. (I’ve confirmed that the given frequencies are available.) The two files are successfully changed. However, I found that my frequency hasn’t changed. (using ‘cat /sys/devices/17000000.ga10b/devfreq/17000000.ga10b/cur_freq’)
Then I tried to use C++ ifstreams to attach the files. I found that the cur_freq was actually changed to the frequency I wanted the instant after I changed the max_freq and min_freq files, but it’s changed back very quickly.
Is there some other steps I missed?
Thanks a lot!

You may try:

sudo su
cd /sys/kernel/debug/bpmp/debug/clk/gpusysmux
cat rate
cat max_rate > rate
cat rate
exit

Thank you for reply!
However, I didn’t solve the problem. I found that the file ‘rate’ is the same as ‘max_rate’.

Finally, I found that the frequency is possibly changed by tensorRT. Once I executed the inference, the frequency will change to the highest frequency.

If you want to maximize clocks, try “sudo jetson_clocks” (which is just a convenience to set to the max rate of the current model). If you want to know about the model, check out “nvpmodel --help” (note that max performance is “sudo nvpmodel -m 0”, followed by “sudo jetson_clocks”). Those utilities basically use the same methods which @Honey_Patouceul demonstrated.

2 Likes

If you want to have a fixed clock not being max rate, you may try:

sudo su
cd /sys/kernel/debug/bpmp/debug/clk/gpusysmux
echo 1 >  mrq_rate_locked
echo $your_wanted_rate_from_available_ones > rate
cat rate
exit
2 Likes

Thank you for reply! But I still didn’t solve the problem. I tried an older JetPack version on Jetson Xavier NX and it no more happens. I wonder if there are some automatic frequency switch on newer JetPack verisons when I use GPU? Is there some further information about this?
Thank you!

Thank you for reply! I tried to use nvpmodel, but I need to change frequency in a quite low latency in a designed system, so I tried to use methods of changing the file. Otherwise, I need to change to any of the frequency instead of only to maximize it. However, I found that once I execute calculations on GPU, it immediately maximized the frequency, which is not I wanted.
Detailedly, I found that target_freq has been changed to the frequency I wanted. But cur_freq automatically changed to the max frequency.
Thank you!

I can’t answer everything you need to know. One thing you might consider is that nvpmodel is using the same files and system calls which occur from a manual echo to files in “/sys”. One can see what system calls are made from the strace utility (if you don’t have this, then “sudo apt-get install strace”). For example, if you trace while setting to “-m 0” model:
strace nvpmodel -m 0

Or logging:
strace -o log_trace.txt nvpmodel -m 0

Then look for anything in “/sys”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.