Uninstalling nvidia after installing it with cuda toolkit

I installed the CUDA-7.5 toolkit on Ubuntu 14.04 virtualbox, even though I did not have nvidia graphics card or an nvidia GPU (did this to get comfortable with the cuda environ on my system, before running it on an amazon GPU instance).

But it messed up my ubuntu virtualbox login screen - the login screen loops back to itself, and the ~/.xsession-errors says:
Xlib: extension “GLX” missing on display “:0”

Now, I want to uninstall what I did - first try uninstalling nvidia driver alone, and then the complete cuda toolkit if that doesn’t work.

The NVIDIA http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#runfile-uninstallation says:

4.6. Uninstallation
To uninstall the CUDA Toolkit, run the uninstallation script provided in the bin directory of the toolkit. By default, it is located in /usr/local/cuda-7.0/bin:
$ sudo /usr/local/cuda-7.0/bin/uninstall_cuda_7.0.pl

To uninstall the NVIDIA Driver, run nvidia-uninstall:
$ sudo /usr/bin/nvidia-uninstall

But I dont see those files in /usr/local/cuda-7.5/bin/ or in /usr/bin/

What should I do?

I used

sudo apt-get remove --purge nvidia-*

to remove all nvidia drivers and libraries, an I am left with just libcuda1-352 (a cuda runtime lib), when I run

dpkg -l | grep -i nvidia

. And, more importantly, I can now log back in to my X session.
My question now: Can I use this libcuda1-352 to compile a CPU-only C/C++ code through NVCC?

The login loop problem on Ubuntu has been discussed in other threads in this forum if you want to search for them.

Thanks, I did find quite a few login loop issues here, but could not find someone who intends to use cuda/nvcc without an nvidia graphics card.

As as aside, with so many people having this issue, it is a shame that nvidia does not have a single portal to collect some common solutions to this.

One solution, with or without a graphics card, is to not install the OpenGL libraries that come with the driver (and also make no modifications to xorg.conf). This has been discussed elsewhere and it would fix your issue as well.

Furthermore, since you have no need of the driver at all, having no GPU, you should simply not install the GPU driver, but just the rest of the CUDA toolkit. This can be done with careful choice of packages, but if I were doing it, I would simply use the runfile installer method that is described in the documentation:


and select “no” when prompted to install the driver. Note that backing out of a corrupted install is more difficult. The simplest solution is to start over with a clean load of the OS. Barring that, the installation guide linked above gives some hints ("Handling conflicting installation methods) about how to uninstall and/or undo an installation using the package manager method so that you can try a different installation using the runfile installer method.

Also, the driver has an extensive readme.