内容纲要
问题
No CUDA GPUs are available
原因
解决方案
1、检查nvcc
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0
2、检查torch安装情况
python
import torch
torch.cuda.is_available()