#321 AMD GPU not operating to its fullest

Closed
opened 1 year ago by Sorual · 14 comments
Sorual commented 1 year ago

Hello!

I recently upgraded from an Nvidia GTX 1070 to an AMD Radeon RX 6700xt. By all accounts, for Anime Game, this should be a better card.

However, when I play the game at max settings like I did on my old card, the framerate is noticeably choppy. I booted up Mangohud to see what was up, and the game THINKS it's running at a constant 60fps with consistent frame-times. And as such, the GPU isn't boosting like it normally would in a game. (It operates at like half the max frequency)

Considering that this happened when I changed cards and changed drivers, it could be a driver issue. However, this is the only game where this happens. All other games I've played perform markedly better at higher settings, and output CORRECT framerate / frame times.

In the case of Anime Game only, it seems like the GPU thinks that it's outputting enough power for 60fps, so it does not boost any further. When in reality, the game runs at a much lower frame rate because the GPU doesn't know it needs to work harder.

Also, this might be related to issue #298. I plan to test more with other unity games as well, and if I could receive suggestion for which ones to try, that'd be great :)

Hello! I recently upgraded from an Nvidia GTX 1070 to an AMD Radeon RX 6700xt. By all accounts, for Anime Game, this should be a better card. However, when I play the game at max settings like I did on my old card, the framerate is noticeably choppy. I booted up Mangohud to see what was up, and the game THINKS it's running at a constant 60fps with consistent frame-times. And as such, the GPU isn't boosting like it normally would in a game. (It operates at like half the max frequency) Considering that this happened when I changed cards and changed drivers, it could be a driver issue. However, this is the only game where this happens. All other games I've played perform markedly better at higher settings, and output CORRECT framerate / frame times. In the case of Anime Game only, it seems like the GPU thinks that it's outputting enough power for 60fps, so it does not boost any further. When in reality, the game runs at a much lower frame rate because the GPU doesn't know it needs to work harder. Also, this might be related to issue #298. I plan to test more with other unity games as well, and if I could receive suggestion for which ones to try, that'd be great :)
Sorual commented 1 year ago
Poster

After some investigation, I found that the issue is largely caused by two things:

  1. The compositor. It seems to screw up how Anime Game runs.

And also 2. The absence of vsync. It seems that a big part of the stutter I felt was actually screen tearing. Not all of it, but a good bit.

With these two tweaks, the game seems to be running better. So to all who have had issue with AMDGPU and Anime Game, try these two options. And importantly, do so as the same time!

It's still not perfect, but it has been remedied at least a little bit.

After some investigation, I found that the issue is largely caused by two things: 1. The compositor. It seems to screw up how Anime Game runs. And also 2. The absence of vsync. It seems that a big part of the stutter I felt was actually screen tearing. Not all of it, but a good bit. With these two tweaks, the game seems to be running better. So to all who have had issue with AMDGPU and Anime Game, try these two options. And importantly, do so as the same time! It's still not perfect, but it has been remedied at least a little bit.
Krock commented 1 year ago
Owner

Which tweaks in particular resulted in improved performance in your case? How did you apply them? I would like to document this in TWEAKS.md for future cases.

Which tweaks in particular resulted in improved performance in your case? How did you apply them? I would like to document this in TWEAKS.md for future cases.
Sorual commented 1 year ago
Poster

@Krock the specific tweaks I used to improve performance were: 1: lower shadow quality. I set them to "low" (not "lowest"). 2: disable volumetric fog (which goes hand in hand with 1, since you need high shadow quality for it). 3: lower render resolution. I used 1.0 instead of my usual 1.5. 4: turn vsync on. As there seems to be a screen tearing issue.

@Krock the specific tweaks I used to improve performance were: 1: lower shadow quality. I set them to "low" (not "lowest"). 2: disable volumetric fog (which goes hand in hand with 1, since you need high shadow quality for it). 3: lower render resolution. I used 1.0 instead of my usual 1.5. 4: turn vsync on. As there seems to be a screen tearing issue.
Sorual commented 1 year ago
Poster

It should be re-iterated that this seems to be an issue regardless of how it can be remedied. I got a gaming GPU that was 5 years newer than my last. I'd never run Anime Game at anything but max before, but only after the upgrade did I have to upgrade. This could simply be on the part of the mesa drivers not playing with Anime Game very well, but the performance hit is there.

It should be re-iterated that this seems to be an issue regardless of how it can be remedied. I got a gaming GPU that was 5 years newer than my last. I'd never run Anime Game at anything but max before, but only after the upgrade did I have to upgrade. This could simply be on the part of the mesa drivers not playing with Anime Game very well, but the performance hit is there.
Krock commented 1 year ago
Owner

@Sorual To make sure this is not a setup issue, please check the following:

  1. lspci -v | grep "VGA" -A 15 must mention "Kernel driver in use: amdgpu"
  2. vulkaninfo | grep DRIVER_ID -A 3 must mention "DRIVER_ID_MESA_RADV" (i.e. Mesa3D RADV driver)
  3. Unused nvidia drivers and packages are uninstalled
  4. For Arch-based systems: amdvlk must not be installed.

If you are not sure, feel free to post the output here.

Unfortunately multiple installed drivers can cause unexpected behaviour in some cases, hence I would like to confirm this before including these workarounds to the documentation.

@Sorual To make sure this is not a setup issue, please check the following: 1. `lspci -v | grep "VGA" -A 15` must mention "Kernel driver in use: amdgpu" 2. `vulkaninfo | grep DRIVER_ID -A 3` must mention "DRIVER_ID_MESA_RADV" (i.e. Mesa3D RADV driver) 3. Unused nvidia drivers and packages are uninstalled 4. For Arch-based systems: amdvlk must not be installed. If you are not sure, feel free to post the output here. Unfortunately multiple installed drivers can cause unexpected behaviour in some cases, hence I would like to confirm this before including these workarounds to the documentation.
Sorual commented 1 year ago
Poster

Regrettably, I no longer have the GPU. It had excessive coil whine issues, and I have returned it. I'm back on my GTX 1070 currently.

That said, I plan to get a different AMD GPU once the return is processed. And once that happens, I'll update this thread with the output of those commands.

For what it's worth, I recall for a fact that the GPU was indeed using the amdgpu kernel driver, as I made sure of that when I installed it.

Additionally, I uninstalled all Nvidia-related packages (With the exception of libvdpau, but that should not affect performance in games) and I also made sure to use radeon-vulkan instead of amdvlk.

Regrettably, I no longer have the GPU. It had excessive coil whine issues, and I have returned it. I'm back on my GTX 1070 currently. That said, I plan to get a different AMD GPU once the return is processed. And once that happens, I'll update this thread with the output of those commands. For what it's worth, I recall for a fact that the GPU was indeed using the amdgpu kernel driver, as I made sure of that when I installed it. Additionally, I uninstalled all Nvidia-related packages (With the exception of libvdpau, but that should not affect performance in games) and I also made sure to use radeon-vulkan instead of amdvlk.
Sorual commented 1 year ago
Poster

@Krock I have received a new (Slightly better) GPU. The rx 6750xt. I have confirmed that the output of the commands you wrote are as you say.

lspci -v | grep "VGA" -A 15:

0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M] (rev c0) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 05e7
        Flags: bus master, fast devsel, latency 0, IRQ 109, IOMMU group 23
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at e0000000 (64-bit, prefetchable) [size=2M]
        I/O ports at e000 [size=256]
        Memory at fcc00000 (32-bit, non-prefetchable) [size=1M]
        Expansion ROM at fcd00000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu

0a:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller
        Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller
        Flags: bus master, fast devsel, latency 0, IRQ 106, IOMMU group 24
        Memory at fcd20000 (32-bit, non-prefetchable) [size=16K]

And vulkaninfo | grep DRIVER_ID -A 3:

        driverID        = DRIVER_ID_MESA_RADV
        driverName      = radv
        driverInfo      = Mesa 22.1.4
        conformanceVersion:
--
        driverID                                             = DRIVER_ID_MESA_RADV
        driverName                                           = radv
        driverInfo                                           = Mesa 22.1.4
        conformanceVersion:
@Krock I have received a new (Slightly better) GPU. The rx 6750xt. I have confirmed that the output of the commands you wrote are as you say. `lspci -v | grep "VGA" -A 15`: ``` 0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M] (rev c0) (prog-if 00 [VGA controller]) Subsystem: ASUSTeK Computer Inc. Device 05e7 Flags: bus master, fast devsel, latency 0, IRQ 109, IOMMU group 23 Memory at d0000000 (64-bit, prefetchable) [size=256M] Memory at e0000000 (64-bit, prefetchable) [size=2M] I/O ports at e000 [size=256] Memory at fcc00000 (32-bit, non-prefetchable) [size=1M] Expansion ROM at fcd00000 [disabled] [size=128K] Capabilities: <access denied> Kernel driver in use: amdgpu Kernel modules: amdgpu 0a:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller Flags: bus master, fast devsel, latency 0, IRQ 106, IOMMU group 24 Memory at fcd20000 (32-bit, non-prefetchable) [size=16K] ``` And `vulkaninfo | grep DRIVER_ID -A 3`: ``` driverID = DRIVER_ID_MESA_RADV driverName = radv driverInfo = Mesa 22.1.4 conformanceVersion: -- driverID = DRIVER_ID_MESA_RADV driverName = radv driverInfo = Mesa 22.1.4 conformanceVersion: ```
Sorual commented 1 year ago
Poster

I found a way around these issues. As stated previously, the game does not perform well at max settings even though it should. It seems the GPU driver gets confused and does not know to tell the GPU to clock up for higher settings. (Just a hypothesis. It simply doesn't run at the FPS it SAYS it's running at)

To try and fix this, I used a program called CoreCtrl to set the GPU clock speed minimum to around 2000Mhz. and that completely solved the issue! But! it gets weird. After I set the minimum back to 500Mhz, the game still ran better. I don't know why, but using CoreCtrl to simply set the GPU profile from "Automatic" to "Advanced", then not actually making ANY CHANGES from the preset completely resolves these performance issues.

I found a way around these issues. As stated previously, the game does not perform well at max settings even though it should. It seems the GPU driver gets confused and does not know to tell the GPU to clock up for higher settings. (Just a hypothesis. It simply doesn't run at the FPS it SAYS it's running at) To try and fix this, I used a program called CoreCtrl to set the GPU clock speed minimum to around 2000Mhz. and that completely solved the issue! But! it gets weird. After I set the minimum back to 500Mhz, the game still ran better. I don't know why, but using CoreCtrl to simply set the GPU profile from "Automatic" to "Advanced", then not actually making ANY CHANGES from the preset completely resolves these performance issues.
Ph42oN commented 1 year ago

This sounds like same issue i got after i upgraded from rx 480 to rx 6800. It was happening on all games if they aren't heavy on gpu. First improvement i found was to increase graphic settings, even render resolution to make it heavier. Then i found this open issue about it and some workarounds: https://gitlab.freedesktop.org/drm/amd/-/issues/1500

This sounds like same issue i got after i upgraded from rx 480 to rx 6800. It was happening on all games if they aren't heavy on gpu. First improvement i found was to increase graphic settings, even render resolution to make it heavier. Then i found this open issue about it and some workarounds: https://gitlab.freedesktop.org/drm/amd/-/issues/1500
Sorual commented 1 year ago
Poster

@Ph2oN Wow! The solutions discussed there totally worked! I guess I'm fortunate that this issue only exists for one game for me? xD

Anyway, FOR POSTERITY, this is the command to fix the issue:

echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level
echo 1 > /sys/class/drm/card0/device/pp_power_profile_mode
@Ph2oN Wow! The solutions discussed there totally worked! I guess I'm fortunate that this issue only exists for one game for me? xD Anyway, FOR POSTERITY, this is the command to fix the issue: ``` echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level echo 1 > /sys/class/drm/card0/device/pp_power_profile_mode ```

Forcing GPU power profile mode is not a good idea for me (to hot). @Sorual @Ph2oN @Krock

Here I can share my experience with facing half frame rate (60/2=30). No matter how I changed vulkan driver (mesa/amdvlk) and DXVK version, My RX470 seemed to get that problem occasionally.

After trying some DXVK configuration (use file dxvk.conf), I figured out the good option to solve the issue:

d3d11.cachedDynamicResources = c

Hope someone can help confirm this. Then the update to TWEAKS.md can be worthwhile.

Forcing GPU power profile mode is not a good idea for me (to hot). @Sorual @Ph2oN @Krock Here I can share my experience with facing half frame rate (60/2=30). No matter how I changed vulkan driver (mesa/amdvlk) and DXVK version, My RX470 seemed to get that problem occasionally. After trying some DXVK configuration (use file ```dxvk.conf```), I figured out the good option to solve the issue: ```d3d11.cachedDynamicResources = c``` Hope someone can help confirm this. Then the update to ```TWEAKS.md``` can be worthwhile.
Ph42oN commented 1 year ago

@MoneyMonkey I think your issue is not caused by the same reason. I tested to set power profile back to default and add your fix into my dxvk.conf, and it did not help at all. I believe issue i have is specific to RX 6000 series. When i was still using RX 480 i did not have any stutter.

This fix i use does not cause GPU to run hotter, maybe it would if using echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level to fix it instead.

@MoneyMonkey I think your issue is not caused by the same reason. I tested to set power profile back to default and add your fix into my dxvk.conf, and it did not help at all. I believe issue i have is specific to RX 6000 series. When i was still using RX 480 i did not have any stutter. This fix i use does not cause GPU to run hotter, maybe it would if using echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level to fix it instead.
Krock commented 1 year ago
Owner

Closing. This is/was an issue about imperfect GPU drivers which might already be solved in recent Linux kernels.

If there are any persistent workarounds needed for Genshin in particular on certain hardware, please let me know.

Closing. This is/was an issue about imperfect GPU drivers which might already be solved in recent Linux kernels. If there are any persistent workarounds needed for Genshin in particular on certain hardware, please let me know.
Ph42oN commented 1 year ago

Maybe there have been some improvement to this in drivers, there is no fps hit now. But adaptive sync still does not work properly with default settings on RX 6800, refresh rate jumps all over the place. That makes it feel like its stuttering. Running command echo 1 > /sys/class/drm/card0/device/pp_power_profile_mode fixes it.

I think this issue is gone for people who don't have adaptive sync monitor, but still there for people who have.

Maybe there have been some improvement to this in drivers, there is no fps hit now. But adaptive sync still does not work properly with default settings on RX 6800, refresh rate jumps all over the place. That makes it feel like its stuttering. Running command echo 1 > /sys/class/drm/card0/device/pp_power_profile_mode fixes it. I think this issue is gone for people who don't have adaptive sync monitor, but still there for people who have.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.