Why torch.cuda.is_available() is False

Torch.cuda.is_Available (), which is used to see if your COMPUTER’s GPU can be called by PyTorch.

If False is returned, perform the following steps to rectify the fault.

1. Verify that your GPU supports CUDA (PyTorch calls are supported)

First, determine if your graphics card is an NVIDIA graphics card. You can view the graphics card model from the task manager or device Manager.

After that, go to PyTorch’s website and if it shows your video card model, your video card is supported to be called by PyTorch.

(Most NVIDIA graphics cards are supported.)

If you don’t have an NVIDIA graphics card, it doesn’t matter. CPU is sufficient, and as you will see later in the tutorial, CPU speeds are faster for small networks (sneakily)

2. Open the cli and enter nvidia-smi to view the Driver Version

The PyTorch 1.3 + CUDA 9.2 version installed in our tutorial requires a graphics driver greater than 396.26.

As shown in my screenshot, the driver version is 430.86, greater than 396.26.

If your driver version is less than 396.26, please upgrade your graphics driver with a variety of driver management software or software manager. Of course, it is recommended to go to the official website and download the latest driver.

3. Download the latest driver. Select the corresponding graphics card model, operating system, and other defaults on the official website. Notebooks.

After that, click search, download the latest driver, and install it.

4. Check the driver version. After the latest driver is installed, enter nvidia-smi on the CLI to check whether the latest driver is successfully installed.

5. Open the Anaconda Prompt, type Conda Activate PyTorch, and then enter Python to enter the Python environment.

In the Python environment, type import torch and then torch.cuda.is_available to see if True is returned.

Downloading PyTorch using Conda is too slow. What should I do?

1. (Metaphysical method) Download and install in the morning. I feel that the download speed is obviously faster in the morning.

Download these two files from Baidu Cloud at the top of this tutorial. (these two files are for pytorch1.3 + cuda9.2 + Windows)

Place these two downloaded files in the PKGS folder installed from Anaconda.

Then open the Anaconda Prompt and type Conda Activate PyTorch.

After that, enter the following command: Conda install –use-local pytorch- 1.3.0-py3.6_CUDa92_CUDNn7_0.tar. bz2 conda install –use-local Cudatoolkit-9.2-0.tar. bz2, you can use the downloaded package to install.


My home base

Learn these three principles of typography, and you can beat 80% of people’s typography

Have you ever thought about gamifying your life?

Motivate yourself with game ideas

Find fun or more efficient things, tools and tutorials