I’ve been setting up CUDA and other tools for experimentation on my Kubuntu laptop (4.15.0-32-generic kernel). Given the complex interdependences, I want the option of reverting to the Nouveau driver in case I break my system and need to do some kind of rescue on bootup. I was previously able to do this, but have trouble doing this with the new driver.
BEFORE:
When I installed the Nvidia driver directly, I was able to switch back to the Nouveau driver by doing the following:
-
Disabling the nvidia files in /etc/modprobe.d that blacklisted the nouveau driver (I assume changing foo.conf to foo.NOconf is enough? Or do I need to get rid of the file completely?);
-
Creating a file to blacklist the nvidia driver:
blacklist nvidia
alias nvidia off
alias lbm-nvidia off
-
Creating an empty file in /etc/udev/rules.d/71-nvidia.rules to block the nvidia rules file;
-
Run “sudo update-initramfs -u”
-
Reboot.
Thereafter, I could confirm the driver was nouveau, and not nvidia, by running
lsmod | egrep ‘(nvid|nouv)’
And I could reverse the process to get back to the nvidia driver.
NOW:
I had difficulty getting CUDA to install and run. When I tried installing from the deb file, it complained about the version of the driver. Some online comments said CUDA is picky about the driver version. So I removed the driver as well as whatever CUDA stuff had been installed in the failed attempt. Then I reran the deb file (cuda-repo-ubuntu1710-9-2-local_9.2.148-1_amd64.deb) and let it install the driver that IT preferred (396.37). CUDA worked – sort of (sample programs like matrix multiply worked, but anything that tried to pop up a window crashed right away).
But now the procedure I used for disabling the nvidia driver no longer works. I end up with BOTH drivers running at the same time:
$ lsmod | egrep ‘(nvid|nouv)’
nouveau 1716224 0
mxm_wmi 16384 1 nouveau
ttm 106496 1 nouveau
nvidia_drm 40960 2
nvidia_modeset 1089536 1 nvidia_drm
i2c_algo_bit 16384 2 nouveau,i915
nvidia 14028800 76 nvidia_modeset
drm_kms_helper 172032 3 nouveau,i915,nvidia_drm
ipmi_msghandler 53248 2 nvidia,ipmi_devintf
drm 401408 8 nouveau,i915,ttm,nvidia_drm,drm_kms_helper
wmi 24576 5 wmi_bmof,intel_wmi_thunderbolt,mxm_wmi,nouveau,hp_wmi
video 45056 2 nouveau,i915
SO…
What additional steps do I need to do to block the Nvidia driver on bootup?