]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: fix gpu idle power consumption issue for gfx v12
authorYang Wang <kevinyang.wang@amd.com>
Wed, 4 Mar 2026 23:45:45 +0000 (18:45 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 6 Mar 2026 22:11:46 +0000 (17:11 -0500)
Older versions of the MES firmware may cause abnormal GPU power consumption.
When performing inference tasks on the GPU (e.g., with Ollama using ROCm),
the GPU may show abnormal power consumption in idle state and incorrect GPU load information.
This issue has been fixed in firmware version 0x8b and newer.

Closes: https://github.com/ROCm/ROCm/issues/5706
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4e22a5fe6ea6e0b057e7f246df4ac3ff8bfbc46a)

drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

index 5bfa5d1d0b36986b455e35f638e0b54a3caceb3d..023c7345ea548536744138eabebe649cba632356 100644 (file)
@@ -731,6 +731,9 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)
        int i;
        struct amdgpu_device *adev = mes->adev;
        union MESAPI_SET_HW_RESOURCES mes_set_hw_res_pkt;
+       uint32_t mes_rev = (pipe == AMDGPU_MES_SCHED_PIPE) ?
+               (mes->sched_version & AMDGPU_MES_VERSION_MASK) :
+               (mes->kiq_version & AMDGPU_MES_VERSION_MASK);
 
        memset(&mes_set_hw_res_pkt, 0, sizeof(mes_set_hw_res_pkt));
 
@@ -785,7 +788,7 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)
         * handling support, other queue will not use the oversubscribe timer.
         * handling  mode - 0: disabled; 1: basic version; 2: basic+ version
         */
-       mes_set_hw_res_pkt.oversubscription_timer = 50;
+       mes_set_hw_res_pkt.oversubscription_timer = mes_rev < 0x8b ? 0 : 50;
        mes_set_hw_res_pkt.unmapped_doorbell_handling = 1;
 
        if (amdgpu_mes_log_enable) {