Have to say that Ubuntu installed on the Nvidia drive pits is really much more!!!
Originally installed before, from the graphics card driver to Cuda to CUDNN to go no problem, has been pushed to the graphics card driver update, my environment all broken, in order to learn, I put this solution to make a record:
First, reinstall the drive times: Error bad return status for module build on kernel
This is because the version of GCC was dropped from 5.4 (the default GCC version of ubuntu16.4) to 4.8 during the last Cuda installation, resulting in an error during the compilation process.
Workaround:
Because I have two GCC versions here, so just replace it, and if you don't, then the next one.
A, direct download of the lower version of the GCC, g++ replacement
ubuntu16.04 the GCC version installed by default is gcc-5.4, (available with GCC--version Viewing) may sometimes require a lower version, so we'll install gcc-4.8.5
sudo apt-get install-y gcc-4.8 g++-4.8 sudo update-alternatives--INSTALL/USR/BIN/GCC gcc/usr/bin/gcc-4.8 sudo update-alternatives--install/usr/bin/g++ g++/usr/bin/g ++-4.8 /usr/bin sudo cp gcc gcc_backup sudo cp g+ + g++ _backup sudo rm gcc g+ s gcc-4.8 gcc -S g++-4.8 g+ +
This again with GCC--version view is 4.8.5, if you want to switch to the default version of the system:
sudo rm gcc g++ -S gcc-5 gcc -S g++-5 g++
Reference:
based on UBUNTU16.04 's GeForce GTX 1080 drivers, the problem encountered and the solution to the response
Ubuntu16.04 + cuda8.0 + GTX1080 + matlab14.04a + Opencv3.0 + Caffe Installation Tutorial
Ubuntu16.04 Installing NVIDIA graphics driver +cuda8.0+cudnn6.0
Ubuntu 16.4 Install 1050ti graphics driver problems and solutions