Skip to content

Instantly share code, notes, and snippets.

@robertkirkman
Last active September 25, 2024 22:36
Show Gist options
  • Save robertkirkman/8a28bcbbd43dbb1ef04cb48cdc8718a0 to your computer and use it in GitHub Desktop.
Save robertkirkman/8a28bcbbd43dbb1ef04cb48cdc8718a0 to your computer and use it in GitHub Desktop.
How to get 100% uncompromising GNU/Linux graphics stability on RDNA1

My stable AMD Radeon RX 5700 XT settings

Note

This is my personal workaround to the nebulous [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx_0.0.0 timeout which I have not experienced since the first day, after many months of trial and error, that I started using these exact settings, albeit with older versions of Gentoo's LTS kernel and stable graphics packages, on May 7th 2023, 1 year and 4 months ago. Some people claim that the situation on RDNA2 and RDNA3 is different, so if you have a similar but non-RDNA1 GPU, you might be able to find similar but slightly different workarounds for your system in that freedesktop gitlab issue.

Important

During my 1 year and 4 months test, other Gentoo users have independently and simultaneously discovered and written in-depth documentation for the same/equivalent procedure into the Gentoo Wiki, creating a more comprehensive and universal version of this guide not specific to a single GPU model or display server that did not exist when I began my test, so you should think of this gist as my personal settings that I have been using with my own GPU for 1 year and 4 months and only uploaded at the end of that period, which might be longer or might be shorter than the amount of time the authors of the Gentoo Wiki used their settings before posting them on the Gentoo Wiki.

  1. Install Gentoo
  2. Install an LTS kernel. New kernels, like for one example, the one Arch Linux directs users to by default, are great for testing new features, but their amdgpu modules occasionally have bugs, which I have experienced in the past.
  3. Install Gentoo's official Xorg and Mesa for AMD Radeon RX 5700 XT including the amdgpu and radeonsi VIDEO_CARDS flags, the X, opengl and vulkan USE flags, and the media-libs/mesa, x11-base/xorg-server and x11-drivers/xf86-video-amdgpu packages (NOTE: technically I also tested the same system for a 30-day session without installing the x11-drivers/xf86-video-amdgpu package but still running OpenGL programs on the GPU using only the modesetting_drv.so that comes with x11-base/xorg-server and not the amdgpu_drv.so, so you don't absolutely need x11-drivers/xf86-video-amdgpu if you don't want it, but I haven't had any issues with it in a very long time and the way to use Gentoo without installing it is very convoluted, so you should only switch to modesetting_drv.so if you experience a real issue with a recent version of amdgpu_drv.so).
  4. Install CoreCtrl, including adding amdgpu.ppfeaturemask=0xffffffff to your bootloader settings and applying its settings on boot using your init system, or at login using your autolauncher.
  5. Set the Performance mode to Advanced, the GPU MINIMUM MHz to 1605, the GPU MAXIMUM MHz to 1605, the Memory MAXIMUM MHz to 875, the Power profile to 3D Fullscreen, and the Power limit (W) to 270.
  6. Use absolutely any app as much as you want for as long as you want, and as long as your hardware is correctly set up and has ventilation, good silicon, and a correct power supply and UPS that are both stable, Xorg will not crash, for at least 4 months which is the longest I have used the system without turning it off before. Right now I have been using this Xorg process for 40 days.

image

Note

It is possible that there might be one or more stable Wayland compositors, that could work for you in a similar configuration, which you might know about more than me. What is true is that not all Wayland compositors are stable, so you would have to have a familiarity with the one you choose before you would know whether it is stable or not. I haven't used Wayland on the AMD Radeon RX 5700 XT. My window manager is Gentoo's x11-wm/marco and my display manager is x11-apps/xinit, but I have no reason in particular to believe that either of those is necessary to achieve the same stability I have - other than one small detail, which is that my use of startx in place of a conventional display manager means that when I turn on my computer, Xorg never launches until a few seconds before my DE's autolauncher launches CoreCtrl, which applies my clock speeds. I can imagine that could hypothetically mean that use of a conventional display manager could manage to crash the graphics subsystem if you use a method of applying the clock speeds that only takes effect after login, and for that reason, if you want to be as thorough as possible I would actually recommend applying the clock speeds solely through your init system rather than your autolauncher if you use a conventional graphical display manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment