How to modify ``/etc/nvfancontrol.conf`` for fan speed control

Based on this discussion on fan speed control on jetson nano. Jetson Orin fan is not working - #12 by KevinFFF

My fan was not working and it was working only on the boot time. The fan wasn’t working when running jetson board, however, i have managed to run the fan for small duration. The fan turns on for 1-2 seconds and then turn off for 4-5 seconds. It seems like the fan speed is not maximum when it runs. The board is hot and i get warning about temperature. The recommended solution was to modify the /etc/nvfancontrol.conf settings to get it work in a desired manner. However, I have gone through the documentation and I am not sure how it works. there are no clear steps that highlight how to change profile settings so I can get it work. Could you guide me what to modify in the file so I get it running.

Hi engrfaizan.ai,

Have you referred to the following instruction to configure nvfancontrol configuration file?
Jetson Orin Nano Series, Jetson Orin NX Series and Jetson AGX Orin Series — Jetson Linux Developer Guide documentation (nvidia.com)

You can configure your own profile for the PWM with different temperature.

I have tried like a I changed the file as shown below:

#
# Copyright (c) 2022, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#

POLLING_INTERVAL 2

<FAN 1>
	TMARGIN ENABLED
	FAN_GOVERNOR cont {
		STEP_SIZE 10
	}
	FAN_CONTROL close_loop {
		RPM_TOLERANCE 100
	}
	FAN_PROFILE quiet {
		#TEMP 	HYST	PWM	RPM
		0	0	255	6000
		10	0	255	6000
		11	0	187	4000
		31	0	187	4000
		70	0 	0	0
		105	0 	0 	0
	}



#	FAN_PROFILE cool {
		#TEMP 	HYST	PWM	RPM
#		0	0	255	6000
#		35	0	255	6000
#		70	0 	0	0
#		105	0 	0 	0
#	}


FAN_PROFILE cool {
    #TEMP   HYST    PWM     RPM
    0       0       0        0  # No speed at  0°C
    10      0       0        0  # at  10°C
    11      0       0        0  # at  11°C
    30      0       187     4000  # Max fan speed at 30°C
    60      0       255     6000  # Max fan speed at 60°C
    105     0       255     6000  # Max fan speed at 105°C
}




	THERMAL_GROUP 0 {
		GROUP_MAX_TEMP 105
		#Thermal-Zone Coeffs Max-Temp
		CPU-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		GPU-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC0-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC1-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
		SOC2-therm 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0
	}
	FAN_DEFAULT_CONTROL close_loop
	FAN_DEFAULT_PROFILE cool
	FAN_DEFAULT_GOVERNOR cont
	KICKSTART_PWM 64

but it is still showing the old behaviour. And the board temperature is high

tegrastats
08-27-2024 10:47:50 RAM 3805/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [1%@1510,1%@1510,1%@1510,1%@1510,1%@1510,0%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.437C SOC2@82.062C SOC0@80.218C CV1@-256C GPU@82.562C tj@82.562C SOC1@80.906C CV2@-256C
08-27-2024 10:47:51 RAM 3805/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [2%@1510,0%@1510,1%@1510,1%@1510,0%@1510,2%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.281C SOC2@82.062C SOC0@80.062C CV1@-256C GPU@82.281C tj@82.281C SOC1@80.968C CV2@-256C
08-27-2024 10:47:52 RAM 3804/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [25%@1510,3%@1510,4%@1510,3%@1510,2%@1510,7%@1510] EMC_FREQ 0% GR3D_FREQ 19%@[0] CV0@-256C CPU@82.781C SOC2@82.125C SOC0@80.093C CV1@-256C GPU@82.406C tj@82.781C SOC1@80.937C CV2@-256C
08-27-2024 10:47:53 RAM 3804/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [0%@1510,0%@1510,1%@1510,0%@1510,1%@1510,1%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.343C SOC2@82.25C SOC0@80.062C CV1@-256C GPU@82.625C tj@82.625C SOC1@80.968C CV2@-256C
08-27-2024 10:47:54 RAM 3804/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [1%@1510,1%@1510,1%@1510,0%@1510,1%@1510,2%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.281C SOC2@82.062C SOC0@80.093C CV1@-256C GPU@82.406C tj@82.406C SOC1@80.937C CV2@-256C
08-27-2024 10:47:55 RAM 3804/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [1%@1510,0%@1510,5%@1510,0%@1510,1%@1510,2%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.593C SOC2@82.125C SOC0@80.093C CV1@-256C GPU@82.656C tj@82.593C SOC1@80.937C CV2@-256C
08-27-2024 10:47:56 RAM 3803/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [2%@1510,3%@1510,1%@1510,1%@1510,1%@1510,1%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.5C SOC2@82.125C SOC0@80.093C CV1@-256C GPU@82.625C tj@82.625C SOC1@81.031C CV2@-256C
08-27-2024 10:47:57 RAM 3819/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [1%@1510,2%@1510,0%@1510,22%@1510,5%@1510,1%@1510] EMC_FREQ 0% GR3D_FREQ 0%@[0] CV0@-256C CPU@82.531C SOC2@82.156C SOC0@80.062C CV1@-256C GPU@82.406C tj@82.531C SOC1@80.937C CV2@-256C
08-27-2024 10:47:58 RAM 3804/7471MB (lfb 27x1MB) SWAP 898/3736MB (cached 8MB) CPU [3%@1510,2%@1510,3%@1510,7%@1510,3%@1510,3%@1510] EMC_FREQ 0% GR3D_FREQ 11%@[0] CV0@-256C CPU@82.687C SOC2@82.031C SOC0@80.062C CV1@-256C GPU@82.468C tj@82.687C SOC1@80.812C CV2@-256C

@KevinFFF

and then after saving i ran following command:

sudo systemctl restart nvfancontrol

I run this to check everything is fine. I get the following output:

sudo systemctl status nvfancontrol
[sudo] password for jetson: 
● nvfancontrol.service - nvfancontrol service
     Loaded: loaded (/etc/systemd/system/nvfancontrol.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-08-27 10:33:28 PKT; 17min ago
   Main PID: 28824 (nvfancontrol)
      Tasks: 1 (limit: 8642)
     Memory: 368.0K
     CGroup: /system.slice/nvfancontrol.service
             └─28824 /usr/sbin/nvfancontrol &

Aug 27 10:33:28 ubuntu systemd[1]: Started nvfancontrol service.

and i checked for conflicting speed control files, i found this:

ps aux | grep fan
root         961  0.0  0.1  17664  8452 ?        Ss   09:54   0:01 /usr/bin/python3 /home/jetson/Faizan/fan_control.py
root       28824  0.0  0.0   2472  1492 ?        Ss   10:33   0:00 /usr/sbin/nvfancontrol &
jetson     45518  0.0  0.0   8572   652 pts/0    S+   10:52   0:00 grep --color=auto fan

thermal zones info:

cat /sys/class/thermal/thermal_zone*/temp
85750
86062
-256000
-256000
-256000
83343
84593
85250
86062

Is fan_control.py your custom python script to control the fan?

What’s the pwm/rpm of the FAN at this moment?

Yes I think this what I wrote when Fan was not working. But it didn’t work. The solution here worked but the fan works for 1-2 secs and turn off for 5 secs and this repeats. The speed of the fan is low when it runs. I don’t know what would be pwm/rpm when it runs? @KevinFFF

Please confirm that the nvfancontrol service has been disabled correctly and there’s no other process is controlling the FAN in background.
Using echo command to write 255 should enable the FAN run with the max speed and it should not stop.

You can run the following command to check its rpm.

$ cat /sys/class/hwmon/hwmon0/rpm

this is rpm

cat /sys/class/hwmon/hwmon0/rpm
280374

how to disable other fan control processes ?

You can just run ps aux|grep -i fan to check if there’s other process is controlling the fan.

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