요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===========================================
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
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_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
======
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.
``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*
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
HWMON과 GPU 전력 상태·clock 인터페이스
1-45GPU 전력·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` 여섯 항목을 함께 참조합니다.
각 sysfs 문서 절과 amdgpu_pm.c의 :doc: 선택자를 대응합니다.
속성 이름에서 실제 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`의 해당 문서 블록이 정의합니다.
한 절에 여러 kernel-doc가 있는 busy percent를 포함하여 전체 key를 보존합니다.
관찰 목적에 맞는 문서 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-113Fan 관련 후반부는 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`는 정지 온도 계약이므로 하나의 값으로 합쳐 해석하지 않습니다.
원문 제목과 :doc: key가 일대일로 대응합니다.
비슷한 이름을 목적별로 분리해 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-155GFXOFF는 최근 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
Enable 허용 상태와 구분되는 실제 GFXOFF runtime 상태입니다.
활성화는 진입 허용이고 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에서만 지원됩니다.
형식, 제어 값, 단위, 지원 범위를 따로 확인합니다.
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*
요약·해설
thermal.rst:1-170이 문서는 AMDGPU의 HWMON, DPM·power profile·busy metrics·fan 제어에 관한 18개 `amdgpu_pm.c` kernel-doc 계약과 GFXOFF debugfs 인터페이스를 연결합니다. GFXOFF에서는 진입 허용 값, 현재 상태, 누적 진입 횟수, 마지막 interval의 residency를 서로 다른 파일에서 읽습니다.
문서 전반을 kernel-doc sysfs와 GFXOFF debugfs로 나눠 봅니다.