I am currently trying to get CUDA-8.0 to work on ubuntu 14.04 while previous versions of CUDA were already installed. This is a very careful balancing act, where the right steps need to be taken in the right order. Unfortunately I failed. This leaves me with undescriptive errors and no obvious way to solve them.
The standard way to solve these problems is of course: reinstall the OS and try again. However that has obvious disadvantages as well.

I need to remove anything remotely related to CUDA and nvidia to be able to retry installing CUDA-8.0. This includes any graphics drivers. However graphics drivers are potentially important for the workings of my OS (Ubuntu 14.04). How should I approach deleting nvidia drivers without bricking my computer?
The command I am hesitant to use is:

sudo apt-get remove --purge nvidia-*
  • Did you consider using the nouveau driver while you are replacing the Nvidia ones? – ubfan1 Mar 17 '17 at 15:35
  • I am afraid that this will give extra conflicts with the nvidia drivers, do you know how well nvidia works with nouveau? – dimpol Mar 17 '17 at 15:39
  • The question you should be asking is whether or not nouveau will work with your card for the brief period before installing nvidia drivers again. If it works in a live session chances are it will also be fine in the installed system. If not, just use nomodesetuntil the proprietary drivers are installed. And if you're going to reinstall consider first a newer release like 16.04 LTS. – user589808 Mar 17 '17 at 17:59

I spend some time working on a different computer, postponing switching GPU drivers. Then I came across this post:
Purging cuda and deleting any cuda files left in /usr/local/cuda, /usr/local/cuda-7-5 etc. and then reinstalling cuda-8.0 left me with the error:

Failed to initialize NVML: Driver/library version mismatch

This appeared to me as requiring me to uninstall the current driver and then install the correct driver. However as in the link, just using the 'nvidia-smi' command also gave this error. So just as in the link I tried restarting my computer (something I should do more often) and that worked!

I don't know whether restarting would have solved my problem earlier. But it was definitely part of the solution and I didn't have to do anything manually to the drivers.

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.