Skip to contentSkip to conversation

drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active

PATCH In review Alex Deucher 4 participants 6 messages Oct 3, 2023 – Oct 4, 2023

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -0
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
 	amdgpu_dpm_switch_power_profile(adev,
 					PP_SMC_POWER_PROFILE_COMPUTE,
 					!idle);
+	/* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+	if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+	    ((adev->pm.fw_version == 0x004e6601) ||
+	     (adev->pm.fw_version >= 0x004e7300))) {
+		amdgpu_dpm_switch_power_profile(adev,
+						PP_SMC_POWER_PROFILE_POWERSAVING,
+						!idle);
+	}
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
Signature · 1 line
2.41.0
#1 lore raw

Ping?

Quoted 31 lines · Alex Deucher

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -1
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
        amdgpu_dpm_switch_power_profile(adev,
                                        PP_SMC_POWER_PROFILE_COMPUTE,
                                        !idle);
+       /* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+       if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+           ((adev->pm.fw_version == 0x004e6601) ||
+            (adev->pm.fw_version >= 0x004e7300))) {
+               amdgpu_dpm_switch_power_profile(adev,
+                                               PP_SMC_POWER_PROFILE_POWERSAVING,
+                                               !idle);
+       }
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
--

2.41.0

Reviewed-by
#2 lore raw

Hi Alex,

why need to switch profile twice for smu 13.0.0 ? in idle state : set compute profile then set power save profile? Afaik, Pmfw always uses the last set result to represent the current profile.
But it shouldn't affect the results. Anyway.

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, October 4, 2023 10:04 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active

Ping?

Quoted 31 lines · Alex Deucher

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -1
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
        amdgpu_dpm_switch_power_profile(adev,
                                        PP_SMC_POWER_PROFILE_COMPUTE,
                                        !idle);
+       /* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+       if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+           ((adev->pm.fw_version == 0x004e6601) ||
+            (adev->pm.fw_version >= 0x004e7300))) {
+               amdgpu_dpm_switch_power_profile(adev,
+                                               PP_SMC_POWER_PROFILE_POWERSAVING,
+                                               !idle);
+       }
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
--

2.41.0

#3 lore raw
Quoted 6 lines · Yang(Kevin)

Hi Alex,

why need to switch profile twice for smu 13.0.0 ? in idle state : set compute profile then set power save profile? Afaik, Pmfw always uses the last set result to represent the current profile.
But it shouldn't affect the results. Anyway.

We want to be setting both workload bits (powersave and compute). I guess this won't work as is? I thought the code or'ed both bits.

Alex

Quoted 47 lines

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, October 4, 2023 10:04 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active

Ping?

Quoted 31 lines · Alex Deucher

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -1
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
        amdgpu_dpm_switch_power_profile(adev,
                                        PP_SMC_POWER_PROFILE_COMPUTE,
                                        !idle);
+       /* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+       if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+           ((adev->pm.fw_version == 0x004e6601) ||
+            (adev->pm.fw_version >= 0x004e7300))) {
+               amdgpu_dpm_switch_power_profile(adev,
+                                               PP_SMC_POWER_PROFILE_POWERSAVING,
+                                               !idle);
+       }
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
--

2.41.0

#4 lore raw
Quoted 4 lines · Alex Deucher
Quoted 1 line · Yang(Kevin)
Quoted 8 lines
Quoted 5 lines

Hi Alex,

why need to switch profile twice for smu 13.0.0 ? in idle state : set compute profile then set power save profile? Afaik, Pmfw always uses the last set result to represent the current profile.
But it shouldn't affect the results. Anyway.

We want to be setting both workload bits (powersave and compute). I guess this won't work as is? I thought the code or'ed both bits.

Confirming this won't work as expected. Will rework and resend.

Alex

Quoted 51 lines

Alex

Quoted 47 lines

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, October 4, 2023 10:04 PM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active

Ping?

Quoted 31 lines · Alex Deucher

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -1
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
        amdgpu_dpm_switch_power_profile(adev,
                                        PP_SMC_POWER_PROFILE_COMPUTE,
                                        !idle);
+       /* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+       if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+           ((adev->pm.fw_version == 0x004e6601) ||
+            (adev->pm.fw_version >= 0x004e7300))) {
+               amdgpu_dpm_switch_power_profile(adev,
+                                               PP_SMC_POWER_PROFILE_POWERSAVING,
+                                               !idle);
+       }
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
--

2.41.0

Acked-by on v1 1/1
#5 lore raw
In reply to Alex Deucher

Am 03.10.23 um 21:07 schrieb Alex Deucher:

Quoted 4 lines

When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW.

Quoted 23 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -0
index 38b5457baded..b6c0c42de725 100644
@@ -714,6 +714,14 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
  	amdgpu_dpm_switch_power_profile(adev,
  					PP_SMC_POWER_PROFILE_COMPUTE,
  					!idle);
+	/* Add optimizations for SMU13.0.0.  Reuse the power saving profile */
+	if ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0)) &&
+	    ((adev->pm.fw_version == 0x004e6601) ||
+	     (adev->pm.fw_version >= 0x004e7300))) {
+		amdgpu_dpm_switch_power_profile(adev,
+						PP_SMC_POWER_PROFILE_POWERSAVING,
+						!idle);
+	}
  }
 
  bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)