rbonghi / jetson_stats

📊 Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series
https://rnext.it/jetson_stats
GNU Affero General Public License v3.0
2.14k stars 261 forks source link

Do not have fan controller #234

Closed cpymaple closed 2 years ago

cpymaple commented 2 years ago

Hi, my device is Jetson NX and my environment is ubuntu 20.04. After I install the jetson_stats, it seems that I do not have the fan controller (jtop -> 5 ->but there is no button to control fan). And then I want to control the fan manually, but I do not have the pwm-fan folder in /sys/devices/pwm-fan. Do you know how to solve it ?

cpymaple commented 2 years ago

2022-06-09 14-40-33 的屏幕截图 2022-06-09 14-40-41 的屏幕截图 2022-06-09 14-41-18 的屏幕截图

rbonghi commented 2 years ago

You are working with JP5.0 that is currently not supported. #224 I will release soon a new version to manage it

rbonghi commented 2 years ago

If you want to test the new version 4.0.0rc1:

sudo -H pip install jetson-stats==4.0.0rc1

Please remember right now jtop is unstable, I'm still fixing other bugs

theofficialgman commented 2 years ago

I have tested the new version (4.0.0rc1) on 32.3.1 and do not have fan speed. the fan is located under the legacy path and I can read from it via terminal but shows as disabled in jtop

systemctl status jetson_stats.service 
● jetson_stats.service - jetson_stats service
   Loaded: loaded (/etc/systemd/system/jetson_stats.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-06-10 11:45:32 EDT; 2s ago
 Main PID: 25344 (jtop)
    Tasks: 4 (limit: 4144)
   CGroup: /system.slice/jetson_stats.service
           ├─25344 /usr/bin/python /usr/local/bin/jtop service --force
           ├─25387 /usr/bin/python /usr/local/bin/jtop service --force
           └─25395 /usr/bin/python /usr/local/bin/jtop service --force

Jun 10 11:45:32 garrett-usb systemd[1]: Started jetson_stats service.
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.core.common - fan loaded on /sys/devices/platform
Jun 10 11:45:32 garrett-usb jtop[25344]: [WARNING] jtop.service - Fan is not available on this board in paths ['/sys/devices/platform']
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.core.common - fan loaded on /sys/devices/platform
Jun 10 11:45:32 garrett-usb jtop[25344]: [WARNING] jtop.core.fan - No access to fan files: rpm_measured, cur_pwm, target_pwm, temp_control
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.core.common - jetson_clocks loaded on /usr/bin/jetson_clocks
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.core.common - tegrastats loaded on /usr/bin/tegrastats
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.__main__ - jetson_stats server loaded
Jun 10 11:45:32 garrett-usb jtop[25344]: [INFO] jtop.core.fan - Mode set default status=False
garrett@garrett-usb:~$ ls /sys/devices/platform
 alarmtimer  'Fixed MDIO bus.0'   host1x   power   ramoops.0   reg-dummy   regulatory.0   serial8250   snd-soc-dummy   tegra-fuse   uevent
garrett@garrett-usb:~$ ls /sys/devices/pwm-fan
cur_pwm  driver_override  fan_profile  kickstart_params  of_node  pwm_cap        pwm_state_map  state_cap  subsystem    target_pwm    uevent
driver   fan_kickstart    hwmon        modalias          power    pwm_rpm_table  rpm_measured   step_time  tach_enable  temp_control
garrett@garrett-usb:~$ cat /sys/devices/pwm-fan/rpm_measured 
2718

the fan was working on 3.1.4 (shown below) and is now not working on 4.0.0rc1 (shown above)

systemctl status jetson_stats.service 
● jetson_stats.service - jetson_stats service
   Loaded: loaded (/etc/systemd/system/jetson_stats.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-06-10 11:51:52 EDT; 35s ago
 Main PID: 32203 (jtop)
    Tasks: 8 (limit: 4144)
   CGroup: /system.slice/jetson_stats.service
           ├─32203 /usr/bin/python /usr/local/bin/jtop service --force
           ├─32243 /usr/bin/python /usr/local/bin/jtop service --force
           └─32251 /usr/bin/python /usr/local/bin/jtop service --force

Jun 10 11:51:52 garrett-usb systemd[1]: Started jetson_stats service.
Jun 10 11:51:53 garrett-usb jtop[32203]: [INFO] jtop.core.common - fan loaded on /sys/devices/pwm-fan
Jun 10 11:51:53 garrett-usb jtop[32203]: [INFO] jtop.core.common - jetson_clocks loaded on /usr/bin/jetson_clocks
Jun 10 11:51:53 garrett-usb jtop[32203]: [INFO] jtop.core.common - tegrastats loaded on /usr/bin/tegrastats
Jun 10 11:51:53 garrett-usb jtop[32203]: [INFO] jtop.__main__ - jetson_stats server loaded
Jun 10 11:51:53 garrett-usb jtop[32203]: [INFO] jtop.core.fan - Mode set default status=False
Jun 10 11:51:54 garrett-usb jtop[32203]: [INFO] jtop.service - tegrastats started 500ms
Jun 10 11:52:24 garrett-usb jtop[32203]: [INFO] jtop.service - tegrastats close
Jun 10 11:52:24 garrett-usb jtop[32203]: [INFO] jtop.service - jetson_clocks show closed
rbonghi commented 2 years ago

Hi @theofficialgman which Jetson are you using?

rbonghi commented 2 years ago

BTW: I found the same bug on old JP. I'm still fixing :-)

Thank you

rbonghi commented 2 years ago

This release should fix all these bugs

sudo -H pip install jetson-stats==4.0.0rc2

Please remember right now jtop is unstable, I'm still fixing other bugs

cpymaple commented 2 years ago

If you want to test the new version 4.0.0rc1:

sudo -H pip install jetson-stats==4.0.0rc1

Please remember right now jtop is unstable, I'm still fixing other bugs

OK, thank you. I find a way to solve it. 1. sudo /usr/bin/jetson_clocks --fan, this command can turn on the fan. 2. /sys/devices/platform/pwm-fan/hwmon/hwmon4. In this folder, we can find pwm1 document, change the number( from 0-255 ) can change the speed of fan.