CUDA Toolkit

1. PRE-INSTALLATION ACTIONS

1. 1 Verify You Have a CUDA-Capable GPU
$ lspci | grep -i nvidia
1. 2 Verify You Have a Supported Version of Linux
$ uname -m && cat /etc/*release
1. 3 Verify the System Has gcc Installed
$ gcc --version
1. 4 Verify the System has the Correct Kernel Headers and Development Packages Installed
$ uname -r
1. 5 Choose an Installation Method

http://developer.nvidia.com/cuda-downloads

Select Target Platform

2. RUNFILE INSTALLATION

2. 1 Disabling Nouveau

The Nouveau drivers are loaded if the following command prints anything:

$ lsmod | grep nouveau

Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:

blacklist nouveau
options nouveau modeset=0

Regenerate the kevnel initramfs:

$ sudo update-initramfs -u

Restart the computer.

2. 2 Installation
$ sudo service lightdm stop
$ cd Downloads
$ sudo sh cuda_8.0.61_375.26_linux.run

If the GPU used for display is not an NVIDIA GPU, the NVIDIA openGL libraries should not be installed.

$ sudo service lightdm start

For non-standard systems, such as those with more than one GPU, it is recommended to manually edit the X server configuration file, /etc/X11/xorg.conf, like https://m.douban.com/note/262885853/.

Device Node Verification:
Check that the device files /dev/nvidia* exist and have the correct(0666) file permission. if these files do not exist, create them manually by using a startup script such as the one below:

#!/bin/bash

/sbin/modprobe nvidia

if [ "$?" -eq 0 ]; then
    # Count the number of NVIDIA controllers found.
    NVDEVS=`lspci | grep -i NVIDIA`
    N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
    NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`

    N=`expr $N3D + $NVGA - 1`
    for i in `seq 0 $N`; do
        mknod -m 666 /dev/nvidia$i c 195 $i
    done

    mknod -m 666 /dev/nvidiactl c 195 255

else
    exit 1
fi

/sbin/modprobe nvidia-uvm

if [ "$?" -eq 0 ]; then
    # Find out the major device number used by the nvidia-uvm driver
    D=`grep nvidia-uvm /proc/devices | awk '{print $1}'`

    mknod -m 666 /dev/nvidia-uvm c $D 0
else
    exit 1
fi
2. 3 Environment Setup
$ sudo vi /etc/profile

Insert the following contents at the last line:

export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

Restart the computer.
只安装驱动的时候:

sudo sh NVIDIA-Linux-x86_64-375.20.run -no-x-check -no-nouveau-check -no-opengl-files

3. Verify the Installation

3. 1 Verify the Driver Version
$ cat /proc/driver/nvidia/version
3. 2 Verify the version of the CUDA Toolkit
$ nvcc -V
3. 3 Compiling the Examples
$ cd NVIDIA_CUDA-8.0_Samples
$ make

The resulting binaries will be placed under ~/NVIDIA_CUDA-8.0_Samples/bin.

$ cd bin/x86_64/linux/release
$ ./deviceQuery
$ ./bandwidthTest

Notice

  • To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin.
  • To uninstall the NVIDIA Driver, run nvidia-uninstall.

Tips:
Ubuntu Packages Search

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值