Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have 2 GPU's connected to my PC an AMD Radeon HD 7770 and a nVidia GeForce 8600GT and I would like to run the X server only on the nVidia card.

How can I do this?

Edit: Since my nVidia card is a no-go I swapped it for a Radeon HD 4770, the question remains the same although now I'd like to use the HD 4770.

This is the output of lspci -nnk | grep -iEA3 vga:

    01:00.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI   Device [1002:683d]
Subsystem: PC Partner Limited Device [174b:e215]
Kernel driver in use: fglrx_pci
Kernel modules: fglrx, radeon

   02:00.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI       Radeon HD 4770 [RV740] [1002:94b3]
Subsystem: XFX Pine Group Inc. Device [1682:2900]
Kernel modules: radeon
   02:00.1 Audio device [0403]: Advanced Micro Devices [AMD] nee ATI RV710/730 HDMI Audio [Radeon HD 4000 series] [1002:aa38]

And this is the output of lspci -v it's rather lengthy so I pasted it in here.

share|improve this question
    
And still be able to use the AMD card for other than Xorg purposes? E.g. redirecting the device to a virtual machine? –  gertvdijk Feb 7 '13 at 0:45
    
That would be an extra but no, only use the nvidia card and somehow make it ignore the AMD card. –  Uri Herrera Feb 7 '13 at 0:46
1  
Just blacklisting the kernel modules claiming the AMD card would be sufficient I guess? Can you run lspci -nnk | grep -iEA3 vga and include the relevant entries in your question? –  gertvdijk Feb 7 '13 at 0:50
    
Hmm looks I'm having hardware problems, it's only working with the AMD card, is the output necessary for the answer? maybe a generic answer?. –  Uri Herrera Feb 7 '13 at 3:33
    
@gertvdijk Will this work with two AMD cards?, I have another AMD card I can't use them in Crossfire since they're different GPUs, the other card is an HD 4770. I'd like to use the HD 4770 and the radeon drivers for X and the HD 7770 for a Windows Virtual Machine or just the HD 4770 and ignore the HD 7770. –  Uri Herrera Feb 9 '13 at 23:05
add comment

1 Answer

up vote 2 down vote accepted
+75

What is the output of a plain lspci -v ? (without the grep mentioned above?)

Make sure your BIOS is set to use the card you want to use as the VGA primary card. It probably has an option like "Primary video: PCIE16-slot1, PCIE-slot2, .. ". Make sure this is set to the slot of the NVidia card.

Blacklisting the modules might work but I imagine that the Xorg server will still try and run a vesa driver on the other card. Another option may be to use the pci-stub driver to essentially 'hide' the device from Linux. See here:

http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM

.. You might need to add these commands to scrips that run early in startup.

Failing those, you'd need a custom /etc/X11/xorg.conf to force the xserver to run on only one GPU. Otherwise, the Xorg server will scan the PCI bus and helpfully load any drivers it finds and (presumably) try to use them. Do man xorg.conf and then run Xorg -configure to generate an xorg.conf.new in the current directory. Then edit from the generated data, paying special attention to the BusID field under section Device. Then look at the "screen" section of the config, and remove any screens with a reference to the device (probably Card0 or Card1) that you don't want to use.

However, you may want to reconsider your use case. From your comment:

I'd like to use the HD 4770 and the radeon drivers for X and the HD 7770 for a Windows Virtual Machine or just the HD 4770 and ignore the HD 7770.

That's a very, very tall order despite how simple it seems. The problem is that either you need a system that has an IOMMU that can support re-routing the PCI(-E) bus using hardware virtualization (this needs CPU, bios and chipset support). Very few motherboards have the full support necessary (most have borked BIOS tables). Here's an account of someone trying to get their asus motherboard to work with virtualbox and running into BIOS issues:

http://unix.stackexchange.com/questions/56777/enabling-iommu-in-the-kernel-for-graphics-card-pass-through

Even systems that have an IOMMU working enough to support things like network card passthrough fail when working with video cards since the video cards are still treated as 'special' by the pci bus for legacy reasons (particularly the primary card as marked by the bios).

Otherwise, you're stuck using experimental hacks to various hypervisors trying to make things like this work using paravirt PCI-passthrough support. Xen claims to support using radeon cards in guests that are non-primary (and hidden using their PCIback driver). They also claim to be able to passthrogh an intel card to a guest even if its the primary card on the host. I personally never got it to work. NVidia cards are always harder to deal with in this case due to lack of documentation. It's quite possible that VMWare, KVM, or virtualbox may have better support for this, i don't know.

You can find information on Xen's graphics passthrough here: http://wiki.xen.org/wiki/Xen_VGA_Passthrough

Really, if you don't have functioning IOMMU support, give up trying to run a VM with video card passthrough, save yourself the pain.

share|improve this answer
    
Regarding the first part of your answer: My motherboard doesn't have a clear, explicit option to change what video card is used, I do however have an option to select from PCI/PGE and PGE/PCI (the first one is selected). And if needed I'll take a look at the link you provided to blacklist the fglrx driver. I'll probably need help with editing the x.org.conf file as you say. –  Uri Herrera Feb 14 '13 at 6:22
    
Regarding the second part: My motherboard does have an IOMMU, it's also an ASUS one specifically it's the M5A99X rev. 1.0 and it seems possible to use it, how good it works I don't know as I've never used it. I've asked two questions about it actually and while I've gotten answers they're just over my head so let's forget about the VM usage. For short for me to able to use only the HD 4770 I'd need to "hide" the HD 7770 or only blacklist the fglrx modules, would this then cause the OS to load the radeon drivers for both cards? and how would I go about switching between them?. –  Uri Herrera Feb 14 '13 at 6:23
    
I /think/ you won't need to hide that one if you manually create an xorg.conf file. You either hide the pci device before the xserver loads, and then X should only see one card and configure it, or you leave both cards enables and write an xorg.conf that only uses one. –  clemej Feb 16 '13 at 4:54
    
I see, can you help me with the x.org conf file? –  Uri Herrera Feb 16 '13 at 5:01
    
I'm flying a bit blind here, but try this: Run "Xorg -configure". Edit xorg.conf.new file that's created. Look for a section "Device" that contains something like BusID "PCI:2:0:0" (this is your radeon 7770 card you're trying to disable). Make note of the Identifier option also within that device section (lets assume it says Identifier "Card3"). Finally, look for any screen sections that say "Device "Card3"" and remove or comment them out. Save file, copy it to /etc/X11/xorg.conf, cross fingers and reboot. Check /var/log/Xorg.0.log to see what happened. –  clemej Feb 16 '13 at 5:35
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.