Working amdgpu Configurations?

Would someone be kind and share their working amdgpu configuration.nix? I mean everything related to getting an xserver running: kernel drivers, opengl set up, display manager, desktop manager, and whatever else is actually required to get to a working configuration. I’ve been banging my head against this keyboard for four days (not kidding) and cannot get a working xserver on this old, 2009 iMac… I’ve learned a lot along the way, but reading old posts on the internets is not getting it done. Need real, working examples to chew through this, as there are just too many variations and not enough explanation for why anyone is doing anything. Thanks in advance.

For me it worked without any configuration (modesetting X driver). Later I added videoDriver = "amdgpu";

Are you sure that old machine should use amdgpu and not an older AMD driver?

1 Like

I really am not sure that I should be using amdgpu. However, I’ve tried ati, ati_unfree, etc… Most of them either won’t compile or are no longer available, or just plain don’t seem to work. amdgpu was the first one that at least loaded and didn’t require me to tack nomodeset to the kernel to get it to the console. It’s an old ATI Radeon HD 4850 in a 2009 iMac. I tried to confirm which package would support it and all I could find was a Catalyst driver from AMD that I could try, but it was designed for a 2.6 kernel… I’d give up on this old box but I kind of wanted to prove Apple wrong. They completely stopped providing updates for this computer about three years ago and as such, it’s no longer safe to run Mac OS on it, even though it’s still a serviceable Minecraft/Roblox/Spotify box for the kiddos. :wink:

Really could use some example configs that people have of working amdgpu setups, since it would help a lot with troubleshooting the problem to be able to isolate, “Indeed, this is/is not a driver issue” because it could very well be a problem with the display manager that isn’t providing any useful logs…

Compilation issues should be solved by choosing an older kernel branch, if I understand you right. 4.4 and 4.9 should be supported upstream for a few more years.

Made a few revelations last night… lspci tells me exactly which kernel module is required to operate the video card: radeon. I’ve configured it as best I can figure out how to configure it. If I disable mode setting, I can get to a local prompt, but the radeon driver apparently is disabled when setting this, as it requires mode setting. If I allow mode setting, I get a black screen. I can log on via ssh and see that everything is operating as expected, including the display manager, but that doesn’t do any good if it can’t be used locally. For the moment, I’ve disabled mode setting and thus disabled the radeon driver and have enabled the frame buffer, so the machine is actually usable at the moment. It’s not great and I’d love to figure out how to get past the black screen that occurs when mode settings is permitted for the radeon driver. Any ideas for troubleshooting the black screen? Thanks so much for your input, I’ve noticed your name on literally every thread I’ve read on the forums that relates to video drivers. :smiley:

I’d try searching Linux-wide information for your HW, as usually you can configure it in a similar way.

I might’ve gotten my name on lots of places over the years, but I’m afraid my GPU driver knowledge is very superficial. And I’ve been lucky that I’ve had almost zero GPU Linux problems in the last several years. (Maybe I’ve been a bit careful when choosing HW.)

I’ve done a lot of work on this and a lot of reading. Lots of things feel like they’re going right, then just a blank screen. This is using the Radeon and associated drivers. It feels as if I’m not getting a lot further. I’m including my kernel boot log, in case anyone would care to take a look. I think I’ve hit a wall.

Can’t see a means for sharing a file with this interface. Is there a way?

I have a Lenovo E585 laptop with Radeon Vega 10 Mobile Graphics and I use these settings:

  boot.kernelPackages = pkgs.linuxPackages_latest;                                                                                                                                                                 
  boot.kernelParams = [ "amd_iommu=pt" "ivrs_ioapic[32]=00:14.0" "iommu=soft" ];                                                                                                                                   
  services.xserver.videoDrivers = [ "amdgpu" ];  
  hardware.cpu.amd.updateMicrocode = true;                                                                                                                                                                         
  hardware.enableRedistributableFirmware = true;                                                                                                                                                                   
  hardware.opengl.enable = true;                                                                                                                                                                                   
  hardware.opengl.driSupport = true;   

My issue was the screen froze after GRUB. I found the ivrs_ioapic settings in the ArchWiki.

I think you just drag and drop the file.


I think I’m destined to put in my ten thousand hours to master the X-Server skill on this one.


Sharing some information I learned while trying to get my setup working, here. I don’t have a working system yet, I’m still trying to get it to work.

  1. On version 19.09, amdgpu-pro errors out with abiCompat, specifically that it is compatible with xserver 1.19 and not 1.20. (1.20 is the default on 19.09 at the moment)

  2. Using amdgpu, the OS gets installed alright, but X11 server exits with an error upon trying to startx. Logs below (~/.xorg.log):

[   856.488] (==) Using config file: "/etc/X11/xorg.conf"
[   856.489] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   856.489] (==) Using system config directory "/nix/store/z927pbwkkwagg0lx4imiyfip1jkxpy5j-xorg-server-1.20.5/share/X11/xorg.conf.d"
[   856.489] (==) ServerLayout "Layout[all]"
[   856.489] (**) |-->Screen "Screen-amdgpu[0]" (0)
[   856.489] (**) |   |-->Monitor "<default monitor>"
[   856.489] (**) |   |-->Device "Device-amdgpu[0]"
[   856.489] (==) No monitor specified for screen "Screen-amdgpu[0]".
        Using a default monitor configuration.
[   856.489] (**) |-->Screen "Screen-radeon[0]" (1)
[   856.489] (**) |   |-->Monitor "<default monitor>"
[   856.489] (**) |   |-->Device "Device-radeon[0]"
[   856.489] (==) No monitor specified for screen "Screen-radeon[0]".
        Using a default monitor configuration.
[   856.489] (**) Option "DontZap" "on"
[   856.489] (**) Option "AllowMouseOpenFail" "on"
[   856.489] (==) Automatically adding devices
[   856.489] (==) Automatically enabling devices
[   856.489] (==) Automatically adding GPU devices
[   856.489] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   856.489] (**) FontPath set to:
[   856.494] (II) AMDGPU(0): [KMS] drm report modesetting isn't supported.
[   856.494] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   856.494] (EE) Screen 0 deleted because of no matching config section.
[   856.494] (II) UnloadModule: "amdgpu"
[   856.494] (EE) Device(s) detected, but none match those in the config file.
[   856.494] (EE)
Fatal server error:
[   856.494] (EE) no screens found(EE)
[   856.494] (EE)
Please consult the The X.Org Foundation support
 for help.
[   856.494] (EE) Please also check the log file at "/home/aniketd/.xorg.log" for additional information.
[   856.494] (EE)
[   856.495] (EE) Server terminated with error (1). Closing log file.
  1. I tried to be smart with a /etc/X11/xorg.conf.d/20-radeon.conf, with the following contents:
Section "Device"
        Identifier "RADEON HDMI"
        Driver "amdgpu"
        Screen 0

Section "Screen"
        Identifier "Screen 0"
        Device "RADEON HDMI"

But my hunch is that this didn’t get picked up, because it led to no difference in the .xorg.log output.

note: You see “amdgpu” and “radeon” both in the generation of the xorg configuration most likely because I used videoDrivers = [ "amdgpu" "radeon" ]; (although I’m not super sure about this)

I don’t know what I should do next.

1 Like

I’m not sure it helps, but just in case, here is a pointer to some work I did to get ati_unfree to build with 4.19:

1 Like

Thanks for the pointer @Jerith :slight_smile:

I’m not fully in the know about the difference between ati_unfree vs amdgpu vs amdgpu-pro, apart from this: that amdgpu is open-source, ati_unfree is the closed source version for older cards and amdgpu-pro is the closed source version for the newer cards.
When amdgpu loaded earlier, it was able to detect my card and the log output seemed to indicate that this driver could work.
I found this while surfing and tried switching the channel to unstable and forcing boot.kernelPackages = pkgs.linuxPackages_5_4 as shared there and it works.
Thanks for all the help!


Glad it helped @aniketd :+1:

To explain this is not issue with amdgpu per se. This depends on which graphic card are you using. The kernel upgrade is needed for Navi 10 series of AMD graphic chips.