Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting custom profile through rocm-smi #57

Closed
sabbaghm opened this issue Feb 26, 2019 · 2 comments
Closed

Setting custom profile through rocm-smi #57

sabbaghm opened this issue Feb 26, 2019 · 2 comments

Comments

@sabbaghm
Copy link

How exactly we can define and set a custom power profile for an RX 580 (polaris) GPU through rocm-smi ?

When I try:
rocm-smi --setprofile 6

I receive the following error:
======================== ROCm System Management Interface ======================== Unable to write to sysfs file /sys/class/drm/card0/device/pp_power_profile_mode GPU[0] : Unable to set CUSTOM Power Profile values WARNING: One or more commands failed ======================== End of ROCm SMI Log ========================

rocm-smi --showprofile prints:

========================        ROCm System Management Interface        ========================
================================================================================================
GPU[0] 		: 
GPU[0] 		: NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL     MCLK_UP_HYST   MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL
GPU[0] 		:   0   BOOTUP_DEFAULT:        -                -                -                -                -                -
GPU[0] 		:   1 3D_FULL_SCREEN :        0              100               30                0              100               10
GPU[0] 		:   2     POWER_SAVING:       10                0               30                -                -                -
GPU[0] 		:   3            VIDEO:        -                -                -               10               16               31
GPU[0] 		:   4               VR:        0               11               50                0              100               10
GPU[0] 		:   5          COMPUTE:        0                5               30                -                -                -
GPU[0] 		:   6           CUSTOM:        -                -                -                -                -                -
================================================================================================
=======================               End of ROCm SMI Log              ========================

And I can any other power profiles successfully, for example:
rocm-smi --setprofile 5

========================        ROCm System Management Interface        ========================
================================================================================================
GPU[0] 		: 
GPU[0] 		: NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL     MCLK_UP_HYST   MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL
GPU[0] 		:   0   BOOTUP_DEFAULT:        -                -                -                -                -                -
GPU[0] 		:   1   3D_FULL_SCREEN:        0              100               30                0              100               10
GPU[0] 		:   2     POWER_SAVING:       10                0               30                -                -                -
GPU[0] 		:   3            VIDEO:        -                -                -               10               16               31
GPU[0] 		:   4               VR:        0               11               50                0              100               10
GPU[0] 		:   5        COMPUTE *:        0                5               30                0              100               10
GPU[0] 		:   6           CUSTOM:        -                -                -                -                -                -
================================================================================================
========================               End of ROCm SMI Log              ========================

I have the latest version of ROCm from AMD repos on Ubuntu 16.04. Thank you!

@jlgreathouse
Copy link
Contributor

I believe to set a custom profile, you need to actually fully define the profile in your command.

SMU7 (which is used on Polaris 10 GPUs like what you have) requires 8 values to be passed in to define those profiles. This is defined in smu7_set_power_profile_mode in the smu7_hwmgr.c file in your driver.

The fields are, in order:

  1. Do you want to have a custom SCLK (graphics clock) profile? 1 if yes, 0 if no.
  2. SCLK_UP_HYST
  3. SCLK_DOWN_HYST
  4. SCLK_ACTIVE_LEVEL
  5. Do you want to have a custom MCLK (memory clock) profile? 1 if yes, 0 if no.
  6. MCLK_UP_HYST
  7. MCLK_DOWN_HYST
  8. MCLK_ACTIVE_LEVEL

These values are all in a quoted string argument to --setprofile. For example, this is an example of setting the custom profile to be identical to the 3D_FULL_SCREEN profile on my Fiji (also SMU7) GPU:

$ rocm-smi -d 1 --showprofile


========================        ROCm System Management Interface        ========================
================================================================================================
GPU[1]          :
GPU[1]          : NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL     MCLK_UP_HYST   MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL
GPU[1]          :   0   BOOTUP_DEFAULT:        -                -                -                -                -                -
GPU[1]          :   1 3D_FULL_SCREEN *:        0              100               30                0              100               10
GPU[1]          :   2     POWER_SAVING:       10                0               30                -                -                -
GPU[1]          :   3            VIDEO:        -                -                -               10               16               31
GPU[1]          :   4               VR:        0               11               50                0              100               10
GPU[1]          :   5          COMPUTE:        0                5               30                -                -                -
GPU[1]          :   6           CUSTOM:        -                -                -                -                -                -
================================================================================================
========================               End of ROCm SMI Log              ========================


$ rocm-smi -d 1 --setprofile "1 0 100 30 1 0 100 10"


========================        ROCm System Management Interface        ========================
GPU[1]          : Successfully set CUSTOM Power Profile values
========================               End of ROCm SMI Log              ========================


$ rocm-smi -d 1 --showprofile


========================        ROCm System Management Interface        ========================
================================================================================================
GPU[1]          :
GPU[1]          : NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL     MCLK_UP_HYST   MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL
GPU[1]          :   0   BOOTUP_DEFAULT:        -                -                -                -                -                -
GPU[1]          :   1   3D_FULL_SCREEN:        0              100               30                0              100               10
GPU[1]          :   2     POWER_SAVING:       10                0               30                -                -                -
GPU[1]          :   3            VIDEO:        -                -                -               10               16               31
GPU[1]          :   4               VR:        0               11               50                0              100               10
GPU[1]          :   5          COMPUTE:        0                5               30                -                -                -
GPU[1]          :   6         CUSTOM *:        0              100               30                0              100               10
================================================================================================
========================               End of ROCm SMI Log              ========================

@sabbaghm
Copy link
Author

@jlgreathouse Thank you! I could successfully set the custom profile using the suggested command template:
rocm-smi --setprofile "CustomSCLKFlag SCLK_UP_HYST SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL CustomMCLKFlag MCLK_UP_HYST MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants