我无法让火焰燃烧器工作。
我安装了cuda和NVIDIA驱动程序
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
我使用以下命令安装了PyTorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
我正在使用以下代码片段测试PyTorch
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')
这说明PyTorch无法访问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
如果有什么不同,我在ubuntu 22.04
下运行6.1.15-060115-generic
内核
1条答案
按热度按时间ozxc1zmp1#
tldr -“已安装的cuda”并不意味着“cuda可以被卡使用”。
最终我不得不让nvidia-smi工作。最简单的方法是使用ubuntu附带的NVIDIA驱动程序。