Maximize TX1 performance

I ran this script:

https://github.com/dusty-nv/jetson-scripts/blob/master/jetson_max_l4t.sh

“sudo jetson_max_l4t.sh”

and got some errors:

Enabling fan for safety...
./max.sh: 11: ./max.sh: cannot create /sys/kernel/cluster/immediate: Directory nonexistent
./max.sh: 12: ./max.sh: cannot create /sys/kernel/cluster/force: Directory nonexistent
./max.sh: 13: ./max.sh: cannot create /sys/kernel/cluster/active: Directory nonexistent
cat: /sys/kernel/cluster/active: No such file or directory
Cluster: 
onlining CPUs: ignore errors...
./max.sh: 19: ./max.sh: cannot create /sys/devices/system/cpu/cpu0/online: Directory nonexistent
sh: echo: I/O error
sh: echo: I/O error
sh: echo: I/O error
Online CPUs: 0-3
CPU0: 1734000
CPU1: 1734000
CPU2: 1734000
CPU3: 1734000
GPU: 998400000
EMC: 1600000000

Does anyone get the same errors?

GtkPerf test before the script was 16s, after the script was 13s.

The same test on HP Zbook was only 2.5s.

It appears the clock rates at start up were:

CPU: 1.224GHz
GPU: 76.8MHz
MEM: 1.0656GHz

after max.sh were:

CPU: 1.734GHz
GPU: 998.4MHz
MEM: 1.6GHz

There is significant increase in GPU clock, but no significant increases in CPU and MEM clock. That’s why “max.sh” did not increase significantly bench marks of non-GPU tests, such as DMA tests which use kernel “copy_to_user” function.

The errors are OK to see on Jetson TX1 (I will note this in the script comments). They are there for Jetson TK1 actually, so the script is compatible. TK1 has multiple clusters so there’s cluster/active and TK1 can offline core 0. TX1 needs at least 1 core active because it has 1 cluster.

Thanks for the clarification. The script did seem to set TX1 CPU/GPU/EMMC clock frequencies to maximum.

It’s important to ensure benchmark tests make sense.

Thanks for the clarification. The script did seem to set TX1 CPU/GPU/EMMC clock frequencies to maximum.

It’s important to ensure benchmark tests make sense.

Have anyone try to run this script on the TX1 which flashed by Jetpack3.1 L4T 28.1 ?

I ran that but I got some errors:

Enabling fan for safety…
./Turn_on_High_Performance_Mode.sh: 10: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable: Directory nonexistent
./Turn_on_High_Performance_Mode.sh: 11: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/cluster/immediate: Directory nonexistent
./Turn_on_High_Performance_Mode.sh: 12: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/cluster/force: Directory nonexistent
./Turn_on_High_Performance_Mode.sh: 13: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/cluster/active: Directory nonexistent
cat: /sys/kernel/cluster/active: No such file or directory
Cluster:
onlining CPUs: ignore errors…
./Turn_on_High_Performance_Mode.sh: 19: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/devices/system/cpu/cpu0/online: Permission denied
Online CPUs: 0-3
CPU0: 1734000
CPU1: 1734000
CPU2: 1734000
CPU3: 1734000
./Turn_on_High_Performance_Mode.sh: 32: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/debug/clock/override.gbus/rate: Directory nonexistent
./Turn_on_High_Performance_Mode.sh: 33: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/debug/clock/override.gbus/state: Directory nonexistent
cat: /sys/kernel/debug/clock/gbus/rate: No such file or directory
GPU:
./Turn_on_High_Performance_Mode.sh: 37: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/debug/clock/override.emc/rate: Directory nonexistent
./Turn_on_High_Performance_Mode.sh: 38: ./Turn_on_High_Performance_Mode.sh: cannot create /sys/kernel/debug/clock/override.emc/state: Directory nonexistent
cat: /sys/kernel/debug/clock/emc/rate: No such file or directory
EMC:

Does anyone get the same errors?
Thanks for help !

In the case of “permission denied” you need to run as root (“sudo”). There was mention that the non-existent files/directories are ok to hit because the script is compatible with a TK1.

I have used chmod +x script and sudo ./script !

The permission of some parts I need to check ?

I know some directories nonexistent are OK, but the GPU and EMC parts are OK too?

Thanks for your reply !

I don’t know about the specific lines of the script, I’m just commenting about “/sys” in general. Files in “/sys” are not real files, and work instead as communications interface to/from the drivers involved. If the file is marked read-only, then this will be a reason for refusing based on permissions. However, it is up to the driver whether to allow a write to the file…even if file permission is modified a driver coded to not allow a write will still ban a write (or perhaps chmod will fail). There may be cases where drivers have changed over time and on different releases such that a file which was allowed a write on some other platform or software version no longer produce the file, or no longer allow writes to the file. The file permissions are very likely correct to start with.

An example of likely change in behavior or existence of those files would be between a 3.x kernel version and a 4.x kernel version…so if you used R24.2.1 in the past, or if the script was written for this, then many prior versions would also work with that script…future versions (R28.1 and newer) are likely to fail because of major kernel differences. The question becomes “what version of L4T is the script intended to be compatible with”, and “what version of L4T is the script being used with”.

@linuxdev Thanks you !

I have tried the jetson_clocks.sh from https://github.com/jetsonhacks/installCaffeJTX1
and it can work !

Thanks for help !

Hello,

I use to read https://elinux.org/Jetson/TX1_Controlling_Performance and adapt it to work with L4T 24.2.1. I have recently updated to 28.1.0, and everything is different there. I have never tried the script you mention here on 24.2.1, but I’ve tried it on 28.1.0 and it does not look to do the job.

Most entries of /sys/ listed in https://elinux.org/Jetson/TX1_Controlling_Performance have disappeared:

  • /sys/devices/system/cpu/cpu*/cpuidle/state*/disable
  • /sys/devices/system/cpu/cpuquiet/current_governor
  • /sys/kernel/debug/clock/override.gbus/rate
  • /sys/kernel/debug/clock/override.gbus/state
  • /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
  • /sys/kernel/debug/clock/override.emc/rate

Do you know if there is a documentation, or a script for 21.8.0? I’ve looked around but I did not yet find anything.

Thanks,
– NicoD

R28.1 has jetson_clocks.sh in the ~nvidia and ~ubuntu home directories. There is also now “nvpmodel” (in “/usr/sbin/”…see “nvpmodel -h”). “nvpmodel -p --verbose” is a listing of all modes, the one you are probably interested in is:

sudo nvpmodel -m 0

EDIT: I was looking at a TX2 when writing this, and do not have a TX1 connected at the moment…not sure if this all applies to a TX1 on R28.1.

Hi Linuxdev,

I’m afraid ‘nvpmodel’ is only available on TX2. I don’t find it on TX1. I did not find ‘jetson_clock.sh’ in nvidia and ubuntu homedirs, but I will double check.

(I’ve just seen your post edit, so it matches my observations.)

Thanks,
– NicoD

(sorry, duplicate)

“jetson_clocks.sh” (plural). This is definitely part of both older and newer TX1 and TX2 installs. Just to see if the install was as expected, does “sha1sum -c /etc/nv_tegra_release” run ok?

Correct, my apologies, I was using a wrong ‘find’ in the rootfs. First test with no arguments just froze my device, and as board (and kernel) is different, I need to investigate first:

# bash -x ./jetson_clocks.sh
…
+ case "${SOCFAMILY}" in
+ GPU_MIN_FREQ=/sys/devices/57000000.gpu/devfreq/57000000.gpu/min_freq
+ GPU_MAX_FREQ=/sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq
+ GPU_CUR_FREQ=/sys/devices/57000000.gpu/devfreq/57000000.gpu/cur_freq
+ GPU_RAIL_GATE=/sys/devices/57000000.gpu/railgate_enable
+ case "${ACTION}" in
+ echo 0
./jetson_clocks.sh: line 251: echo: write error: Invalid argument
+ cat /sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq

and then freeze. It seems that I cannot write into ‘/sys/devices/57000000.gpu/railgate_enable’:

# echo 0 > /sys/devices/57000000.gpu/railgate_enable 
bash: echo: write error: Invalid argument

What made properly freeze my device is:

# cat /sys/devices/57000000.gpu/devfreq/57000000.gpu/max_freq > /sys/devices/57000000.gpu/devfreq/57000000.gpu/min_freq

With ‘–show’:

# ./jetson_clocks.sh --show
SOC family:tegra210  Machine:jetson_tx1
Online CPUs: 0-3
CPU Cluster Switching: Disabled
cpu0: Gonvernor=performance MinFreq=1734000 MaxFreq=1734000 CurrentFreq=1734000
cpu1: Gonvernor=performance MinFreq=1734000 MaxFreq=1734000 CurrentFreq=1734000
cpu2: Gonvernor=performance MinFreq=1734000 MaxFreq=1734000 CurrentFreq=1734000
cpu3: Gonvernor=performance MinFreq=1734000 MaxFreq=1734000 CurrentFreq=1734000
GPU MinFreq=76800000 MaxFreq=998400000 CurrentFreq=76800000
EMC MinFreq=12750000 MaxFreq=1600000000 CurrentFreq=800000000 FreqOverride=0
Fan: speed=255

‘sha1sum -c /etc/nv_tegra_release’ is OK for all lines.
Thank you for your help, I believe I have to review my kernel now.
– NicoD

My bad, I was using the wrong device. I am able to run ‘./jetson.sh’ without any problem, and the system is not freezing anymore. Sorry for my wrong analysis.
– NicoD