Reconfigure Xorg to produce display output on the correct video card

I read through the archwiki page for Xorg and wasn’t sure if these changes would do the right thing, so I am asking about it here. I recently bought an RX580 to use as a dGPU to run my displays, so that my Nvidia gpu could be used solely for CUDA.

Since when I installed Manjaro I only had the Nvidia card in the system, X was automatically configured to use it, now I want to reconfigure it to only use the amd card. I already installed the amdgpu drivers, but I wasn’t sure what changes should be made to Xorg.

What is the difference between the config files stored in /etc/X11/xorg.conf.d/ and plain old /etc/X11/xorg.conf?

if my xorg.conf looks like below:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 440.82

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 980 Ti"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "Coolbits" "28"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Then from what I have read I need to add a “Device” section for my RX580, and then under the section “Screen” I need to remove the coolbits option and add the device name I give to my amd card where it says “Device0”. Would that be enough to fix my configuration to start X on my amd gpu? Are there any additional side effects I should be made aware of?

Two things.

1.) Do you need the AMD drivers for any reason? If not, you should be using the opensource drivers which are part of the Linux kernel and do not need the “pro” AMD drivers from their site as the open source drivers are the official drivers.

2.) You are correct in your assumption, but do you need to use X at this point? Is there a reason why you cannot use Wayland. With the AMD drivers, this just works and since nVidia’s driver only works with X and somewhat works with GNOME using Wayland, your system should default to the AMD card with mode setting/DKMS.

Some time around 2010, a lot of maintainers of upstream packages floated the idea of having discreet configuration files instead of long monolithic configuration files. It helps with testing and ordering as you can name the files in such a way that it determines the order in which they are read and applied. Anything that you have in the xorg.conf will supercede any thing in the .d directories, unless you distro dynamically creates the conf file by reading the .d directories (this is usually denoted in the header of the main conf file).

So yes, setting driver to amdgpu and changing the VendorName and BoardName in your device section should do the trick. (The last two are just human readable and have no real function outside of that in your case). For the screen section remove the coolbits and you should be able to boot. But again, you will want to uninstall the AMD Pro driver and make sure you are running the latest 5.x Kernel, Mesa 19.x or newer and LLVM 9 or newer.

If that does not work, then follow the arch guide here, https://wiki.archlinux.org/index.php/AMDGPU

2 Likes

I must have mispoken, because I did install the open-source amd drivers (amdgpu). And the only reason I am not using wayland is because by default Xorg was configured since I didn’t have an amd card at the time. Once school is out for the summer one of the first things I am doing is moving away from manjaro over to arch or gentoo for the learning experience. At that point I will move over to wayland and back to KDE (I switched to GNOME because KDE + Nvidia Binary Drivers = 20 FPS on the desktop)

But, thanks for the lesson!

1 Like

No worries. I use Debian SID and Arch. I have never used Manjaro but it is the more User-friendly version of Arch, so there is no need to change distros unless you just want a more vanilla feel. I am an advocate for going directly to the source, hence my choice of distros.