cudaGetDevice() failed. Status:cudaGetErrorString symbol not found.

cudaGetDevice() failed. Status:cudaGetErrorString symbol not found.

使用conda 安装 tensorflow-gpu2.0.0 时,conda会自动安装对应版本的cuda和cudnn。但是在使用时报错。

InternalError: cudaGetDevice() failed. Status: cudaGetErrorString symbol not found.

该错误其实是因为缺少了dll文件 cudart64_100.dll(不同版本缺的可能不一样)。

[I 19:39:43.095 NotebookApp] Replaying 3 buffered messages
2020-08-25 19:39:45.615573: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found

实际这个dll文件conda下载在了 Anaconda3\envs\对应虚拟环境名\Library\bin 目录(如果是安装在虚拟环境中的话)。也许这个目录没有配环境变量的原因导致检查不到?

  1. 给这个目录配环境变量(没试过)
  2. 将该dll复制到 C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common 目录下 (这个好使)
D:\anaconda3\envs\tensorflow-gpu\python.exe "E:\pythonProject\DDPG based Implentation\test.py" 2025-03-11 20:35:03.752771: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2025-03-11 20:35:05.432806: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll 2025-03-11 20:35:05.469185: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: name: NVIDIA GeForce RTX 3060 Laptop GPU major: 8 minor: 6 memoryClockRate(GHz): 1.282 pciBusID: 0000:01:00.0 2025-03-11 20:35:05.469426: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check. 2025-03-11 20:35:05.469602: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0 2025-03-11 20:35:05.470016: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2025-03-11 20:35:05.472328: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: name: NVIDIA GeForce RTX 3060 Laptop GPU major: 8 minor: 6 memoryClockRate(GHz): 1.282 pciBusID: 0000:01:00.0 2025-03-11 20:35:05.472592: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check. 2025-03-11 20:35:05.472764: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0 Traceback (most recent call last): File "E:\pythonProject\DDPG based Implentation\test.py", line 3, in <module> sess = tf.compat.v1.Session() File "D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 1585, in __init__ super(Session, self).__init__(target, graph, config=config) File "D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow_core\python\client\session.py", line 699, in __init__ self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts) tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: cudaGetErrorString symbol not found.
最新发布
03-12
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值