tensorflow 2 用不了gpu

nvcc -V 的cuda,显卡驱动,TensorFlow 2.2, py3.8; 好像和cuDNN无关?

可以用接近版本,比如10.1和10.0可以兼容。

 

tensorflow-gpu无法调用GPU的解决办法

 

 

 

 # nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

python 3.8.5

 cuDNN : cudnn-7.6.5

cudatoolkit-10.1

python3.8

 

但是,tensorflow官网上展示的cuda版本和tensorflow-gpu版本对照中,并没有cuda10.2的版本。

 

 

 

 

tensorflow-gpu 2.x版本的安装

以2.3.1版本举例

 

 

安装完后运行

 

 

会提示
Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found

首先,下载一个cudart64_101.dll
去万能dll网站下 dll
在这里插入图片描述

然后放在之前cuda10.2的安装位置里面
例如:E:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
在这里插入图片描述
红色是安装cuda10.2时候就有的了,蓝色是自己粘贴放进去的

然后运行

 

 

新错误提示:
cudaGetDevice() failed. Status: cudaGetErrorString symbol not found.

参考cudaGetDevice() failed. Status:cudaGetErrorString symbol not found.
参考2

C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

再粘贴一份放在PhysX里面
在这里插入图片描述

测试
在这里插入图片描述
ok了

 =======================================

1080ti  cuda TensorFlow 2

 

 (mydlenv) [root@ibiomed bin]# pip install -U tensorflow-gpu
Collecting tensorflow-gpu
  Downloading tensorflow-gpu-2.12.0.tar.gz (2.6 kB)
  Preparing metadata (setup.py) ... done
Collecting python_version>"3.7"
  Downloading python_version-0.0.2-py2.py3-none-any.whl (3.4 kB)
Building wheels for collected packages: tensorflow-gpu
  Building wheel for tensorflow-gpu (setup.py) ... error
  error: subprocess-exited-with-error
 
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ds6e676g/tensorflow-gpu_6b44979913b64644ac5696e58e62b20b/setup.py", line 37, in <module>
          raise Exception(TF_REMOVAL_WARNING)
      Exception:
      
      =========================================================
      The "tensorflow-gpu" package has been removed!
      
      Please install "tensorflow" instead.
      
      Other than the name, the two packages have been identical
      since TensorFlow 2.1, or roughly since Sep 2019. For more
      information, see: pypi.org/project/tensorflow-gpu
      =========================================================
      
      
      [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tensorflow-gpu
  Running setup.py clean for tensorflow-gpu
Failed to build tensorflow-gpu
Installing collected packages: python_version, tensorflow-gpu
  Running setup.py install for tensorflow-gpu ... error
  error: subprocess-exited-with-error
 
  × Running setup.py install for tensorflow-gpu did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ds6e676g/tensorflow-gpu_6b44979913b64644ac5696e58e62b20b/setup.py", line 37, in <module>
          raise Exception(TF_REMOVAL_WARNING)
      Exception:
      
      =========================================================
      The "tensorflow-gpu" package has been removed!
      
      Please install "tensorflow" instead.
      
      Other than the name, the two packages have been identical
      since TensorFlow 2.1, or roughly since Sep 2019. For more
      information, see: pypi.org/project/tensorflow-gpu
      =========================================================
      
      
      [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> tensorflow-gpu

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

 

 

2023-01-30 00:37:47.474698: I tensorflow/core/platform/cpu_feature_guard.cc:193] 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.
2023-01-30 00:37:47.631451: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 00:37:47.631479: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-01-30 00:37:48.302856: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 00:37:48.302952: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 00:37:48.302964: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.


https://www.cnblogs.com/BlueBlueSea/p/14781296.html [降级处理]

 

2023-01-30 11:15:42.015789: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2023-01-30 11:15:42.526051: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:04:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2023-01-30 11:15:42.526315: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] 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: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:42.526472: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10'; dlerror: libcublas.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:42.526605: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10'; dlerror: libcufft.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:42.526732: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10'; dlerror: libcurand.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:42.526872: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10'; dlerror: libcusolver.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:42.527007: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10'; dlerror: libcusparse.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:15:43.447776: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2023-01-30 11:15:43.447818: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] 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...

 

 卸载以前的TensorFlow,安装指定的2.2版本的;把代码错误提示的各种文件拷贝到(从10.1,拷贝到10.0文件夹)

 从这个地方开始:

(mydlenv) [root@ibiomed ~]# pip uninstall numpy
Found existing installation: numpy 1.24.1
Uninstalling numpy-1.24.1:
  Would remove:
    /home/software/anaconda3/envs/mydlenv/bin/f2py
    /home/software/anaconda3/envs/mydlenv/bin/f2py3
    /home/software/anaconda3/envs/mydlenv/bin/f2py3.8
    /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/numpy-1.24.1.dist-info/*
    /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/numpy.libs/libgfortran-040039e1.so.5.0.0
    /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/numpy.libs/libopenblas64_p-r0-15028c96.3.21.so
    /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/numpy.libs/libquadmath-96973f99.so.0.0.0
    /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/numpy/*
Proceed (Y/n)? Y
  Successfully uninstalled numpy-1.24.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(mydlenv) [root@ibiomed ~]# pip install numpy==1.23.4
Collecting numpy==1.23.4
  Downloading numpy-1.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 27.4 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-1.23.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(mydlenv) [root@ibiomed ~]# locate libcudart.so.10.1
/home/amam/py385/lib/libcudart.so.10.1
/home/amam/py385/lib/libcudart.so.10.1.243
/home/sqx/anaconda3/envs/py385/lib/libcudart.so.10.1
/home/sqx/anaconda3/envs/py385/lib/libcudart.so.10.1.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcudart.so.10.1
/home/sqx/anaconda3/envs/py385_2110/lib/libcudart.so.10.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcudart.so.10.1
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcudart.so.10.1.243
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcudart.so.10.1 /home/software/cuda-10.0/lib64/
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# locate libcublas.so.10
/home/amam/py385/lib/libcublas.so.10
/home/amam/py385/lib/libcublas.so.10.2.1.243
/home/software/cuda-10.0/lib64/libcublas.so.10.0
/home/software/cuda-10.0/lib64/libcublas.so.10.0.130
/home/sqx/anaconda3/envs/py385/lib/libcublas.so.10
/home/sqx/anaconda3/envs/py385/lib/libcublas.so.10.2.1.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcublas.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcublas.so.10.2.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10.2.1.243
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcublas.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcublas.so.10.0.130
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10 /home/software/cuda-10.0/lib64/
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# locate libcufft.so.10
/home/amam/py385/lib/libcufft.so.10
/home/amam/py385/lib/libcufft.so.10.1.1.243
/home/software/cuda-10.0/lib64/libcufft.so.10.0
/home/software/cuda-10.0/lib64/libcufft.so.10.0.145
/home/sqx/anaconda3/envs/NCResNetEnv/lib/libcufft.so.10
/home/sqx/anaconda3/envs/NCResNetEnv/lib/libcufft.so.10.4.1.152
/home/sqx/anaconda3/envs/py385/lib/libcufft.so.10
/home/sqx/anaconda3/envs/py385/lib/libcufft.so.10.1.1.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcufft.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcufft.so.10.1.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcufft.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcufft.so.10.1.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcufft.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcufft.so.10.2.1.245
/home/sqx/anaconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcufft.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcufft.so.10.4.1.152
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcufft.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcufft.so.10.0.145
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcufft.so.10 /home/software/cuda-10.0/lib64/
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# locate libcurand.so.10
/home/amam/py385/lib/libcurand.so.10
/home/amam/py385/lib/libcurand.so.10.1.1.243
/home/software/cuda-10.0/lib64/libcurand.so.10.0
/home/software/cuda-10.0/lib64/libcurand.so.10.0.130
/home/sqx/anaconda3/envs/NCResNetEnv/lib/libcurand.so.10
/home/sqx/anaconda3/envs/NCResNetEnv/lib/libcurand.so.10.2.3.152
/home/sqx/anaconda3/envs/py385/lib/libcurand.so.10
/home/sqx/anaconda3/envs/py385/lib/libcurand.so.10.1.1.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcurand.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcurand.so.10.1.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcurand.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcurand.so.10.1.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcurand.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcurand.so.10.2.1.245
/home/sqx/anaconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcurand.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcurand.so.10.2.3.152
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcurand.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcurand.so.10.0.130
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcurand.so.10 /home/software/cuda-10.0/lib64/
(mydlenv) [root@ibiomed ~]# locate libcusolver.so.10
/home/amam/py385/lib/libcusolver.so.10
/home/amam/py385/lib/libcusolver.so.10.2.0.243
/home/software/cuda-10.0/lib64/libcusolver.so.10.0
/home/software/cuda-10.0/lib64/libcusolver.so.10.0.130
/home/sqx/anaconda3/envs/py385/lib/libcusolver.so.10
/home/sqx/anaconda3/envs/py385/lib/libcusolver.so.10.2.0.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcusolver.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcusolver.so.10.2.0.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusolver.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusolver.so.10.2.0.243
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcusolver.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-11.0.3-h88f8997_11/lib/libcusolver.so.10.6.0.245
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcusolver.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcusolver.so.10.0.130
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusolver.so.10
cp: 在"/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusolver.so.10" 后缺少了要操作的目标文件
Try 'cp --help' for more information.
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusolver.so.10 /home/software/cuda-10.0/lib64/
(mydlenv) [root@ibiomed ~]# locate libcusparse.so.10
/home/amam/py385/lib/libcusparse.so.10
/home/amam/py385/lib/libcusparse.so.10.3.0.243
/home/software/cuda-10.0/lib64/libcusparse.so.10.0
/home/software/cuda-10.0/lib64/libcusparse.so.10.0.130
/home/sqx/anaconda3/envs/py385/lib/libcusparse.so.10
/home/sqx/anaconda3/envs/py385/lib/libcusparse.so.10.3.0.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcusparse.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcusparse.so.10.3.0.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusparse.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusparse.so.10.3.0.243
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcusparse.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcusparse.so.10.0.130
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusparse.so.10
cp: 在"/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusparse.so.10" 后缺少了要操作的目标文件
Try 'cp --help' for more information.
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcusparse.so.10 /home/software/cuda-10.0/lib64/
(mydlenv) [root@ibiomed ~]#

 

2023-01-30 11:27:48.195875: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2023-01-30 11:27:48.650219: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties:
pciBusID: 0000:04:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 10.92GiB deviceMemoryBandwidth: 451.17GiB/s
2023-01-30 11:27:48.650569: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2023-01-30 11:27:48.650967: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10'; dlerror: libcublasLt.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/software/cudnn/cuda/lib64::/home/software/cuda-10.0/lib64
2023-01-30 11:27:48.653798: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2023-01-30 11:27:48.654200: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2023-01-30 11:27:48.657422: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2023-01-30 11:27:48.659055: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2023-01-30 11:27:48.664359: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2023-01-30 11:27:48.664385: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] 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...

 

 (mydlenv) [root@ibiomed ~]# locate libcublas.so.10
/home/amam/py385/lib/libcublas.so.10
/home/amam/py385/lib/libcublas.so.10.2.1.243
/home/software/cuda-10.0/lib64/libcublas.so.10.0
/home/software/cuda-10.0/lib64/libcublas.so.10.0.130
/home/sqx/anaconda3/envs/py385/lib/libcublas.so.10
/home/sqx/anaconda3/envs/py385/lib/libcublas.so.10.2.1.243
/home/sqx/anaconda3/envs/py385_2110/lib/libcublas.so.10
/home/sqx/anaconda3/envs/py385_2110/lib/libcublas.so.10.2.1.243
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10.2.1.243
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcublas.so.10.0
/var/lib/docker/overlay2/b03237c81bcd061a125597d3848c7bcd4da7ea8b2e0fd8bd56e9b041b28ab29a/diff/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcublas.so.10.0.130
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10 /home/software/cuda-10.0/lib64/
cp:是否覆盖"/home/software/cuda-10.0/lib64/libcublas.so.10"? y
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10 /home/software/cuda-10.0/lib64/^C
您在 /var/spool/mail/root 中有邮件
(mydlenv) [root@ibiomed ~]# ls /home/software/cudnn/cuda/lib64
libcudnn.so  libcudnn.so.7  libcudnn.so.7.3.1  libcudnn_static.a
(mydlenv) [root@ibiomed ~]# cp /home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10 /home/software/cudnn/cuda/lib64/
(mydlenv) [root@ibiomed ~]#

(base) [root@ibiomed lib]# pwd
/home/sqx/anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib
您在 /var/spool/mail/root 中有新邮件
(base) [root@ibiomed lib]# ls libcub*
libcublasLt.so  libcublasLt.so.10  libcublasLt.so.10.2.1.243  libcublas.so  libcublas.so.10  libcublas.so.10.2.1.243
(base) [root@ibiomed lib]# cp libcub* /home/software/cuda-10.0/lib64/

以上复制各种10.1的文件到10.0目录中,最终可以用了。

 

 同样的问题:https://www.jb51.cc/faq/2759103.html

  1. 查找共享对象
  1. sudo find / -name 'libcudart.so*'
  2. /usr/lib/x86_64-linux-gnu/libcudart.so.10.1
  3. /usr/lib/x86_64-linux-gnu/libcudart.so
  1. 将文件夹添加到path,以便python找到它
  1. export PATH=/usr/lib/x86_64-linux-gnu${PATH:+:${PATH}}
  2. export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  1. 权限
  1. sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcuda*

 

 同样问题:

https://github.com/tensorflow/tensorflow/issues/44312

 

 

https://blog.csdn.net/aa2962985/article/details/122179440

 

posted @ 2023-02-02 22:36  emanlee  阅读(4614)  评论(0编辑  收藏  举报