6

yesterday I bought a laptop which contains both a Nvidia 940mx graphics card and Intel Integrated Graphics. I have found that it uses the Intel integrated graphics by default, but I wish for it to use the Nvidia card instead.

I have already tried switching while using Arch Linux and have switched to Ubuntu in hopes that it will work here, as when I made an attempt on Arch Linux, it resulted in the X Server being entirely unable to start, reporting that it is unable to locate the display, or something along those lines. Because I have already had this issue with switching, I am hesitant to try again without first ensuring that everything will work correctly.

There seem to be several conflicting (and outdated) guides for switching to the nvidia card. Using vga_switcheroo did not work, as the /sys/kernel/debug/vgaswitcheroo/switch did not even exist. Any existing questions on stack exchange which describe utilizing the nvidia card are either outdated, inconsistent with all the others, or are not consistent with my situation.

Some Hardware Information:

$ lspci -nnk | grep -i vga -A3 | grep 'in use'
Kernel driver in use: i915

$ lshw -short | grep display
/0/100/2                     display        Intel Corporation
/0/100/1c/0                  display        NVIDIA Corporation

$ lshw | grep -A10 "VGA\|3D"
         description: VGA compatible controller
         product: Intel Corporation
         vendor: Intel Corporation
         physical id: 2
         bus info: pci@0000:00:02.0
         version: 02
         width: 64 bits
         clock: 33MHz
         capabilities: vga_controller bus_master cap_list rom
         configuration: driver=i915 latency=0
         resources: irq:131 memory:b2000000-b2ffffff memory:c0000000-cfffffff ioport:5000(size=64) memory:c0000-dffff
--
            description: 3D controller
            product: NVIDIA Corporation
            vendor: NVIDIA Corporation
            physical id: 0
            bus info: pci@0000:01:00.0
            version: a2
            width: 64 bits
            clock: 33MHz
            capabilities: cap_list
            configuration: latency=0
            resources: memory:b3000000-b3ffffff memory:a0000000-afffffff memory:b0000000-b1ffffff ioport:4000(size=128) memory:b4000000-b407ffff

$ lspci -nnk | grep -i "VGA\|3D" -A3
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:5916] (rev 02)
    Subsystem: Acer Incorporated [ALI] Device [1025:111a]
    Kernel driver in use: i915
    Kernel modules: i915
--
01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:179c] (rev a2)
    Subsystem: Acer Incorporated [ALI] Device [1025:111a]
    Kernel modules: nvidiafb, nouveau
03:00.0 Network controller [0280]: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter [168c:0042] (rev 31)

$ sudo ubuntu-drivers devices                             
== cpu-microcode.py ==
driver   : intel-microcode - distro non-free

== /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0 ==
vendor   : NVIDIA Corporation
modalias : pci:v000010DEd0000179Csv00001025sd0000111Abc03sc02i00
driver   : xserver-xorg-video-nouveau - distro free builtin
driver   : nvidia-367 - distro non-free recommended

$ arch
x86_64

Given this information, what is the safest way for me to switch from the intel device to the nvidia graphics card without a risk of breaking the X server? This system is running Ubuntu 16.10 Yakkety.

Ethan McTague
  • 380
  • 2
  • 3
  • 23
  • Disable Secure Boot in BIOS. – Pilot6 Feb 05 '17 at 16:38
  • 1
    @Pilot6 what? I'm not even using UEFI mode, I'm on legacy because UEFI was giving me trouble. I wouldn't even be able to boot Ubuntu if secure boot was on, anyways. What has this got to do with Nvidia graphics? – Ethan McTague Feb 05 '17 at 16:39
  • Nvidia driver does not load with Secure Boot enabled. I see that it is not loaded. Did you install nvidia-367? – Pilot6 Feb 05 '17 at 16:43
  • @Pilot6 Secure boot isn't enabled, because I'm booting in BIOS/legacy mode. UEFI mode (with secure boot off) would not boot Ubuntu at all. EDIT: And no, I haven't installed the nvidia drivers yet. I'll try that now. I'm hesitant because that's what broke my last install's X. – Ethan McTague Feb 05 '17 at 16:44
  • 1
    @Pilot6 update: nvidia driver installed, nothing seems to have changed, except that the NVidia controller's configuration now reads driver=nvidia latency=0, and the kernel drivers for both devices appear to be in use. I am not certain which device is actively in use anymore. – Ethan McTague Feb 05 '17 at 16:59
  • OK. Now you can switch in the Nvidia X server application. Or check the prime-select query command. – Pilot6 Feb 05 '17 at 17:05
  • @Pilot6 actually, the nvidia settings tool reports that the NVIDIA card is now the default! Thank you! – Ethan McTague Feb 05 '17 at 17:08

1 Answers1

6

First you need to install the driver by

sudo apt install nvidia-367

and reboot.

You can check the status and switch adapters in the Nvidia X Server Settings application (PRIME Profiles).

Also you can check the status in a terminal by

prime-select query

Switch to Nvidia by

sudo prime-select nvidia

Switch to Intel by

sudo prime-select intel

You need to log out and it to apply the setting.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • 1
    Is there a link you can reference on why sudo apt install nvidia-367 command instead of Settings->Software & Updates->Additional Drivers. Also why 367 when said screen reveals 340, 375, 367, 378 & 370 (open source) plus 304 (proprietary). I have 304 currently installed and not working for my Geforce GT650M so always use Intel Hybrid HD4000 instead. Just curious why terminal is recommended and not Ubuntu's GUI methodology. I know 367 is the long term stable release which I presume is why you picked that version? A link referencing your installation technique would be nice. Thanks :) – WinEunuuchs2Unix Feb 05 '17 at 19:55
  • 1
    They all are proprietary. The 367 is the one that is in the Ubuntu repos. You see others because you have connected an unofficial PPA. The command does the same as the GUI prog. – Pilot6 Feb 05 '17 at 20:15
  • Ahh.. thank you. It's true I added the nvidia PPA sometime last year for reasons given on other threads / websites I now forget. I will conform and use 367 like everyone else soon :D – WinEunuuchs2Unix Feb 05 '17 at 20:21