Pytorch和Cuda问题: www.example.com _available()返回false

fcwjkofz  于 2023-04-30  发布在  其他
关注(0)|答案(1)|浏览(143)

我正在尝试使用GPU训练深度学习模型,但只有CPU在使用。我调用cuda is available函数,返回false。下面是我的python环境的详细信息。

(base) C:\Windows\System32>python -m torch.utils.collect_env
Collecting environment information...
PyTorch version: 2.0.0
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Home
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.9 | packaged by Anaconda, Inc. | (main, Mar  1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22621-SP0
Is CUDA available: False
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4070 Laptop GPU
Nvidia driver version: 531.61
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=2600
DeviceID=CPU0
Family=207

L2CacheSize=4096
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=2600
Name=13th Gen Intel(R) Core(TM) i9-13900H
ProcessorType=3
Revision=

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.5
[pip3] numpydoc==1.5.0
[pip3] pytorch-lightning==2.0.1.post0
[pip3] torch==2.0.0
[pip3] torchaudio==2.0.1+cu118
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.15.1
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               11.3.1               h59b6b97_2
[conda] mkl                       2021.4.0           haa95532_640
[conda] mkl-service               2.4.0           py310h2bbff1b_0
[conda] mkl_fft                   1.3.1           py310ha0764ea_0
[conda] mkl_random                1.2.2           py310h4ed8f06_0
[conda] numpy                     1.23.5          py310h60c9a35_0
[conda] numpy-base                1.23.5          py310h04254f7_0
[conda] numpydoc                  1.5.0           py310haa95532_0
[conda] pytorch                   2.0.0              py3.10_cpu_0    pytorch
[conda] pytorch-cuda              11.8                 h24eeafa_3    pytorch
[conda] pytorch-lightning         2.0.1.post0              pypi_0    pypi
[conda] pytorch-mutex             1.0                         cpu    pytorch
[conda] torch                     2.0.0                    pypi_0    pypi
[conda] torchaudio                2.0.1+cu118              pypi_0    pypi
[conda] torchmetrics              0.11.4                   pypi_0    pypi
[conda] torchvision               0.15.1                   pypi_0    pypi

我最初从nvidia下载了Cuda 12,并读到这个问题可能是由于不支持较新版本的Cuda造成的。所以我下载了 Torch 和康达使用

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

它没有解决问题。

vh0rcniy

vh0rcniy1#

从你的环境中可以看出:CUDA used to build PyTorch: Could not collect
在检查Pytorch的网站后,似乎只有CUDA 11。支持7和11.8。卸载CUDA 12,下载并安装11。7 / 11.8,Conda uninstall pytorch torchvision torchaudio pytorch-cuda卸载Pytroch。使用匹配的CUDA版本再次安装它,应该可以解决您的问题。

相关问题