AnsweredAssumed Answered

Resolving Driver Conflicts in Xorg -> Running 2 Discrete Video Cards, Primary Nvidia Secondary AMD

Question asked by colinh on Jan 9, 2014

I've been trying to get this setup to work for almost a week now, All I want to do is use my Nvidia GTX 670 as my primary video card for display with occasional computing with CUDA, and use my AMD R9 280X in the secondary PCIe slot primarily for OpenCL use. I have managed to set this up with minor issues in Windows 7 where there aren't any major conflicts with the Nvidia and AMD Catalyst drivers (the only setback here is that a dummy plug or monitor must be connected to the AMD card otherwise its sensors can't be read from any program). I would really like to get this working under linux though, as that is my main OS and where I conduct all my development; Windows is rather useless to me other than for gaming.


I have tried every configuration option I could think of to get this running, but it seems the official AMD driver (which is needed for openCL to work) is very inflexible and incompatible with any other vendors graphics drivers loaded into Xorg. The main incompatibilities lie in the libgl and libglx modules; while the Nvidia driver has no problem booting with a libgl from ANY vendor and either its own or the xserver-xorg-core (but not the amd, the AMD fglrx driver will not boot with any other libgl or libglx other than its own (does not produce any errors in the xorg.log with a different, just hands the xserver on boot and requires a hard reboot).


The closest I have come to solving this issue is booting an xserver with only the primary Nvidia card using the AMD libgl and Nvidia libglx in the xorg.conf, then starting a second xserver session with the fglrx driver and the amd libgl and libglx modules on another TTY with output to a second monitor. I then run the commands "export DISPLAY=:1" and "export COMPUTE=:1" (both commands must be run for programs to fully recognize the AMD card) in a terminal window on this xserver session (2nd monitor) and I can then use the AMD card fully including for openCL. The only problem with this setup is that when I switch back to my primary TTY xserver session, I get a GPU idle warning after 60 seconds and the openCL application running on the AMD card shutsdown until I switch back to that xsession.


Is there any way to run both of these cards together in the same xorg session? The only possible way that I could think of is if I could somehow load 2 GLX modules on xorg startup to clear up the conflict or get the fglrx driver to agree on a third party GLX like the Nvidia card does, but I don't know how I would go about doing this. Why is it that the fglrx driver will not cooperate with any other or libgl but its own? If the official Nvidia driver is able to work with other 3rd party modules, I don't understand why it would be so difficult for the AMD driver to do the same..


Here are the last lines reported in my Xorg logs for the different 3rd party GLX module configurations (Nvidia, Xorg Foundation) below, as you can see the fglrx driver hangs the xserver requiring a hard reset with every other non-AMD GLX module, without reporting any errors:


Nvidia GLX:


[   844.888] (II) fglrx(0): Kernel Module Version Information:

[   844.888] (II) fglrx(0):     Name: fglrx

[   844.888] (II) fglrx(0):     Version: 13.25.5

[   844.888] (II) fglrx(0):     Date: Dec  6 2013

[   844.888] (II) fglrx(0):     Desc: AMD FireGL DRM kernel module

[   844.888] (II) fglrx(0): Kernel Module version matches driver.

[   844.888] (II) fglrx(0): Kernel Module Build Time Information:

[   844.888] (II) fglrx(0):     Build-Kernel UTS_RELEASE:        3.11.0-15-generic

[   844.888] (II) fglrx(0):     Build-Kernel MODVERSIONS:        yes

[   844.888] (II) fglrx(0):     Build-Kernel __SMP__:            yes

[   844.888] (II) fglrx(0):     Build-Kernel PAGE_SIZE:          0x1000

[   844.888] (II) fglrx(0): [uki] register handle = 0x00004000



Xorg GLX:


[ 20571.689] (II) fglrx(0): Kernel Module Version Information:

[ 20571.689] (II) fglrx(0):     Name: fglrx

[ 20571.689] (II) fglrx(0):     Version: 13.25.5

[ 20571.689] (II) fglrx(0):     Date: Dec  6 2013

[ 20571.689] (II) fglrx(0):     Desc: AMD FireGL DRM kernel module

[ 20571.689] (II) fglrx(0): Kernel Module version matches driver.

[ 20571.689] (II) fglrx(0): Kernel Module Build Time Information:

[ 20571.689] (II) fglrx(0):     Build-Kernel UTS_RELEASE:        3.11.0-15-generic

[ 20571.689] (II) fglrx(0):     Build-Kernel MODVERSIONS:        yes

[ 20571.689] (II) fglrx(0):     Build-Kernel __SMP__:            yes

[ 20571.689] (II) fglrx(0):     Build-Kernel PAGE_SIZE:          0x1000

[ 20571.689] (II) fglrx(0): [uki] register handle = 0x00ade000

[ 20571.689] (II) fglrx(0): DRI initialization successfull

[ 20571.689] (II) fglrx(0): FBADPhys: 0xf400000000 FBMappedSize: 0x010e0000


Any insights on how to solve this problem?