nvidia 驱动与CUDA 的安装

1、驱动

 将驱动源加入,更新

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
 查找最新的版本

  sudo apt search nvidia-

         最后数字代表版本号,越大说明越新

2、CUDA驱动

 在官网找到对应OS与CPU,

 https://developer.download.nvidia.com/compute/cuda/repos/

 下载对应的本地安装包

 sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb

         sudo apt-key add /var/cuda-repo-/7fa2af80.pub                   //解压完后自动生成本文件

         sudo apt-get update

 sudo apt-get install cuda


 基本上按照官网说明安装

  1. Install the repository meta-data, install GPG key, update the apt-get cache, and install CUDA:
    $ sudo dpkg --install cuda-repo--..deb
    $ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos///7fa2af80.pub
    $ sudo apt-get update
    $ sudo apt-get install cuda
  2. Reboot the system to load the NVIDIA drivers.
  3. Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables:
    $ export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
    $ export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64\
                             ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  4. Install a writable copy of the samples then build and run the nbody sample:
    $ cuda-install-samples-9.1.sh ~
    $ cd ~/NVIDIA_CUDA-9.1_Samples/5_Simulations/nbody
    $ make
    $ ./nbody

Read more at: http://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#ixzz55w5vZmAe


你可能感兴趣的:(UBUNTU,CUDA)