cuda 10 ubuntu 18.10


sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get dist-upgrade
# https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal
sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
# reboot
sudo apt-get install gcc-7 g++-7 gcc-7-multilib g++-7-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 20
sudo update-alternatives --config gcc; # select gcc-7
sudo update-alternatives --config g++; # select g++-7
cd /usr/local/cuda/samples/5_Simulations/nbody
sudo make