Nvidia Geforce 710m Drivers on Optimus Laptop
Get a NVIDIA 710M working on Arch Linux
Install Nvidia Geforce 710m Drivers on Optimus Laptop
Disable GPU Manager
GPU Manager will overwrite the X configuration at each reboot, so the first step is to disable it.
According to various posts it can be disabled adding nogpumanager to the boot options e.g. in GRUB.
Edit /etc/default/grub and add nogpumanager to the GRUB_CMDLINE_LINUX option.
For example, if /etc/default/grub had
1
GRUB_CMDLINE_LINUX=""
change it to
1
GRUB_CMDLINE_LINUX="nogpumanager"
Then update GRUB:
1
2
3
4
5
6
$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.18.0-10-generic
Found initrd image: /boot/initrd.img-4.18.0-10-generic
Adding boot menu entry for EFI firmware configuration
done
Install Bumblebee
1
$ sudo apt install bumblebee-nvidia
should install Bumblebee and all the necessary dependencies.
Once it is done, check that the bbswitch module is available and loaded:
1
2
$ lsmod | grep bbswitch
bbswitch 16384 0
It should also have blacklisted the nouveau driver:
1
2
3
4
5
6
7
8
9
10
11
$ head /etc/modprobe.d/bumblebee.conf
# This file is installed by bumblebee, do NOT edit!
# to be used by kmod / module-init-tools, and installed in /etc/modprobe.d/
# or equivalent
# do not automatically load nouveau as it may prevent nvidia from loading
blacklist nouveau
# do not automatically load nvidia as it's unloaded anyway when bumblebeed
# starts and may fail bumblebeed to disable the card in a race condition.
# Debian
blacklist nvidia
Configure X to use the Intel driver
Generate a clean Xorg configuration file:
1
2
3
4
5
6
7
8
9
10
$ sudo -i Xorg :1 -configure
X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
...
(++) Using config file: "/root/xorg.conf.new"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Number of created screens does not match number of detected devices.
Configuration failed.
(EE) Server terminated with error (2). Closing log file.
The newly-generated /root/xorg.conf.new will likely try to configure the Intel card and one for the NVIDIA card at the same time.
Optional
Remove the references to the NVIDIA part, e.g. the Card1 Device section, the Monitor1 Monitor section, and the Screen1 screen section.
Save the config file
Make any other adjustments you may want, then copy the file to /etc/X11/:
1
sudo cp /root/xorg.conf.new /etc/X11/xorg.conf
Reboot
Now reboot, in order to apply all the changes.
Install the latest NVIDIA drivers
Add the PPA to get the latest proprietary drivers:
1
2
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt update
Find out what is the latest available version, and install it:
1
2
$ apt-cache search nvidia-driver | grep ^nvidia-driver
$ sudo apt install nvidia-driver-390
If the last command fails with conflicts about xserver-xorg-video-nvidia-390, try manually applying some of the changes:
1
2
3
$ sudo dpkg --force all -P xserver-xorg-video-nvidia-390 libnvidia-cfg1-390
$ sudo apt install xserver-xorg-video-nvidia-410 libnvidia-cfg1-410
$ sudo apt install nvidia-driver-410
Configure bumblebee and optirun
Edit /etc/bumblebee/bumblebee.conf and change these keys:
1
2
3
4
5
6
7
8
9
10
[bumblebeed]
Driver=nvidia
[optirun]
Bridge=primus
[driver-nvidia]
PMMethod=bbswitch
LibraryPath=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu
XorgModulePath=/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules
Then reload the bumblebee daemon:
1
$ sudo systemctl restart bumblebeed
Disable GLVND
1
$ echo 'export __GLVND_DISALLOW_PATCHING=1' | sudo tee /etc/profile.d/disable-glvnd.sh
You will need to reboot to propagate the environment variable to the running sessions. In the meantime, it can be set explicitly (see the next point).
See this post for some background information.
Test optirun
Open a new terminal and run:
1
2
3
4
5
6
$ export __GLVND_DISALLOW_PATCHING=1
$ optirun glxgears
291 frames in 5.0 seconds = 58.033 FPS
300 frames in 5.0 seconds = 59.992 FPS
300 frames in 5.0 seconds = 59.998 FPS
...
If it works, congratulations, your system is configured to run standaerd operations with the Intel card and offload on-demand to the NVIDIA card.