Check failed: cusolverDnCreate(&cusolver_dn_handle) == CUSOLVER_STATUS_SUCCESS Failed to create cuSo

报错信息:
Check failed: cusolverDnCreate(&cusolver_dn_handle) == CUSOLVER_STATUS_SUCCESS Failed to create cuSolverDN instance.

解决办法:
没有成功调用CUSOLVER库,很多解释是版本不匹配,还有GPU内存占满的情况,可以尝试以下办法:

import tensorflow as tf

# 列出所有可用的GPU设备
physical_devices = tf.config.list_physical_devices('GPU')

# 尝试设置第一个GPU的内存增长选项
try:
    tf.config.experimental.set_memory_growth(physical_devices[0], True)
except IndexError:
    print("No GPU found.")
except RuntimeError as e:
    # 如果设备无效或者已经初始化,则捕获异常
    print(f"Error setting memory growth: {e}")

但是我的问题查询很久发现是tensor无法成功调用GPU导致,主要是因为cudnn未正确安装导致库的缺失。可以自行测试GPU是否成功调用

import tensorflow as tf

print(tf.__version__)
print(tf.test.gpu_device_name())
print(tf.config.experimental.set_visible_devices)
print('GPU:', tf.config.list_physical_devices('GPU'))
print('CPU:', tf.config.list_physical_devices(device_type='CPU'))
print(tf.config.list_physical_devices('GPU'))
print(tf.test.is_gpu_available())
# 输出可用的GPU数量
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

可以下载加装cudnn解决该问题。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值