Setting up Windows for using CUDA 12.0

Wondering how to use GPU in Windows with CUDA 12.0 driver installed for deep learning model. PyTorch has released one version to configure CUDa 12 computers to use GPUs.  Following steps will get you done with setting up your python environment for using GPU for deep learning model building in PyTorch. 

Installing Anaconda

Create  a Virtual Environment

Activate Virtual Environment

Install PyTorch for Enabling GPU


conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia


This should install the PyTorch with  support for accelerated computation on CUDA 12.x enabled  NVIDIA RTX GPU.  

Checking if it is Working

import torch

import math

print(torch.cuda.is_available())

The outcome should True.