ubuntu下安装cuda,cudnn

5 篇文章 0 订阅
4 篇文章 0 订阅

参考网址:http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile


下载runfile可以去官网根据gpu型号选择,这里不多说了;主要说说安装过程:

1、Disable the Nouveau drivers.

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

blacklist nouveau

options nouveau modeset=0

Regenerate the kernel initramfs:

$ sudo update-initramfs -u(用来更新内核,即删除内核后运行此命令会重新生成内核)

2、$ sudo sh cuda_<version>_linux.run --no-opengl-libs ‘–kernel-source-path’(‘'/usr/src'’)

3、The PATH variable needs to include /usr/local/cuda-8.0/bin

To add this path to the PATH variable:

   $ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}

In addition, when using the runfile installation method, the LD_LIBRARY_PATH variable needs to contain /usr/local/cuda-8.0/lib64 on a 64-bit system, or /usr/local/cuda-8.0/lib on a 32-bit system

  • To change the environment variables for 64-bit operating systems:

    $ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\
                             ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • To change the environment variables for 32-bit operating systems:

    $ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib\
                             ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
4、或者用vi /etc/profile添加全局变量

5、下载cudnn,我这里用的是5.1版本

下载后直接解压到指定路径下即可使用

sudo tar -xvf cudnn-8.0-linux-x64-v5.1.tgz  -C /usr/local/

6、出现Installing the NVIDIA display driver… 
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly. 
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.

解决办法两种:

1)、升级cuda,因为cuda8.0支持的事4.4的内核

参考网址:https://blog.csdn.net/lewif/article/details/79625151

2)、内核降级,适应cuda版本对应的内核即可

参考网址:https://blog.csdn.net/wangong/article/details/44699441(按照现有的内核搜索,可以删除现有内核,也可切换内核优先级)


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值