11

I want to use 2 graphic cards in my Ubuntu 14.04.

1) An external graphic card for computations with Cuda.

2) The onboard graphic card to run my x-server on.

However when I connect my display to the onboard graphics card before bootup, Ubuntu still uses the external graphics card for the x-server.

How can I change that?

mcExchange
  • 3,088

3 Answers3

7

As you have mentioned Cuda in your question, you obviously must use a NVIDIA graphics card.
To achieve what you want, you will have to install the proprietary NVIDIA drivers and Optimus.
After that you can switch between the graphics from NVIDIA X Server Settings PRIME Profiles.

For GEFORCE 400 - 700 I recommend to install the NVIDIA drivers version 352 and nvidia-prime.
For GEFORCE 800 - 900 I recommend to install the NVIDIA drivers version 358 and nvidia-prime.
To identify the exact graphics adapter model of the external card open a terminal and execute :

lspci -k | grep -EA2 'VGA|3D'  

Installation instructions - the latest stable NVIDIA drivers version 352

Highlight the Ubuntu entry in the GRUB boot menu and press the E key.
Add nouveau.modeset=0 to the end of the linux line - press F10 to boot.

On the login screen press Ctrl+Alt+F1 - enter your user name and your password - execute :

sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo reboot  

Installation instructions - the latest official NVIDIA drivers version 358

Highlight the Ubuntu entry in the GRUB boot menu and press the E key.
Add nouveau.modeset=0 to the end of the linux line - press F10 to boot.

On the login screen press Ctrl+Alt+F1 - enter your user name and your password - execute :

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-358 nvidia-prime
sudo reboot  

Note :

Generally you should use the drivers from the official Ubuntu repositories. Sometimes there are problems with these drivers - you can install the more current drivers from the GPU Drivers PPA. This often leads to properly working graphics, especially on very new NVIDIA GEFORCE adapters.

cl-netbox
  • 31,163
  • 7
  • 94
  • 131
  • should the nouveau.modeset=0 also be added to the grub config? I've got an NVIDIA 940M with an Intel Skylake and it does not work well under most desktops with the drivers I've installed from the default repositories. – zeitue Mar 17 '16 at 00:41
  • 1
    @zeitue : After the installation of the NVIDIA drivers adding the parameter is not necessary anymore. :) – cl-netbox Mar 17 '16 at 09:51
  • thanks that fixed my system using this method all desktops work now. – zeitue Mar 17 '16 at 18:13
1

I believe this topic was already been discussed and solved on many other forums. beside the forums, I know by myself it is possible as I did similar setup at my college time in the lab for HPCC purposes.

It is possible and easily feasible since Xorg supports set-up and configuration of multiple cards.

However, below links will provide you all the steps to to the configuration you are looking for:

  1. How do I change the GRUB boot order?
  2. https://devtalk.nvidia.com/default/topic/572224/two-graphics-cards-in-linux-how-/
  3. https://launchpad.net/grub-customizer

The discussion on nVidia (2) official forum will give you clear steps.

You will need grub-customizer if you don't know how to handle grub manually.

here is another link which is a bit oldish but the steps are universal and pretty can be adapted to current ubuntu systems:

http://ubuntuforums.org/showthread.php?t=53966

muru
  • 197,895
  • 55
  • 485
  • 740
ostendali
  • 1,158
  • None of these links helped my case. I fixed it like this, http://askubuntu.com/questions/712578/using-the-onboard-vga-output-and-not-using-the-pcie-nvidia-card/712593#712593 – Siddharth Dec 23 '15 at 17:54
0

I've got Ubuntu 20.04 and the following worked for me:

  1. Run nvidia-settings
  2. Under PRIME Profiles, choose NVIDIA On-Demand
  3. Apply and restart
codeholic
  • 101