7

I hope it's not making much difference that I'm posting my question here even if I'm using Pop!_OS. The problem also occurs on a Manjaro live usb.

I'm using a

  • Ryzen 1500x CPU,
  • 16GB of RAM,
  • MSI B350m Gaming Pro motherboard with an RX 580 8GB version,
  • Monitor is AOC G2260VWQ6 1920x1080x75hz.

After booting and logging in everything is fine, however, after turning the screen off and then on, going back from a screensaver, changing display settings that makes the screen "restart" or anything similar while being on a refresh rate over 60hz, which is ~75hz for my screen, the weird flicker starts happening.

Here are links with videos for different situations:

Sometimes it still works fine, but it only happened once, restarting the screen multiple times didn't begin the flicker, until reboot.

I tested it using both DisplayPort and HDMI, with higher refresh rates on lower resolutions the problem still occurs. When switching to a different resolution and still using ~75hz the flicker doesn't go away.

It happens on both Mesa version 18 and 19, on Manjaro it still happened on even when switching to kernel version 5. Of course, the problem doesn't occur in Windows.

I'm not that advanced in Linux so I really don't know how to fix it. Please help.

EDIT: After searching a bit more I found a workaround. I had to change "auto" to "high" in file /sys/class/drm/card0/device/power_dpm_force_performance_level. Link to the thread I found the workaround on: https://bbs.archlinux.org/viewtopic.php?id=244398

Agen
  • 71

2 Answers2

2

A good explanation on arch wiki: https://wiki.archlinux.org/index.php/AMDGPU#Screen_artifacts_and_frequency_problem


To quickly temporarily (you'll have to run command every boot) fix the problem run in terminal:

echo 'low' | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level

OR

echo 'high' | sudo tee  sys/class/drm/card0/device/power_dpm_force_performance_level

To fix it permanently (this will work even after reboots):

  1. Run in terminal:
echo '[Unit]
Description=Fix amd flickering on high Hz monitors.

[Service] ExecStart=/usr/bin/amdfix_script.sh

[Install] WantedBy=multi-user.target' | sudo tee /etc/systemd/syste/amdfix_service.service

  1. Run in terminal:
sudo chmod 644 /etc/systemd/system/amdfix_service.service
  1. Run in terminal (change 'low' to 'high' if you want. Personally I choose 'low': gpu is less noisy and I don't see any performance decrease.):
echo "#!/bin/bash
echo 'low' | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level" | sudo tee /usr/bin/amdfix_script.sh
  1. Run in terminal:
sudo chmod +x /usr/bin/amdfix_script.sh
  1. Run in terminal:
sudo systemctl enable amdfix_service.service
  1. Run in terminal:
sudo systemctl start amdfix_service.service

To check if its working run in terminal:

sudo systemctl status amdfix_service.service

the output should have text "amdfix_service.service: Succeeded."

All done.


To change performance level after you did all the steps, run command inside "3)" step again with wanted performance level 'low' or 'high' And then run

sudo systemctl restart amdfix_service.service
0

I am totally new to Linux, but I have the same issue... I am using Ubuntu 20.04 and my gpu is ADM Radeon rx 5700 xt.

The script works if i start it with

sudo systemctl start amdfix_service.service

But it doesn't work after reboot. I always have to run the command after boot. If I check the status with

sudo systemctl status amdfix_service.service

before running the script, i get the following output:

mdfix_service.service - Fix amd flickering on high Hz monitors.
 Loaded: loaded (/etc/systemd/system/amdfix_service.service; enabled; vendor preset: enabled)
 Active: failed (Result: exit-code) since Sun 2020-05-17 12:32:19 CEST; 1min 45s ago
Process: 779 ExecStart=/usr/bin/amdfix_script.sh (code=exited, status=1/FAILURE)
Main PID: 779 (code=exited, status=1/FAILURE)
Mai 17 12:32:19 leonPC sudo[792]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /sys/class/drm/card0/device/power_dpm_force_performance_level
Mai 17 12:32:19 leonPC sudo[792]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mai 17 12:32:19 leonPC amdfix_script.sh[808]: tee: /sys/class/drm/card0/device/power_dpm_force_performance_level: Permission denied
Mai 17 12:32:19 leonPC amdfix_script.sh[808]: low
Mai 17 12:32:19 leonPC sudo[792]: pam_unix(sudo:session): session closed for user root
Mai 17 12:32:19 leonPC systemd[1]: amdfix_service.service: Main process exited, code=exited, status=1/FAILURE
Mai 17 12:32:19 leonPC systemd[1]: amdfix_service.service: Failed with result 'exit-code'.

So it seems like, amdfix_script.sh does not have permission to write

sys/class/drm/card0/device/power_dpm_force_performance_level  

Do you have any idea how to fix that?

leon
  • 1