L
L
LakeForest2021-05-24 13:25:50
Python
LakeForest, 2021-05-24 13:25:50

How to run a python application with CUDA on Windows 10 when it says device: 0?

Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
import torch
torch.cuda.is_available()
C:\Users\max\PycharmProjects\pythonProject\venv\lib\site-packages\torch\cuda\__init__.py:52: UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at  ..\c10\cuda\CUDAFunctions.cpp:109.)
  return torch._C._cuda_getDeviceCount() > 0
False

60ab7e26e741f098461968.png
60ab80f8c8e6e023118036.png
I tried to follow this instruction:
https://docs.nvidia.com/cuda/cuda-quick-start-guid...
Anyway, no matter what I run, it says device not found.

C:\Users\max>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:41:42_Pacific_Daylight_Time_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-05-24
@freeExec

But after all, nvidia-smi found some kind of gpu, it still won't work with cuda?

There is a GPU, but CUDA is not installed.
If it is, then smi will write its version in the top line.
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 456.71       Driver Version: 456.71       CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question