CUDA unknown error

CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at /opt/conda/conda-bld/pytorch_1702400366987/work/c10/cuda/CUDAFunctions.cpp:108.)

RuntimeError: CUDA error: CUDA-capable device(s) is/are busy or unavailable
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

环境ubuntu 22.04系统,显卡驱动Driver Version: 535.171.04   CUDA Version: 12.2  ,cuda-toolkit版本520.61.05,为cuda 11.8,安装cuda 后,使用torch.cuda.is_available() 报上述错误,按照参考资料1的提示,安装了sudo apt install nvidia-modprobe,问题依旧,这个问题是系统刚开机时好用,过一段时间后就会报错

最后按照参考资料4里彻底卸载cuda然后重新安装cuda,再从参考资料2里下载cuda-samples,按照参考资料3的提示进行安装完毕后的测试,发现测试通过,但后续还会出现这样问题,即

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值