Games lagging a lot when playing a video

Hi, I have an AMD GPU and use Firefox. I have hardware acceleration for VP9 amd AV1.

When I’m playing a video on youtube and playing a game, the game sometimes lag a lot, I drop to 22 fps. If I pause the video my fps are normal.
It’s not lagging every time, like sometimes it’s not lagging and other time after like 30 seconds of video my fps drops.

I had no problems when using chrome but that’s maybe because it has not GPU acceleration.

Is there a log or something where I can find more info about this problem ?

From your description it sounds like your GPU is not very powerful.
What GPU is it?
What is spec GPU does the game you are playing expect?

I have an RX 6700 XT which I think is quite powerful.
I haven’t test on other games but on Minecraft with shaders my fps drops from 120 to 22.

Since you have a 6000-series, I wonder if you are somehow hit with the power management bug[1] when you start a video and your gpu clocks down.


  1. https://wiki.archlinux.org/title/AMDGPU#Screen_artifacts_and_frequency_problem ↩︎

That’s the problem I have. When I change /sys/class/drm/card1/device/power_dpm_force_performance_level from auto to high, the video doesn’t make my game lag. That’s strange because when my game is lagging my GPU is still at 2.6 GHz like when it’s set to high.

What can I do to fix this problem without always running my GPU at 2.6 GHz ?

Glad you found the cause of your issue!

As for a solution though, I don’t really know. From what I’ve gathered about that issue is that it is a fairly long-standing issue with the 6000-series.

You could use gamemode,[1] and set it to toggle high-mode while running a game.

But as for a real long-term solution, the best I can do is link you to the relevant bugtracker.[2]


  1. ↩︎

  2. ↩︎

I’ve made an issue on the bugtracker if someone have the same problem :

I don’t know if this is related to this bug but I can’t play any h264 video in firefox.
It’s really annoying since twitch and some yb videos are in avc / h264

Do you have fedora-cisco-openh264.repo

I haven’t said it earlier but I’m using fedora kinoite. I have not installed any host packages besides rocm.
It should works even without this package right ? I will only get CPU transcoding but it’s okay.

Years ago (I saw it pre-GCN and HD7850) there was some silliness with PowerPlay/UVD where if you were playing a game or otherwise had 3D/high performance clocks being used no problem, if you started a video, it would switch and lower the clocks to a video profile; Windows and Linux. Forcing the high performance level would prevent that.

There’s a command to show the PowerPlay states and which ones is active; I recall it having 3D and a profile for VR on a 6600 XT. I would start a game, check what power state is active, then start a hardware-accelerated video and check again.

I would very much hope that that same silliness isn’t still happening on RDNA2+, but it’s AMD :person_shrugging:


On an older script with a 6600 XT, I was setting power_dpm_force_performance_level to manual because of another fun AMD issue https://gitlab.freedesktop.org/drm/amd/-/issues/1500

Here’s a script that should force max performance on AMD GPUs without overclocking (looks safe as-is):

#!/bin/bash

# Reset OC
echo 'r' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

# Performance Hack
# drm/amd#1500
echo 'manual' | sudo tee '/sys/class/drm/card'*'/device/power_dpm_force_performance_level'
echo '1' | sudo tee '/sys/class/drm/card'*'/device/pp_power_profile_mode'

# Max Power Limit
echo "$(cat '/sys/class/drm/card'*'/device/hwmon/hwmon'*'/power1_cap_max')" | sudo tee '/sys/class/drm/card'*'/device/hwmon/hwmon'*'/power1_cap' > '/dev/null'

# OC Confirm
echo 'c' | sudo tee '/sys/class/drm/card'*'/device/pp_od_clk_voltage'

I don’t know for sure if the OC (overclock) reset and confirm commands are needed just to affect power cap and power modes, but theoretically they shouldn’t apply anything since there’s no core/mem clocks being specified (my linked notes have core/mem OCs included).

I’ve temporarily fixed this problem using gamemode.

I’ve copy the config file from /usr/share/gamemode/gamemode.ini to /etc/gamemode.ini
I changed those config :
apply_gpu_optimisations=accept-responsibility
gpu_device=1
amd_performance_level=high

It still wasn’t working so I had to do killall gamemoded
Now it’s working fine and I’ve checked by doing cat /sys/class/drm/card1/device/power_dpm_force_performance_level