drm/amd/powerplay: dynamically disable ds and ulv for compute
Subsystems (2)
PATCH v2 1/1 drm/amd/powerplay: dynamically disable ds and ulv for compute
This is to improve the performance in the compute mode for vega10. For example, the original performance for a rocm bandwidth test: 2G internal GPU copy, is about 99GB/s. With the idle power features disabled dynamically, the porformance is promoted to about 215GB/s.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 +++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 55 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 + 3 files changed, 64 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +7 -0
@@ -969,6 +969,13 @@ static int pp_dpm_switch_power_profile(void *handle, workload = hwmgr->workload_setting[index]; } +if (type ==PP_SMC_POWER_PROFILE_COMPUTE && + hwmgr->hwmgr_func->disable_power_features_for_compute_performance) +if (hwmgr->hwmgr_func->disable_power_features_for_compute_performance (hwmgr, en)) { +mutex_unlock (&hwmgr->smu_lock); +return -EINVAL ; + } +if (hwmgr->dpm_level !=AMD_DPM_FORCED_LEVEL_MANUAL ) hwmgr->hwmgr_func->set_power_profile_mode (hwmgr, &workload,0 );mutex_unlock (&hwmgr->smu_lock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +55 -0
67 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
@@ -357,6 +357,8 @@ struct pp_hwmgr_func {int (*smu_i2c_bus_access)(struct pp_hwmgr *hwmgr,bool aquire);int (*set_df_cstate)(struct pp_hwmgr *hwmgr,enum pp_df_cstate state);int (*set_xgmi_pstate)(struct pp_hwmgr *hwmgr,uint32_t pstate); +int (*disable_power_features_for_compute_performance)(struct pp_hwmgr *hwmgr, +bool disable); };struct pp_table_func {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1573191771-8071-1-git-send-email-kenneth.feng-5C7GfCeVMHo@public.gmane.org
Zhang, Hawking
Reviewed-by Hawking ZhangRegards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kenneth Feng
Sent: 2019年11月8日 13:43
To: [email protected]
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH v2] drm/amd/powerplay: dynamically disable ds and ulv for compute
This is to improve the performance in the compute mode for vega10. For example, the original performance for a rocm bandwidth test: 2G internal GPU copy, is about 99GB/s. With the idle power features disabled dynamically, the porformance is promoted to about 215GB/s.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 +++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 55 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 + 3 files changed, 64 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +7 -0
@@ -969,6 +969,13 @@ static int pp_dpm_switch_power_profile(void *handle, workload = hwmgr->workload_setting[index]; } +if (type ==PP_SMC_POWER_PROFILE_COMPUTE && + hwmgr->hwmgr_func->disable_power_features_for_compute_performance) +if (hwmgr->hwmgr_func->disable_power_features_for_compute_performance (hwmgr, en)) { +mutex_unlock (&hwmgr->smu_lock); +return -EINVAL ; + } +if (hwmgr->dpm_level !=AMD_DPM_FORCED_LEVEL_MANUAL ) hwmgr->hwmgr_func->set_power_profile_mode (hwmgr, &workload,0 );mutex_unlock (&hwmgr->smu_lock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +53 -0
59 lines not on this page · raw message
.get_ppfeature_status = vega10_get_ppfeature_status, .set_ppfeature_status = vega10_set_ppfeature_status, .set_mp1_state = vega10_set_mp1_state,
+ .disable_power_features_for_compute_performance =
+ vega10_disable_power_features_for_compute_performance,
};
int vega10_hwmgr_init(struct pp_hwmgr *hwmgr) diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 40403bc..af97767 100644
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
@@ -357,6 +357,8 @@ struct pp_hwmgr_func {int (*smu_i2c_bus_access)(struct pp_hwmgr *hwmgr,bool aquire);int (*set_df_cstate)(struct pp_hwmgr *hwmgr,enum pp_df_cstate state);int (*set_xgmi_pstate)(struct pp_hwmgr *hwmgr,uint32_t pstate); +int (*disable_power_features_for_compute_performance)(struct pp_hwmgr *hwmgr, +bool disable); };struct pp_table_func {
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 32 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kenneth Feng
Sent: Friday, November 8, 2019 1:43 PM
To: [email protected]
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH v2] drm/amd/powerplay: dynamically disable ds and ulv for computeThis is to improve the performance in the compute mode for vega10. For example, the original performance for a rocm bandwidth test: 2G internal GPU copy, is about 99GB/s. With the idle power features disabled dynamically, the porformance is promoted to about 215GB/s.
Signed-off-by Kenneth Feng <[email protected]>--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 +++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 55 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 + 3 files changed, 64 insertions(+)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0
-0@@ -969,6 +969,13 @@ static int pp_dpm_switch_power_profile(void *handle, workload = hwmgr->workload_setting[index];
drivers/gpu/drm/amd/powerplay/amd_powerplay.c static int pp_dpm_switch_power_profile(void *handle, · line 979
Quoted 10 lines
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +6
-0} +if (type ==PP_SMC_POWER_PROFILE_COMPUTE && + hwmgr->hwmgr_func- >disable_power_features_for_compute_performance) +if (hwmgr->hwmgr_func- >disable_power_features_for_compute_performance(hwmgr, en)) { +mutex_unlock (&hwmgr->smu_lock); +return -EINVAL ; + }
[Quan, Evan] Coding style here seems a little weird. Other than this, the patch is reviewed-by: Evan Quan <[email protected]>
Quoted 118 lines
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1
-0+if (hwmgr->dpm_level !=AMD_DPM_FORCED_LEVEL_MANUAL )hwmgr->hwmgr_func->set_power_profile_mode(hwmgr,
&workload, 0);drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0
-0mutex_unlock (&hwmgr->smu_lock);drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +0
-0@@ -5263,6 +5263,59 @@ static int vega10_get_performance_level(struct
pp_hwmgr*hwmgr, const structpp_drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0return 0 ; } +static int vega10_disable_power_features_for_compute_performance(struct
pp_hwmgr*hwmgr, bool disable)drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +7
-0+{ +struct vega10_hwmgr *data = hwmgr->backend; +uint32_t feature_mask =0 ; + +if (disable) { + feature_mask |= data->smu_features[GNLD_ULV ].enabled ? + data->smu_features[GNLD_ULV].smu_feature_bitmap :0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= data-Quoted 1 line
smu_features[GNLD_DS_GFXCLK].enabled ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_GFXCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= data-Quoted 1 line
smu_features[GNLD_DS_SOCCLK].enabled ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_SOCCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= data-Quoted 1 line
smu_features[GNLD_DS_LCLK].enabled ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_LCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= data-Quoted 1 line
smu_features[GNLD_DS_DCEFCLK].enabled ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_DCEFCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +3
-0+ }else { + feature_mask |= (!data->smu_features[GNLD_ULV ].enabled) ? + data->smu_features[GNLD_ULV].smu_feature_bitmap :0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= (!data-Quoted 1 line
smu_features[GNLD_DS_GFXCLK].enabled) ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_GFXCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= (!data-Quoted 1 line
smu_features[GNLD_DS_SOCCLK].enabled) ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_SOCCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= (!data-Quoted 1 line
smu_features[GNLD_DS_LCLK].enabled) ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_LCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ feature_mask |= (!data-Quoted 1 line
smu_features[GNLD_DS_DCEFCLK].enabled) ?
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +1
-0+ data-Quoted 1 line
smu_features[GNLD_DS_DCEFCLK].smu_feature_bitmap : 0;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +4
-0+ } + +if (feature_mask) +PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr,
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +2
-0+ !disable, feature_mask), + "enable/disable power features for computeperformance Failed!",
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +22
-0+ return -EINVAL); + +if (disable) { + data->smu_features[GNLD_ULV ].enabled = false; + data->smu_features[GNLD_DS_GFXCLK ].enabled = false; + data->smu_features[GNLD_DS_SOCCLK ].enabled = false; + data->smu_features[GNLD_DS_LCLK ].enabled = false; + data->smu_features[GNLD_DS_DCEFCLK ].enabled = false; + }else { + data->smu_features[GNLD_ULV ].enabled = true; + data->smu_features[GNLD_DS_GFXCLK ].enabled = true; + data->smu_features[GNLD_DS_SOCCLK ].enabled = true; + data->smu_features[GNLD_DS_LCLK ].enabled = true; + data->smu_features[GNLD_DS_DCEFCLK ].enabled = true; + } + +return 0 ; + +} +static const struct pp_hwmgr_func vega10_hwmgr_funcs = { .backend_init = vega10_hwmgr_backend_init, .backend_fini = vega10_hwmgr_backend_fini,@@ -5330,6 +5383,8 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = { .get_ppfeature_status = vega10_get_ppfeature_status, .set_ppfeature_status = vega10_set_ppfeature_status, .set_mp1_state = vega10_set_mp1_state, + .disable_power_features_for_compute_performance = + vega10_disable_power_features_for_compute_performance, };int
vega10_hwmgr_init(struct pp_hwmgr *hwmgr)drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2
-0@@ -357,6 +357,8 @@ struct pp_hwmgr_func {int (*smu_i2c_bus_access)(struct pp_hwmgr *hwmgr,bool aquire);int (*set_df_cstate)(struct pp_hwmgr *hwmgr,enum pp_df_cstate state);int (*set_xgmi_pstate)(struct pp_hwmgr *hwmgr,uint32_t pstate); +int (*disable_power_features_for_compute_performance)(struct pp_hwmgr *hwmgr, +bool disable); };
Quoted 8 lines
struct
pp_table_func{
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Do we need something similar for vega20?
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kenneth Feng <[email protected]>
Sent: Friday, November 8, 2019 12:42 AM
To: [email protected] <[email protected]>
Cc: Feng, Kenneth <[email protected]>
Subject: [PATCH v2] drm/amd/powerplay: dynamically disable ds and ulv for compute
This is to improve the performance in the compute mode for vega10. For example, the original performance for a rocm bandwidth test: 2G internal GPU copy, is about 99GB/s. With the idle power features disabled dynamically, the porformance is promoted to about 215GB/s.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 +++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 55 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 + 3 files changed, 64 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +7 -0
@@ -969,6 +969,13 @@ static int pp_dpm_switch_power_profile(void *handle, workload = hwmgr->workload_setting[index]; } +if (type ==PP_SMC_POWER_PROFILE_COMPUTE && + hwmgr->hwmgr_func->disable_power_features_for_compute_performance) +if (hwmgr->hwmgr_func->disable_power_features_for_compute_performance (hwmgr, en)) { +mutex_unlock (&hwmgr->smu_lock); +return -EINVAL ; + } +if (hwmgr->dpm_level !=AMD_DPM_FORCED_LEVEL_MANUAL ) hwmgr->hwmgr_func->set_power_profile_mode (hwmgr, &workload,0 );mutex_unlock (&hwmgr->smu_lock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +55 -0
67 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
@@ -357,6 +357,8 @@ struct pp_hwmgr_func {int (*smu_i2c_bus_access)(struct pp_hwmgr *hwmgr,bool aquire);int (*set_df_cstate)(struct pp_hwmgr *hwmgr,enum pp_df_cstate state);int (*set_xgmi_pstate)(struct pp_hwmgr *hwmgr,uint32_t pstate); +int (*disable_power_features_for_compute_performance)(struct pp_hwmgr *hwmgr, +bool disable); };struct pp_table_func {
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): DM5PR12MB18204B23450D8B0E427E4C8AF77B0-2J9CzHegvk8qWyLXlBb1HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Hi Alex,
We have confirmed that the performance on Vega20 in the compute mode is expected and doesn't need the similar change. This is because that by default on Vega20 all the deep sleep features are disabled, and ulv feature doesn't involve reducing mclk in Vega20 while it does in Vega10.
We then need this change on MI100/MI200 since these deep sleep features are enabled by default.
Thanks.
From: Deucher, Alexander <[email protected]>
Sent: Friday, November 8, 2019 10:45 PM
To: Feng, Kenneth <[email protected]>; [email protected]
Subject: Re: [PATCH v2] drm/amd/powerplay: dynamically disable ds and ulv for compute
Do we need something similar for vega20?
Alex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:[email protected]>> on behalf of Kenneth Feng <[email protected]<mailto:[email protected]>>
Sent: Friday, November 8, 2019 12:42 AM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Feng, Kenneth <[email protected]<mailto:[email protected]>>
Subject: [PATCH v2] drm/amd/powerplay: dynamically disable ds and ulv for compute
This is to improve the performance in the compute mode for vega10. For example, the original performance for a rocm bandwidth test: 2G internal GPU copy, is about 99GB/s. With the idle power features disabled dynamically, the porformance is promoted to about 215GB/s.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 +++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 55 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 + 3 files changed, 64 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +7 -0
@@ -969,6 +969,13 @@ static int pp_dpm_switch_power_profile(void *handle, workload = hwmgr->workload_setting[index]; } +if (type ==PP_SMC_POWER_PROFILE_COMPUTE && + hwmgr->hwmgr_func->disable_power_features_for_compute_performance) +if (hwmgr->hwmgr_func->disable_power_features_for_compute_performance (hwmgr, en)) { +mutex_unlock (&hwmgr->smu_lock); +return -EINVAL ; + } +if (hwmgr->dpm_level !=AMD_DPM_FORCED_LEVEL_MANUAL ) hwmgr->hwmgr_func->set_power_profile_mode (hwmgr, &workload,0 );mutex_unlock (&hwmgr->smu_lock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +55 -0
67 lines not on this page · raw message
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +2 -0
@@ -357,6 +357,8 @@ struct pp_hwmgr_func {int (*smu_i2c_bus_access)(struct pp_hwmgr *hwmgr,bool aquire);int (*set_df_cstate)(struct pp_hwmgr *hwmgr,enum pp_df_cstate state);int (*set_xgmi_pstate)(struct pp_hwmgr *hwmgr,uint32_t pstate); +int (*disable_power_features_for_compute_performance)(struct pp_hwmgr *hwmgr, +bool disable); };struct pp_table_func {
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx