For some reason, using the latest NVIDIA driver (367.35 at time of writing) with the GTX 1070 meant that it wasn’t recognized by CUDA on my system. Instead, it was necessary to go back to 367.27. The file has to be manually downloaded from that link. To install, generally I find the easiest way to do it is to ssh in from another machine and enter:
sudo apt-get autoremove --purge nvidia-* sudo service lightdm stop sudo sh <path to driver>NVIDIA-Linux-x86_64-367.27.run
A reboot should then kick in the new driver. An issue with CUDA 7.5 (and 8RC I believe) is that it doesn’t like the gcc version that much when it comes to compiling the samples. The simple fix is to comment out the check line in /usr/local/cuda/include/host_config.h. Easiest way to find it it is to run the samples Makefile – the compiler will happily tell you where the error is coming from… Then just sudo edit the file and comment out the line indicated by the error message.