第一部分. 查看cuda 版本
cat /usr/local/cuda/version.txt
第二部分. 查看cudnn 版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
3. 进行 cudn的测试:
3.1 编译samples例子
进入到Samples安装目录,然后在该目录下终端输入make,等待十来分钟(根据硬件配置不同,时间会有差别)。
3.2 编译完成后测试
可以在Samples里面找到 bin/x86_64/linux/release/ 目录,并切换到该目录
运行 deviceQuery 程序,
sudo ./deviceQuery # 这个文件编译成功后才能成功执行
查看输出结果,重点关注最后一行,Pass表示通过测试
4. tensorflow中GPU的测试,python3版本:
import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
import tensorflow as tf
print('tensorflow version: %s \n' %(tf.__version__))
print('tensorflow path: %s \n' %(tf.__path__))
print("GPU Available: %s \n" %( tf.test.is_gpu_available()))
5. 版本对应关系查看
ref:https://www.tensorflow.org/install/source#tested_source_configurations
如果是 `conda` 安装的,但是发现引入不进去,怎么办呢?
export LD_LIBRARY_PATH=~/anaconda3/envs/{YourEnv}/lib/:${LD_LIBRARY_PATH}
Fix Nvidia Apt Repository Public Key Error - jdhao's digital space
W: GPG error: Index of /compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
E: The repository ‘Index of /compute/cuda/repos/ubuntu1804/x86_64 InRelease’ is no longer signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-key del 7fa2af80
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
[cuda和cudnn版本对应的tensorflow-gpu版本错误说明与排查](cuda和cudnn版本对应的tensorflow-gpu版本错误说明与排查_cuda cudnn对应关系_yeler082的博客-CSDN博客)