This tutorial was made in April 2023, and can be subjective to changes.
Open the NVIDIA Control Panel. Click System Information and check the driver version. It should be greater then 531.41, as this is the current driver version at the time of writing.
If you have an older version, goto https://www.nvidia.com/en-us/geforce/drivers/ and update your driver. There is an automatic and manual driver update possible if you know the videocard type.
Open a Windows terminal or the command prompt (cmd) and type python. The Windows app store will open automatically where you can install it from!
Goto the pytorch website https://pytorch.org/get-started/locally/ and select the necessary buttons using Pip. e.g.
C:\Users\demo> pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
And also install numpy:
C:\Users\demo> pip3 install numpy
Try this oneliner:
C:\Users\demo> python -c "import torch; print(torch.rand(2,3).cuda())"
If you get a tensor back, you are ready to go.
If you have more then 1 card installed, you can check the count:
C:\Users\demo> python -c "import torch; print(torch.cuda.device_count())"