CUDA: CUDNN安装测试

CUDNN安装测试


细节
  • 环境

    说明 备注
    CUDAToolkit 11.2.r11.2 A40 vGPU/CentOS-8.x
    cudnn-local-repo-rhel8-8.5.0.96-1.0-1.x86_64.rpm CUDNN8.5-CUDA11.7 官网下载
    rpm -Uvh安装 /var/cudnn-local-repo-rhel8-8.5.0.96 获得三个rpm: libcudnn8-8.5.0.96-1.cuda11.7.x86_64.rpm,libcudnn8-devel-8.5.0.96-1.cuda11.7.x86_64.rpm,libcudnn8-samples-8.5.0.96-1.cuda11.7.x86_64.rpm
  • 安装步骤

    
    #安装解压repo包
    rpm -Uvh cudnn-local-repo-rhel8-8.5.0.96-1.0-1.x86_64.rpm
    cd /var/cudnn-local-repo-rhel8-8.5.0.96
    mkdir tmp && cd tmp
    
    #将rpm解压到本地路径
    rpm2cpio ../libcudnn8-8.5.0.96-1.cuda11.7.x86_64.rpm | cpio -div
    rpm2cpio ../libcudnn8-devel-8.5.0.96-1.cuda11.7.x86_64.rpm | cpio -div
    rpm2cpio ../libcudnn8-samples-8.5.0.96-1.cuda11.7.x86_64.rpm | cpio -div 
    
    
    #将库(.so,.a)和软连接拷贝到CUDAToolkit对应目录下
    cp -d ./usr/lib64/* /usr/local/cuda/lib64/.
    
    #将头文件(.h)和软连接拷贝到CUDAToolkit对应目录下
    cp -d ./usr/include/* /usr/local/cuda/include/.
    
    ##-------------------------------------------
    cd /usr/local/cuda/lib64
    
    ##建立软连接: 旧版本兼容
    ln -s libcudnn.so.8 libcudnn.so
    
    ##---------------------------------------------
    
    cd /usr/local/cuda/include 
    
    
    ##建立软连接: 旧版本兼容
    ln -s cudnn_v8.h cudnn.h
    ln -s cudnn_version_v8.h cudnn_version.h
    ln -s cudnn_ops_train_v8.h cudnn_ops_train.h
    ln -s cudnn_ops_infer_v8.h cudnn_ops_infer.h
    ln -s cudnn_cnn_train_v8.h cudnn_cnn_train.h
    ln -s cudnn_cnn_infer_v8.h cudnn_cnn_infer.h
    ln -s cudnn_backend_v8.h cudnn_backend.h
    ln -s cudnn_adv_train_v8.h cudnn_adv_train.h
    ln -s cudnn_adv_infer_v8.h cudnn_adv_infer.h
    
    ##--------------------------------------------
    
    ##测试
    cd /var/cudnn-local-repo-rhel8-8.5.0.96/tmp/usr/src/cudnn_samples_v8/conv_sample
    make 
    ./conv_sample
    
    

你可能感兴趣的:(CUDA,深度学习,人工智能)