Update, 2020-04-29: Since upgrading to kernel 5.6.6 and Mesa 20.0.4 I haven’t had any GPU resets anymore even without this workaround. It seems the reclocking issue is fixed. Keeping the article for reference:
If you have an AMD Vega 56 or 64 you may have had some issues using the amdgpu driver, namely random GPU resets leaving you with a blank or colored screen and freezing the computer after a few minutes. It seems that too aggressive memory reclocking is the culprit, but I found a solution in the Freedesktop issue list on their GitLab instance:
Stick this in your systemd, e.g. to /etc/systemd/system/amdgpu-pp.service
:
[Unit]
Description=AMD PP adjust service
[Service]
User=root
Group=root
GuessMainPID=no
ExecStart=/opt/amdgpu-pp.sh
[Install]
WantedBy=multi-user.target
Code language: TOML, also INI (ini)
Then in /opt/amdgpu-pp.sh
:
#!/bin/bash
echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
echo "1 2 3" > /sys/class/drm/card0/device/pp_dpm_mclk
Code language: Bash (bash)
chmod +x
that bugger and enable/start the service:
systemctl enable amd-pp.service
systemctl start amd-pp.service
Code language: Bash (bash)
There, done! I have never had any GPU resets after this. Thank you, haro41, for this workaround.