How to Install Offical Nvidia Driver on Ubuntu Optimus Laptop

Hello Everyone!

In this tutorial I will be showing you how to install Nvidia Graphics Card into an Ubuntu running Optimus Laptop.


 

How to verify that you have two gpus

lspci | grep -E “VGA|3D”

How to Disable Nouveau

echo -e “blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off” > /etc/modprobe.d/blacklist-nouveau.conf

update-initramfs -u && reboot

After the installation

/etc/X11/xorg.conf

How to find PCI = nvidia-xconfig –query-gpu-info | grep ‘BusID : ‘ | cut -d ‘ ‘ -f6

Section “ServerLayout”
Identifier “layout”
Screen 0 “nvidia”
Inactive “intel”
EndSection

Section “Device”
Identifier “nvidia”
Driver “nvidia”
BusID “PCI:10:0:0”
EndSection

Section “Screen”
Identifier “nvidia”
Device “nvidia”
Option “AllowEmptyInitialConfiguration”
EndSection

Section “Device”
Identifier “intel”
Driver “modesetting”
EndSection

Section “Screen”
Identifier “intel”
Device “intel”
EndSection

—-

/usr/share/gdm/greeter/autostart/optimus.desktop
/etc/xdg/autostart/optimus.desktop

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c “xrandr –setprovideroutputsource modesetting NVIDIA-0; xrandr –auto”
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

——

run nvidia-smi to verify that your card is running


 

If this was helpful to you, please leave a comment and like 🙂

4 thoughts on “How to Install Offical Nvidia Driver on Ubuntu Optimus Laptop

  1. Hi thanks for the post…
    In this video you said you were going to disable intel gpu?
    Does this mean i cannot enable intel gpu later ?
    I want to be able to switch between intel and nvidia gpu using

    Like

  2. Hi thanks for the post…
    In this video you said you were going to disable intel gpu?
    Does this mean i cannot enable intel gpu later ?
    I want to be able to switch between intel and nvidia gpu using prime-select command… also in my system nvidia-smi command is missing…

    Like

    1. Hello takt1kal!

      Yes, if you follow my tutorial you’ll be disabling Intel GPU, which means you couldn’t switch between gpus. However, if nvidia-smi command is missing, it means that you haven’t installed its drivers yet.

      Like

  3. Hello, I tried installing nvidia drivers but when I run nvidia-smi, it says it couldnt communicate with driver. I could really use your help. Thanks

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s