sibradzic / amdgpu-clocks

Simple script to control power states of amdgpu driven GPUs
GNU General Public License v2.0
390 stars 43 forks source link

FORCE_POWER_PROFILE not taking effect #51

Closed SwooshyCueb closed 1 year ago

SwooshyCueb commented 1 year ago

I've set FORCE_POWER_PROFILE to 1 in my state file, but after running amdgpu-clocks, pp_power_profile_mode still reports that 0 is the active profile. Running with bash -x, I can see that 1 does actually get written to pp_power_profile_mode. Moving the FORCE_PROFILE block to the end of set_custom_states() fixes it for me, so I suspect that something happening after pp_power_profile_mode is written to is resetting it.

Not sure if it matters, but the card I'm using is a PowerColor 5700xt Red Dragon

sibradzic commented 1 year ago

Hi @SwooshyCueb & thanks for reporting!

Hmm, your issue may be likely to the driver quirk or something. Which kernel are you using? Mainline driver or pro?

Also, compare result of moving FORCE_PROFILE block right before and right after https://github.com/sibradzic/amdgpu-clocks/blob/9d1196ef9839233a6f1b8c343e4769d5229c5015/amdgpu-clocks#L172 The "commit" of updated power state to the driver is known to cause some curious side effects :shrug:

sibradzic commented 1 year ago

@SwooshyCueb ping?

SwooshyCueb commented 1 year ago

Apologies, things have been rather busy around here.

I'm using Linux 6.1.7 with some patches, but I don't think any of the patches I use would affect this. I use the regular drivers, not pro.

And yeah it looks like the "commit" does reset the power profile reported in sysfs. Moving the FORCE_PROFILE block just before echo 'c' > ${SYS_PP_OD_CLK} results in it being reset back to default, but it works fine if the block is just after echo 'c' > ${SYS_PP_OD_CLK}.

sibradzic commented 1 year ago

OK, I will re-suffle the code a bit and do some tests, expect an updated version soon...

sibradzic commented 1 year ago

@SwooshyCueb does the latest fix address the issue for you?

SwooshyCueb commented 1 year ago

Looks like it does! Thank you!