How to change which graphics card a program uses?

6,920

install a proprietary driver

Since you are gaming this is the first thing you should do. You need to enable non-free sources so:

  • Open Ubuntu Software Center
  • go to Edit -> Software Sources
  • Enable the "Proprietary drivers for devices (restricted)" option.
  • Close the Software center
  • run sudo apt-get update to make sure things are up to date
  • go to your systems settings -> additional drivers
  • select the newest (usually recommended) proprietary driver, this will not be Nouveau
  • After the install is finished, reboot and continue.

Solutions To Use Your New Driver:


Check your BIOS

Check for an option to disable Intel Integrated Graphics, with integrated graphics disabled your system will default to the Nvidia card, but if you want to switch between Nvidia and Intel without rebooting every time, or your BIOS doesn't have the setting, these other solutions may work for you.


bumblebee

After installing using sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic and rebooting, you simply need to put optirun or primusrun in front of any command you want to optimize using the GPU. In the case of steam you need to right click the game in your library and select properties->set launch options and set the command to

optirun %command%

(substituting optirun for primusrun also works, you may test both to see if there is a performance difference for your system)


nvidia-prime

This is supposed to be included with the newer driver packages, but if it is not, you should be able to install it with sudo apt-get install nvidia-prime after installing and rebooting you will be able to manually select the card to use from the nvidia-settings menu. In order to switch from one to the other you will need to log out and back in.


Please Note:

If you install one of these, uninstall it BEFORE installing the other or you will be met with a black screen on boot up. Should this happen to you just Ctrl+Alt+F1 into a terminal and uninstall it manually, if you have your GUI working but get stuck in this terminal the GUI is usually reached by Ctrl+Alt+F7 (If not, just Ctrl+Alt+F around until you find it)

Share:
6,920

Related videos on Youtube

Alessandro Power
Author by

Alessandro Power

Updated on September 18, 2022

Comments

  • Alessandro Power
    Alessandro Power almost 2 years

    I recently installed Steam to run Rust on my Ubuntu 14.04. The game, even at the lowest graphics settings possible, lags incredibly hard, to the point where the game is unplayable.

    I have two graphics cards on my computer: an Intel 3rd Gen Core and a Nvidia GF108M [GeForce GT 630M] (I'm basically reading the output of lspci | grep VGA. I suspect that Steam is using my Intel graphics card instead of my Nvidia, because I should have the specs to play Rust and am able to play other games like League of Legends without issue.

    How can I change the graphics card that Steam is using?

    EDIT: Here's the relevant output of lspci -v:

    00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
        Subsystem: Toshiba America Info Systems Device fb01
        Flags: bus master, fast devsel, latency 0, IRQ 47
        Memory at c1400000 (64-bit, non-prefetchable) [size=4M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 5000 [size=64]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: <access denied>
        Kernel driver in use: i915
    
    01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: Toshiba America Info Systems Device fb01
        Flags: bus master, fast devsel, latency 0, IRQ 49
        Memory at c0000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at f0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 4000 [size=128]
        Expansion ROM at c1000000 [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nouveau
    

    Please note that I just installed a new driver to see if that will help. Update: It did not.

    • Wilf
      Wilf over 9 years
      Could you add the relevant output of lspci -v to your question?
    • Alessandro Power
      Alessandro Power over 9 years
      @Wilf I've just added the output of lspci -v.