问题遇到的现象和发生背景
pytorch一直可以使用cuda进行训练,但是重启了一次电脑,系统(Ubuntu 20.04.3 LTS)提示有更新,所以做了一下更新,重启之后就识别不到cuda了。
问题相关代码,请勿粘贴截图
import torch
flag = torch.cuda.is_available()
print(flag)
运行结果及报错内容
False
/home/suned/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/cuda/init.py:80: UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at /opt/conda/conda-bld/pytorch_1639180544224/work/c10/cuda/CUDAFunctions.cpp:112.)
return torch._C._cuda_getDeviceCount() > 0
我的解答思路和尝试过的方法
重装了cuda,依然返回找不到。
nvid-smi返回结果
nvcc --version返回结果
我想要达到的结果
请问这个问题改如何解决,搞了一天半了,严重影响进度啊。