Is it required to set-up CUDA on PC before installing CUDA enabled pytorch?

You might be running into the misleading output of Windows’ task manager as explained here and here. Use nvidia-smi or select the right task manager view.

Hi,

I tried nvidia-smi in one terminal while running my code.
Below are the screenshot of what I found:
To my understanding GPU is not being used. Am I correct? If so, what can be the reason?


  • I got the below output when I run this: tensor([-0.5699], device=‘cuda:0’)

The binaries ship with the CUDA runtime for ease of use, as often users struggle to install the local CUDA toolkit with other libraries such as cuDNN and NCCL locally.
To use the GPU on your system in PyTorch you would thus only need to install the correct NVIDIA driver and one of the binary packages.

  • For this: How do I check if my machine has the correct NVIDIA driver and one of the binary packages.Can you just help me out please? I am quite new with this.

I also checked in the device manager: NVIDIA GeForce RTX 3050 Properties:
The below is the snapshot:
Does it mean I already have the drivers installed?

This means you can and are already using the GPU, which also means you have to have a properly installed NVIDIA driver.

Hi,

If so, when I run nvidia-smi while i run the code, it returns me No running processes found. I have attached a snapshot above.

Is it possible?

Yes, this might be another Windows issue with restricted permissions for nvidia-smi disallowing it to read other process information.

Does this mean I don’t have to do anything with the GPU? Everything is installed, and I am already using it. Although I can’t see the usage on Windows.

Yes, your is already working as mentioned before. If you want to see a higher GPU utilization, write a smoke test rerunning large matmuls.

Sorry, do you mean running this command matmuls on the terminal while running the code?