I recently installed Nvidia graphics card on my laptop. However even after installation the machine is still using the Intel graphic chip. I tried running prime-select nvidia, the output being nvidia profile is already set but whenever I try checking which graphic card I am using, by,

lspci -vnnn | perl -lne 'print if /^\d+\:.+(\[\S+\:\S+\])/' | grep VGA

the output is still

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 520 [8086:1916] (rev 07) (prog-if 00 [VGA controller])

I also tried

optirun glxinfo|egrep "OpenGL vendor|OpenGL renderer"


OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 5.0, 256 bits)

but still no effect. I tried going to the nvidia-setting to configure the prime profile through the GUI, but the prime profile tab is not displayed. NOTE: I installed nvidia-prime through a deb file, apt install nvidia-prime didn't seem to work.

The output from sudo lspci -nnk | grep -i vga -A3&&sudo lshw -c display

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 520 [8086:1916] (rev 07)
    Subsystem: Hewlett-Packard Company Skylake GT2 [HD Graphics 520] [103c:820c]
    Kernel driver in use: i915
    Kernel modules: i915
       description: VGA compatible controller
       product: HD Graphics 520
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 07
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:131 memory:a2000000-a2ffffff memory:b0000000-bfffffff ioport:5000(size=64) memory:c0000-dffff
       description: 3D controller
       product: GM108M [GeForce 940MX]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=nvidia latency=0
       resources: irq:134 memory:a3000000-a3ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:4000(size=128)
  • Will you add the output of sudo lspci -nnk | grep -i vga -A3&&sudo lshw -c display to your question? – L. D. James Apr 11 '18 at 6:39
  • done @L.D.James – Sahil Apr 11 '18 at 7:16
  • What release of Ubuntu & which nvidia driver version/ – doug Apr 11 '18 at 12:48
  • Are you still having problems switching to nvidia? If the command provided in the answer doesn't work, you may have some other unexpected issue, which I'm sure I would be able to help with. If it works, it may be a contribution back to the community for others trying to switch to preferred drives, to find solutions that work. – L. D. James Apr 12 '18 at 18:57
  • I recently had the chance to try your solution out. Thank You so much. It worked for me flawlessly and even on my buddies system, who switched to Linux only, recently. @L.D.James – Sahil Apr 13 '18 at 19:37

You can switch nvidia graphics drivers from the commandline using this command:

$ sudo apt install nvidia-###

(Replace the ### with the number of the version you want to switch to.)

Currently the latest version from the repository is nvidia-384. The latest version # from the Official nVidia Website will depend on which specific card you specify in the download option.

You have nvidia [GeForce 940MX] which is compatible with nvidia-384 driver (currently the highest nvidia in the repository). You can install it with this command:

$ sudo apt install nvidia-384

The following command will show you the current drivers you have installed on your computer:

$ ubuntu-drivers devices

This command will show you all the available drivers in the repository, and will include any PPA's you have installed:

$ apt search nvidia - | egrep "^nvidia-[0-9]+\/"

Because it appears that you have downloaded drivers from nvida, you will see a later version than the one in the default repository. You can use the command to install that driver by replacing install nvidia-384 with the number you see from the previous command install nvidia-xxx.


If you inadvertently select an unstabled version that causes the desktop not to properly load, you can change the driver to the nvidia-384 (or working version) from the console (Alt+Ctrl+F2).

After the install of a different driver, this command shows which one is currently in use:

$ lspci -nnk | grep -i vga -A3

In your case, results from the requested command shows that you currently have the [HD Graphics 520] driver being used.

You can use this direct link to nVidia's Driver Downloads. From the Operating System drop-down, choose your version of Ubuntu.

Currently the highest nVidia driver version that I find is in the PPA provided by Webupd8, which is version nvidia-396.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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