Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
GeForce GTX 1080, CUDA 8.0, Ubuntu 16.04, Caffe
Install cuda 8.0.
As the default gcc in Ubuntu 16.04 is very new, if you have compiling error similar to
#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
Try to comment the
#error line in file
#if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)
//#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
#endif /* __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 1) */
Update nvidia driver
You may need to remove the old driver version installed with cuda-8.0 and install a newer version of driver, if you have error similar to
modprobe: ERROR: could not insert 'nvidia_361_uvm': Invalid argument
sudo apt-get purge nvidia-*
do this based on your dkms status:
sudo dkms remove bbswitch/0.8 -k 4.4.0-31-generic
download the compatible driver (GTX 1080 in my case) from nvidia website and install it
reboot if the driver was not updated
compile the sample code and check if it works
Install prerequisities of Caffe
Because the gcc version is Ubuntu 16.04 is very new, If any prerequisity installed from
apt-get does not work, uninstall it, compile and install it by the default gcc (5.4) from the source code. The prerequisities that may have problems include: protobuf and
opencv. E.g. if you have protobuf error similar to
.build_release/lib/libcaffe.so: undefined reference to 'google::protobuf::io::CodedOutputStream::WriteVarint64ToArray(unsigned long long, unsigned char*)'
Try to uninstall the protobuf installed by
apt-get, the one installed by apt-get might have been compiled by a older gcc version, so its shared libraries may not be compatible with your default gcc:
sudo apt-get autoremove libprotobuf-dev protobuf-compiler
then compile the protobuf-2.5.0 from src and install it. Please config the default gcc (5.4 in my case) when you compile protobuf:
./configure --prefix=/your/path/ CC=/usr/bin/gcc