Skip to content

Instantly share code, notes, and snippets.

@darcwader
Last active June 20, 2019 06:23
Show Gist options
  • Select an option

  • Save darcwader/cd41bf61d00fd3a4ff4dfd22b51e4741 to your computer and use it in GitHub Desktop.

Select an option

Save darcwader/cd41bf61d00fd3a4ff4dfd22b51e4741 to your computer and use it in GitHub Desktop.
Install cuda into ubuntu16.04
#preference is install for scrip runfile local. dont use apt
sudo apt purge nvidia-396 nvidia-*
sudo /etc/init.d/sddm stop
sudo /etc/init.d/gdm stop
sudo killall Xorg
sudo apt purge xserver-xorg-video-nouveau*
sudo vim /etc/modprobe.d/blacklist-nouveau.conf
#blacklist nouveau
#options nouveau modeset=0
sudo sh ./cuda_9.2.148_396.37_linux.run
#to switch to text mode
sudo telinit 3
#bad idea, don't install from apt, always causes more headache than not.
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.2.88-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.2.88-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
# https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04
#https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04
#it turns out that is sometimes not enough.
#testing for gpu
python -c 'import fastai.utils; fastai.utils.show_install(1)'
alias gpu='python -c "import torch; print(torch.cuda.is_available())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment