英文:
PyTorch: Error 803: system has unsupported display driver / cuda driver combination (CUDA 11.7, pytorch 1.13.1)
问题
无法使PyTorch正常工作。
我已经安装了cuda和NVIDIA驱动程序。
我使用以下命令安装了PyTorch
我正在使用以下代码片段测试PyTorch
它告诉我PyTorch无法访问CUDA。
如果这有任何区别,我正在运行ubuntu 22.04
下的6.1.15-060115-generic
内核。
英文:
I can't get PyTorch to work.
I have cuda and NVIDIA drivers installed
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:49:14_PDT_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
I have installed PyTorch using the following command
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
I am testing PyTorch using the following code snippet
import torch
print(torch.__version__)
print(torch.cuda.is_available())
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print('Using device:', device)
print()
#Additional Info when using cuda
if device.type == 'cuda':
print(torch.cuda.get_device_name(0))
print('Memory Usage:')
print('Allocated:', round(torch.cuda.memory_allocated(0)/1024**3,1), 'GB')
print('Cached: ', round(torch.cuda.memory_reserved(0)/1024**3,1), 'GB')
Which tells me PyTorch can't access CUDA
1.13.1
/home/vn/miniconda3/lib/python3.10/site-packages/torch/cuda/__init__.py:88: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount().
Did you run some cuda functions before calling NumCudaDevices() that might have already set an error?
Error 803: system has unsupported display driver / cuda driver combination
(Triggered internally at /opt/conda/conda-bld/pytorch_1670525541990/work/c10/cuda/CUDAFunctions.cpp:109.)
return torch._C._cuda_getDeviceCount() > 0
False
Using device: cpu
In case it makes any difference I am running
6.1.15-060115-generic
kernel under ubuntu 22.04
答案1
得分: 1
"installed cuda" 不代表 "显卡可以使用cuda。"
最终,我必须让nvidia-smi工作。
最简单的方法是使用随Ubuntu附带的NVIDIA驱动程序。
英文:
tldr - "installed cuda" doesn't mean "cuda can be used by the card."
ultimately I had to get nvidia-smi work.
the easiest way to do it was by using NVIDIA drivers that came with ubuntu.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论