安装软件辛酸路程(Ubuntu20.4+anaconda+cuda+cudnn)

重装Ubuntu系统花费了两天时间,总结到的经验

下载想要的ubuntu系统版本,使用u盘做好工具
安装时不要纠结语言,反正英语连蒙带猜还是懂一些的,安装时最好要断网,要不然会下载一些语言包,安装速度很慢
重点是要清楚自己的电脑的磁盘情况,不像windows系统会分区成C,D,E,F等盘,ubuntu系统手动分区,用来存大量数据的磁盘需要挂载到/home目录下

接下来是安装中文输入法

安装anaconda+cuda+cudnn

安装anaconda linux x86版本的
然后使用anaconda-navigator命令打开navigator窗口,在上面创建新的环境tensorflow。在此环境下下载jupyter notebook和spyder 但是安装tensorflow-gpu时找不到
尝试在命令环境下 pip install TensorFlow-gpu keras
安装成功,tensorflow-gpu的版本为最新的2.3.0
也可以使用清华的镜像,下载超快
pip install tensorflow-gpu==2.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
然后着手安装cuda和cuDNN
在NVIDIA官网上下载了最新的11版本,安装成功后,发现并不是那回事,
按照下边网址重新安排了一遍
链接: link.
费尽九牛二虎之力安装完成后,在spyder运行程序后发现并没有使用gpu
console信息如下:

2020-07-30 09:12:03.153403: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64
2020-07-30 09:12:03.153432: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2020-07-30 09:12:03.995597: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1
2020-07-30 09:12:04.018967: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties: 
pciBusID: 0000:03:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.62GHz coreCount: 28 deviceMemorySize: 10.91GiB deviceMemoryBandwidth: 451.17GiB/s
2020-07-30 09:12:04.019068: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64
2020-07-30 09:12:04.020784: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcublas.so.10
2020-07-30 09:12:04.022431: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcufft.so.10
2020-07-30 09:12:04.022666: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcurand.so.10
2020-07-30 09:12:04.024489: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusolver.so.10
2020-07-30 09:12:04.025419: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcusparse.so.10
2020-07-30 09:12:04.025492: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64
2020-07-30 09:12:04.025501: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-07-30 09:12:04.026020: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-07-30 09:12:04.064465: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2394525000 Hz
2020-07-30 09:12:04.067332: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x559cc2159760 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-07-30 09:12:04.067368: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-07-30 09:12:04.070654: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-07-30 09:12:04.070681: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]      
2020-07-30 09:12:05.038150: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 4294967296 exceeds 10% of free system memory.
2020-07-30 09:12:05.482631: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 4294967296 exceeds 10% of free system memory.
2020-07-30 09:12:05.844817: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 4294967296 exceeds 10% of free system memory.

阅读下边网页后
https://blog.csdn.net/weixin_42362903/article/details/88580946
链接: link.
找到了build_info.py文件

build_info = {'cuda_version': '10.1', 'cudnn_version': '7', 'cuda_compute_capabilities': ['sm_35', 'sm_37', 'sm_52', 'sm_60', 'sm_61', 'compute_70'], 'cpu_compiler': '/usr/bin/gcc-5', 'is_rocm_build': False, 'is_cuda_build': True}

瞬间仆街

百度卸载cuda的资料
重新下载对应版本的cuda和cudnn就好了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值