-
Install bumblebee and nvidia-drivers using this command
sudo apt install nvidia-driver-390 bumblebee-nvidia
-
Select Intel as your primary display driver
sudo prime-select intel
-
Make these changes to the Library paths in
/etc/bumblebee/bumblebee.conf
(because of the changes for GLVND in nvidia driver) and ensure thatnvidia
driver is selected# The Driver used by Bumblebee server. If this value is not set (or empty), # auto-detection is performed. The available drivers are nvidia and nouveau # (See also the driver-specific sections below) Driver=nvidia
[driver-nvidia] 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,/usr/lib/xorg/modules/input
-
Ensure that the file
/etc/modprobe.d/blacklist-nvidia.conf
has the following contents or else create it with this contentsThis is required to stop system from loading nvidia drivers automatically before calling
optirun
and foroptirun
to unload nvidia drivers after exitingblacklist nvidia blacklist nvidia-drm blacklist nvidia-modeset alias nvidia-drm off alias nvidia-modeset off
also ensure that the line
alias nvidia off
is not present. If you haven't changed anything after the installation, this should be set directly by theprime-select
command. -
Ensure that the file
/etc/modprobe.d/nvidia-graphics=drivers.conf
has the following contents or else create it with this contents.This is required to stop system from loading
nouveau
drivers automatically.blacklist nouveau blacklist lbm-nouveau alias nouveau off alias lbm-nouveau off
If you haven't changed anything after the installation, this should be set directly during installation of nvidia-driver-390 package.
-
Ensure that the
GRUB_CMDLINE_LINUX_DEFAULT
variable in grub config/etc/defualt/grub
has these kernel parameters (and ensure thatnvidia-drm.modeset=1
kernel parameter isn't there in it)GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.runpm=0"
If you haven't changed anything after the installation, this should be set directly by the
prime-select
command. -
Disable
nvidia-fallback.service
using this command or else this service loads thenouveau
driver whennvidia
fails.systemctl disable nvidia-fallback.service
-
Add this line to
/etc/environment
for applications with 3D rendering to work__GLVND_DISALLOW_PATCHING=1
-
Update initramfs and grub using these command to update the blacklist driver details
sudo update-initramfs -u -k all sudo update-grub
-
Now reboot and ensure that everything is working fine by running (you need to install
mesa-utils
to run glxheads)optirun glxheads optirun nvidia-smi
-
Install Nvidia CUDA Toolkit now with this command.
sudo apt install nvidia-cuda-toolkit
Last active
May 22, 2023 20:47
-
-
Save pavan71198/763bbc469f16a52db7225144474a60cd to your computer and use it in GitHub Desktop.
Installing Bumblebee + Nvidia drivers + Nvidia CUDA Toolkit in Ubuntu 18.04 LTS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment