본문 바로가기

NVIDIA Jeston/Jetson BSP

[Jetson] Xavier NX 방열팬 제어

NVIDIA Jetson Xavier NX 방열팬 제어

고온에서 SoC 의 열 관리를 위해 NVIDIA Jetson 에서는 방열팬을 제어하는 인터페이스를 제공한다. NVIDIA Jetson Xavier NX 의 방열팬 속도를 제어를 해보자.

NVIDIA Jetson Xavier NX 방열팬 제어하기

NVIDIA Jetson Xavier NX 는 방열팬을 제어할 수 있는 인터페이스를 제공한다. 팬 제어하는 방법은 Jetpack (L4T) 버전에 따라서 다를 수 있다. (파일 시스템 내의 device node 의 위치가 상이)

테스트 환경

  • NVIDIA Jetson Xavier NX + JetPack 4.6 (L4T R32.6.1)

FAN 제어 관련 device node 위치

NVIDIA Jetson Xavier NX 의 JetPack 4.6 (L4T R32.6.1) 기준으로 방열팬 제어를 위한 파일은 다음 위치에 있다.

nvidia@nvidia-desktop:/sys/devices/pwm-fan$ ls
cur_pwm          fan_available_profiles  fan_rpm_in_limit  modalias  pwm_cap        rpm_measured  subsystem    temp_control
driver           fan_kickstart           hwmon             of_node   pwm_rpm_table  state_cap     tach_enable  uevent
driver_override  fan_profile             kickstart_params  power     pwm_state_map  step_time     target_pwm

이 중의 target_pwm 노드에 값 (0~255) 를 입력하면, FAN 을 회전시킬 수 있다.

FAN 속도 제어 방법

터미널에서 target_pwm 값을 130 으로 변경하면 FAN 이 회전한다.

$ sudo echo 130 | sudo tee /sys/devices/pwm-fan/target_pwm

터미널에서 target_pwm 값을 255 로 변경하면 FAN 이 최대 속도로 회전한다.

$ sudo echo 255 | sudo tee /sys/devices/pwm-fan/target_pwm

터미널에서 target_pwm 값을 0으로 변경하면 FAN 이 멈춘다.

$ sudo echo 0 | sudo tee /sys/devices/pwm-fan/target_pwm

FAN 제어 프로파일의 위치

고온에서 SoC 의 열 관리를 위해 NVIDIA Jetson 에서는 외부 온도에 대해 FAN 의 속도를 제어하는 매커니즘을 제공한다. 이 프로파일은 device tree 에 정의되어, 아래 proc 파일 시스템으로 로드 된다.

nvidia@nvidia-desktop:/proc/device-tree/thermal-fan-est/profiles$ ll
total 0
drwxr-xr-x 4 root root 0  6월 30 13:26 ./
drwxr-xr-x 3 root root 0  6월 30 13:26 ../
drwxr-xr-x 2 root root 0  6월 30 14:49 cool/
-r--r--r-- 1 root root 6  6월 30 13:26 default
-r--r--r-- 1 root root 9  6월 30 13:26 name
drwxr-xr-x 2 root root 0  6월 30 13:26 quiet/

Device tree 내에 FAN profile 정의

NVIDIA Jetson Xavier NX 의 JetPack 4.6 (L4T R32.6.1) 기준으로 아래의 dtsi 파일에 Fan 제어에 대한 profile 의 정의되어 있다.

hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-platforms/tegra194-thermal-fan-est.dtsi

다음의 프로파일에 대한 dtsi 파일에서 quiet 와 cool 모드의 trip 단계 값을 정의, 수정할 수 있으니 참고하자.

/*
 * Copyright (c) 2015-2018, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

/ {
	thermal_fan_est_shared_data: tfesd {
		secret = <37>;
		toffset = <0>;
		polling_period = <1100>;
		ndevs = <3>;
		cdev_type = "pwm-fan";
		tzp_governor_name = "pid_thermal_gov";

		dev1 {
			dev_data = "CPU-therm";
			coeffs = <30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>;
		};
		dev2 {
			dev_data = "GPU-therm";
			coeffs = <30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>;
		};
		dev3 {
			dev_data = "AUX-therm";
			coeffs = <40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>;
		};
	};

	thermal-fan-est {
		compatible = "thermal-fan-est";
		name = "thermal-fan-est";
		status = "okay";
		num_resources = <0>;
		shared_data = <&thermal_fan_est_shared_data>;
		trip_length = <10>;
		profiles {
			default = "quiet";
			quiet {
				active_trip_temps = <0 50000 63000 72000 81000
						140000 150000 160000 170000 180000>;
				active_hysteresis = <0 18000 8000 8000 8000
						0 0 0 0 0>;
			};
			cool {
				active_trip_temps = <0 35000 53000 62000 73000
						140000 150000 160000 170000 180000>;
				active_hysteresis = <0 9000 8000 8000 9000
						0 0 0 0 0>;
			};
		};
	};
};

참고자료

NVIDIA Developer Guide 내에 Fan Profile 항목을 참고한다.

https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/PlatformPowerAndPerformance/JetsonXavierNxSeriesAndJetsonAgxXavierSeries.html#fan-profile-control

 

Jetson Xavier NX Series and Jetson AGX Xavier Series — Jetson Linux<br/>Developer Guide 34.1 documentation

This topic describes power and performance management features of NVIDIA® Jetson Xavier™ NX series and NVIDIA® Jetson AGX Xavier™ series devices. It describes the power, thermal, and electrical management features visible to software, as well as some

docs.nvidia.com