Install CuDNN on Ubuntu 16.04

本文详细介绍了如何在Ubuntu 16.04上安装CUDA和cuDNN的步骤。首先,从标准仓库安装CUDA,然后注册NVIDIA开发者账户并下载cuDNN。接着检查CUDA安装位置,并根据不同的安装方式复制必要的文件到指定目录,最后调整权限确保所有用户可以读取cuDNN库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

From: https://askubuntu.com/questions/767269/how-can-i-install-cudnn-on-ubuntu-16-04

129

 

Step 0: Install cuda from the standard repositories. (See How can I install CUDA on Ubuntu 16.04?)

Step 1: Register an nvidia developer account and download cudnn here (about 80 MB)

Step 2: Check where your cuda installation is. For the installation from the repository it is /usr/lib/... and /usr/include. Otherwise, it will be /usr/local/cuda/ or /usr/local/cuda-<version>. You can check it with which nvcc or ldconfig -p | grep cuda

Step 3: Copy the files:

Repository installation:

$ cd folder/extracted/contents
$ sudo cp -P include/cudnn.h /usr/include
$ sudo cp -P lib64/libcudnn* /usr/lib/x86_64-linux-gnu/
$ sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*

Runfile installation:

$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

For Tensorflow to find everything, I had to copy include/cudnn.h and the libraries in lib64/ to /usr/local/cuda-8.0/include and /usr/local/cuda-8.0/lib64 (using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody. – David Stutz

 

### CUDNN Version 7.4 Installation and Compatibility CUDNN (CUDA Deep Neural Network library) is a GPU-accelerated deep learning library developed by NVIDIA to enhance performance of neural network applications on CUDA-enabled GPUs. When installing CUDNN version 7.4, it's important to ensure that all dependencies are correctly configured. #### System Requirements To successfully install CUDNN 7.4, the system must meet specific requirements regarding operating systems and CUDA versions: - **Operating Systems**: Oracle Linux 7.4 supports various kernel packages as part of its update release[^2]. Similarly, Ubuntu 16.04 has been widely used alongside CUDA installations for machine learning frameworks such as TensorFlow or PyTorch. - **CUDA Versions**: For optimal compatibility, CUDNN 7.4 works best with CUDA 9.0 or later versions. In some configurations involving newer hardware like GTX 1080 Ti under Ubuntu 16.04, users have reported successful setups using both CUDA 10.0 combined with either CUDNN 7.4.2 or 7.6.4[^5]. #### Steps for Installing CUDNN 7.4 The process involves downloading appropriate binaries from NVIDIA’s official site based upon your architecture type—whether you're working within an environment utilizing `libcudnn.so.5` versus `.so.7`. Ensure these match exactly what was downloaded earlier before proceeding further into linking steps outlined below. ```bash sudo cp cuda/include/cudnn*.h /usr/local/cuda/include/ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/ sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn* ``` Additionally, modify `/etc/profile`, adding paths necessary so they can be recognized during compilation phases without manual intervention each time invoking commands related thereto via shell scripting methods shown hereafter : ```bash export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=<cudnn-install-path>:$LD_LIBRARY_PATH source ~/.bashrc ``` This ensures proper linkage between installed libraries including those provided through Anaconda distributions where potential conflicts may arise due HDF5 discrepancies which could otherwise impede functionality unless addressed accordingly per instructions given previously concerning downgrading said component specifically targeting Python environments managed thusly ^[3]^ . Finally verify everything functions properly executing command line utility designed explicitly towards monitoring status information pertinent graphical processing units present inside host machines running Linux-based kernels mentioned throughout this document while ensuring drivers themselves were indeed set up according manufacturer guidelines stipulated elsewhere hereinabove too^ [5]^ .
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值