← Documents Documentation/gpu/amdgpu/thermal.rst GitHub 원문 ↗

Linux 6.18.37 · GPU

GPU Power/Thermal Controls and Monitoring

AMDGPU HWMON·DPM·fan kernel-doc와 GFXOFF enable, status, count, residency 인터페이스를 전문 번역합니다.

Source pathDocumentation/gpu/amdgpu/thermal.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

thermal.rst:1-170

이 문서는 AMDGPU의 HWMON, DPM·power profile·busy metrics·fan 제어에 관한 18개 `amdgpu_pm.c` kernel-doc 계약과 GFXOFF debugfs 인터페이스를 연결합니다. GFXOFF에서는 진입 허용 값, 현재 상태, 누적 진입 횟수, 마지막 interval의 residency를 서로 다른 파일에서 읽습니다.

전력·thermal 인터페이스 지도
영역주요 항목
HWMON·DPMhwmon, power_dpm_state, pp_table, pp_dpm_*
Profile·metricspp_power_profile_mode, pm_policy, busy_percent, gpu_metrics
Fanfan_curve, acoustic threshold, target temperature, PWM, zero RPM
GFXOFF 제어amdgpu_gfxoff, amdgpu_gfxoff_status
GFXOFF 계측amdgpu_gfxoff_count, amdgpu_gfxoff_residency

문서 전반을 kernel-doc sysfs와 GFXOFF debugfs로 나눠 봅니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ===========================================
2 GPU Power/Thermal Controls and Monitoring
3 ===========================================
4
5 HWMON Interfaces
6 ================
7
8 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
9 :doc: hwmon
10
11 GPU sysfs Power State Interfaces
12 ================================
13
14 GPU power controls are exposed via sysfs files.
15
16 power_dpm_state
17 ---------------
18
19 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
20 :doc: power_dpm_state
21
22 power_dpm_force_performance_level
23 ---------------------------------
24
25 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
26 :doc: power_dpm_force_performance_level
27
28 pp_table
29 --------
30
31 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
32 :doc: pp_table
33
34 pp_od_clk_voltage
35 -----------------
36
37 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
38 :doc: pp_od_clk_voltage
39
40 pp_dpm_*
41 --------
42
43 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
44 :doc: pp_dpm_sclk pp_dpm_mclk pp_dpm_socclk pp_dpm_fclk pp_dpm_dcefclk pp_dpm_pcie
45
46 pp_power_profile_mode
47 ---------------------
48
49 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
50 :doc: pp_power_profile_mode
51
52 pm_policy
53 ---------------------
54
55 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
56 :doc: pm_policy
57
58 \*_busy_percent
59 ---------------
60
61 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
62 :doc: gpu_busy_percent
63
64 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
65 :doc: mem_busy_percent
66
67 gpu_metrics
68 -----------
69
70 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
71 :doc: gpu_metrics
72
73 fan_curve
74 ---------
75
76 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
77 :doc: fan_curve
78
79 acoustic_limit_rpm_threshold
80 ----------------------------
81
82 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
83 :doc: acoustic_limit_rpm_threshold
84
85 acoustic_target_rpm_threshold
86 -----------------------------
87
88 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
89 :doc: acoustic_target_rpm_threshold
90
91 fan_target_temperature
92 ----------------------
93
94 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
95 :doc: fan_target_temperature
96
97 fan_minimum_pwm
98 ---------------
99
100 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
101 :doc: fan_minimum_pwm
102
103 fan_zero_rpm_enable
104 ----------------------
105
106 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
107 :doc: fan_zero_rpm_enable
108
109 fan_zero_rpm_stop_temperature
110 -----------------------------
111
112 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
113 :doc: fan_zero_rpm_stop_temperature
114
115 GFXOFF
116 ======
117
118 GFXOFF is a feature found in most recent GPUs that saves power at runtime. The
119 card's RLC (RunList Controller) firmware powers off the gfx engine
120 dynamically when there is no workload on gfx or compute pipes. GFXOFF is on by
121 default on supported GPUs.
122
123 Userspace can interact with GFXOFF through a debugfs interface (all values in
124 `uint32_t`, unless otherwise noted):
125
126 ``amdgpu_gfxoff``
127 -----------------
128
129 Use it to enable/disable GFXOFF, and to check if it's current enabled/disabled::
130
131 $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff
132 01
133
134 - Write 0 to disable it, and 1 to enable it.
135 - Read 0 means it's disabled, 1 it's enabled.
136
137 If it's enabled, that means that the GPU is free to enter into GFXOFF mode as
138 needed. Disabled means that it will never enter GFXOFF mode.
139
140 ``amdgpu_gfxoff_status``
141 ------------------------
142
143 Read it to check current GFXOFF's status of a GPU::
144
145 $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff_status
146 02
147
148 - 0: GPU is in GFXOFF state, the gfx engine is powered down.
149 - 1: Transition out of GFXOFF state
150 - 2: Not in GFXOFF state
151 - 3: Transition into GFXOFF state
152
153 If GFXOFF is enabled, the value will be transitioning around [0, 3], always
154 getting into 0 when possible. When it's disabled, it's always at 2. Returns
155 ``-EINVAL`` if it's not supported.
156
157 ``amdgpu_gfxoff_count``
158 -----------------------
159
160 Read it to get the total GFXOFF entry count at the time of query since system
161 power-up. The value is an `uint64_t` type, however, due to firmware limitations,
162 it can currently overflow as an `uint32_t`. *Only supported in vangogh*
163
164 ``amdgpu_gfxoff_residency``
165 ---------------------------
166
167 Write 1 to amdgpu_gfxoff_residency to start logging, and 0 to stop. Read it to
168 get average GFXOFF residency % multiplied by 100 during the last logging
169 interval. E.g. a value of 7854 means 78.54% of the time in the last logging
170 interval the GPU was in GFXOFF mode. *Only supported in vangogh*
171

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

HWMON과 GPU 전력 상태·clock 인터페이스

1-45

GPU 전력·thermal 제어와 monitoring의 HWMON 인터페이스는 `drivers/gpu/drm/amd/pm/amdgpu_pm.c`의 `hwmon` kernel-doc에서 가져옵니다. GPU 전력 제어는 sysfs 파일로 노출됩니다.

`power_dpm_state`, `power_dpm_force_performance_level`, `pp_table`, `pp_od_clk_voltage`는 각각 같은 이름의 `:doc:` 계약에 연결됩니다. 이 페이지는 속성 이름과 문서 소유 위치를 제공하며, 실제 값 형식과 지원 조건은 각 kernel-doc가 정의합니다.

`pp_dpm_*` 절은 하나의 kernel-doc 선택자에서 `pp_dpm_sclk`, `pp_dpm_mclk`, `pp_dpm_socclk`, `pp_dpm_fclk`, `pp_dpm_dcefclk`, `pp_dpm_pcie` 여섯 항목을 함께 참조합니다.

전력 상태와 DPM kernel-doc 지도
문서 절:doc: 선택자
HWMON Interfaceshwmon
power_dpm_statepower_dpm_state
power_dpm_force_performance_levelpower_dpm_force_performance_level
pp_tablepp_table
pp_od_clk_voltagepp_od_clk_voltage
pp_dpm_*pp_dpm_sclk, pp_dpm_mclk, pp_dpm_socclk, pp_dpm_fclk, pp_dpm_dcefclk, pp_dpm_pcie

각 sysfs 문서 절과 amdgpu_pm.c의 :doc: 선택자를 대응합니다.

전력 제어 정의 탐색
Documentation/gpu/amdgpu/thermal.rst에서 sysfs 절 선택해당 .. kernel-doc:: 지시어 확인drivers/gpu/drm/amd/pm/amdgpu_pm.c 열기정확한 :doc: key에서 값 형식과 지원 조건 확인

속성 이름에서 실제 kernel-doc 계약으로 이동하는 경로입니다.

===========================================
 GPU Power/Thermal Controls and Monitoring
===========================================

HWMON Interfaces
================

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: hwmon

GPU sysfs Power State Interfaces
================================

GPU power controls are exposed via sysfs files.

power_dpm_state
---------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: power_dpm_state

power_dpm_force_performance_level
---------------------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: power_dpm_force_performance_level

pp_table
--------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: pp_table

pp_od_clk_voltage
-----------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: pp_od_clk_voltage

pp_dpm_*
--------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: pp_dpm_sclk pp_dpm_mclk pp_dpm_socclk pp_dpm_fclk pp_dpm_dcefclk pp_dpm_pcie

전력 profile, busy percent, metrics와 fan curve

46-77

`pp_power_profile_mode`와 `pm_policy`는 전력 profile 및 policy에 해당하는 kernel-doc 계약으로 연결됩니다. 구체적인 mode와 policy 값은 각각의 `:doc:` 문서가 기준입니다.

`*_busy_percent` 절은 `gpu_busy_percent`와 `mem_busy_percent` 두 kernel-doc 항목을 포함합니다. GPU와 memory busy percentage를 서로 다른 문서 key로 제공하므로 값을 해석할 때 대상을 구분해야 합니다.

`gpu_metrics`는 GPU metrics 계약에, `fan_curve`는 fan curve 계약에 연결됩니다. 두 인터페이스의 실제 자료 형식은 `amdgpu_pm.c`의 해당 문서 블록이 정의합니다.

Profile·metrics·fan curve 항목
문서 절:doc: key구분
pp_power_profile_modepp_power_profile_mode전력 profile mode
pm_policypm_policy전력 관리 policy
*_busy_percentgpu_busy_percentGPU busy percentage
*_busy_percentmem_busy_percentMemory busy percentage
gpu_metricsgpu_metricsGPU metrics
fan_curvefan_curveFan curve

한 절에 여러 kernel-doc가 있는 busy percent를 포함하여 전체 key를 보존합니다.

Monitoring 항목 선택
GPU 사용률은 gpu_busy_percent 선택Memory 사용률은 mem_busy_percent 선택종합 metrics는 gpu_metrics 선택Fan curve는 fan_curve 선택각 값의 단위와 형식은 amdgpu_pm.c kernel-doc 확인

관찰 목적에 맞는 문서 key를 구분해 찾습니다.

pp_power_profile_mode
---------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: pp_power_profile_mode

pm_policy
---------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: pm_policy

\*_busy_percent
---------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: gpu_busy_percent

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: mem_busy_percent

gpu_metrics
-----------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: gpu_metrics

fan_curve
---------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: fan_curve

Acoustic과 fan 제어 항목

78-113

Fan 관련 후반부는 acoustic RPM threshold 두 종류, target temperature, minimum PWM, zero RPM enable, zero RPM stop temperature를 각각 별도 kernel-doc 계약으로 연결합니다.

`acoustic_limit_rpm_threshold`와 `acoustic_target_rpm_threshold`는 이름이 비슷하지만 서로 다른 속성입니다. `fan_zero_rpm_enable`은 기능 활성화 계약이고 `fan_zero_rpm_stop_temperature`는 정지 온도 계약이므로 하나의 값으로 합쳐 해석하지 않습니다.

Fan·acoustic kernel-doc 전체 목록
속성문서 계약
acoustic_limit_rpm_thresholdacoustic_limit_rpm_threshold
acoustic_target_rpm_thresholdacoustic_target_rpm_threshold
fan_target_temperaturefan_target_temperature
fan_minimum_pwmfan_minimum_pwm
fan_zero_rpm_enablefan_zero_rpm_enable
fan_zero_rpm_stop_temperaturefan_zero_rpm_stop_temperature

원문 제목과 :doc: key가 일대일로 대응합니다.

Fan 설정 구분
Acoustic limit와 target RPM threshold 구분Fan target temperature 확인Fan minimum PWM 확인Zero RPM 기능 enable 여부 확인Zero RPM stop temperature 확인

비슷한 이름을 목적별로 분리해 kernel-doc를 찾습니다.


acoustic_limit_rpm_threshold
----------------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: acoustic_limit_rpm_threshold

acoustic_target_rpm_threshold
-----------------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: acoustic_target_rpm_threshold

fan_target_temperature
----------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: fan_target_temperature

fan_minimum_pwm
---------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: fan_minimum_pwm

fan_zero_rpm_enable
----------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: fan_zero_rpm_enable

fan_zero_rpm_stop_temperature
-----------------------------

.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
   :doc: fan_zero_rpm_stop_temperature

GFXOFF enable과 현재 runtime 상태

114-155

GFXOFF는 최근 GPU 대부분에서 제공되는 runtime 절전 기능입니다. gfx 또는 compute pipe에 workload가 없으면 card의 RLC(RunList Controller) firmware가 gfx engine의 전원을 동적으로 끕니다. 지원되는 GPU에서는 기본으로 켜져 있습니다.

userspace는 debugfs를 통해 GFXOFF와 상호작용합니다. 별도 설명이 없으면 모든 값은 `uint32_t`입니다. `amdgpu_gfxoff`는 GFXOFF를 활성화·비활성화하고 그 허용 상태를 확인하는 인터페이스입니다.

$ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff
01

`amdgpu_gfxoff`에 `0`을 쓰면 비활성화하고 `1`을 쓰면 활성화합니다. 읽기 결과 `0`은 비활성, `1`은 활성입니다. 활성이라는 값은 GPU가 필요할 때 GFXOFF mode로 들어갈 수 있다는 뜻이며, 지금 실제로 그 상태에 있다는 뜻은 아닙니다. 비활성화하면 GFXOFF mode에 절대 들어가지 않습니다.

실제 현재 상태는 `amdgpu_gfxoff_status`를 읽어 확인합니다.

$ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff_status
02
amdgpu_gfxoff_status 값
상태
0GPU가 GFXOFF 상태이며 gfx engine 전원 차단
1GFXOFF 상태에서 빠져나오는 중
2GFXOFF 상태가 아님
3GFXOFF 상태로 들어가는 중

Enable 허용 상태와 구분되는 실제 GFXOFF runtime 상태입니다.

GFXOFF enable과 status 관계
amdgpu_gfxoff에 1을 써서 GFXOFF 진입 허용workload가 없을 때 RLC firmware가 gfx engine 전원 차단 가능status가 3이면 진입 중status가 0이면 실제 GFXOFF 상태status가 1이면 빠져나오는 중, 2이면 GFXOFF 상태가 아님

활성화는 진입 허용이고 status는 실제 순간 상태입니다.

GFXOFF가 활성화되어 있으면 상태 값은 `[0, 3]` 사이에서 전환하며 가능할 때마다 `0`으로 들어갑니다. 비활성화되어 있으면 항상 `2`입니다. 지원되지 않으면 `-EINVAL`을 반환합니다.


GFXOFF
======

GFXOFF is a feature found in most recent GPUs that saves power at runtime. The
card's RLC (RunList Controller) firmware powers off the gfx engine
dynamically when there is no workload on gfx or compute pipes. GFXOFF is on by
default on supported GPUs.

Userspace can interact with GFXOFF through a debugfs interface (all values in
`uint32_t`, unless otherwise noted):

``amdgpu_gfxoff``
-----------------

Use it to enable/disable GFXOFF, and to check if it's current enabled/disabled::

  $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff
  01

- Write 0 to disable it, and 1 to enable it.
- Read 0 means it's disabled, 1 it's enabled.

If it's enabled, that means that the GPU is free to enter into GFXOFF mode as
needed. Disabled means that it will never enter GFXOFF mode.

``amdgpu_gfxoff_status``
------------------------

Read it to check current GFXOFF's status of a GPU::

  $ xxd -l1 -p /sys/kernel/debug/dri/0/amdgpu_gfxoff_status
  02

- 0: GPU is in GFXOFF state, the gfx engine is powered down.
- 1: Transition out of GFXOFF state
- 2: Not in GFXOFF state
- 3: Transition into GFXOFF state

If GFXOFF is enabled, the value will be transitioning around [0, 3], always
getting into 0 when possible. When it's disabled, it's always at 2. Returns
``-EINVAL`` if it's not supported.

GFXOFF entry count와 residency

156-170

`amdgpu_gfxoff_count`를 읽으면 system power-up 이후 조회 시점까지 GFXOFF에 진입한 총 횟수를 얻습니다. 값의 형식은 `uint64_t`이지만 firmware 제한 때문에 현재는 `uint32_t`처럼 overflow될 수 있습니다. 이 인터페이스는 vangogh에서만 지원됩니다.

`amdgpu_gfxoff_residency`에 `1`을 쓰면 logging을 시작하고 `0`을 쓰면 중지합니다. 읽으면 마지막 logging interval 동안의 평균 GFXOFF residency percentage에 100을 곱한 값을 얻습니다.

예를 들어 `7854`는 마지막 logging interval 시간의 `78.54%` 동안 GPU가 GFXOFF mode에 있었다는 뜻입니다. 이 인터페이스 역시 vangogh에서만 지원됩니다.

GFXOFF count와 residency 비교
인터페이스읽기 결과쓰기제약
amdgpu_gfxoff_countpower-up 이후 총 entry count명시 없음uint64_t이나 현재 uint32_t처럼 overflow 가능, vangogh 전용
amdgpu_gfxoff_residency마지막 interval 평균 residency % × 1001 시작, 0 중지vangogh 전용

형식, 제어 값, 단위, 지원 범위를 따로 확인합니다.

Residency 측정
amdgpu_gfxoff_residency에 1을 써서 logging 시작측정할 logging interval 진행0을 써서 logging 중지값을 읽어 100으로 나눔7854를 78.54%로 해석

logging 제어와 읽기 값 변환 순서입니다.


``amdgpu_gfxoff_count``
-----------------------

Read it to get the total GFXOFF entry count at the time of query since system
power-up. The value is an `uint64_t` type, however, due to firmware limitations,
it can currently overflow as an `uint32_t`. *Only supported in vangogh*

``amdgpu_gfxoff_residency``
---------------------------

Write 1 to amdgpu_gfxoff_residency to start logging, and 0 to stop. Read it to
get average GFXOFF residency % multiplied by 100 during the last logging
interval. E.g. a value of 7854 means 78.54% of the time in the last logging
interval the GPU was in GFXOFF mode. *Only supported in vangogh*