Trouble with PyTorch and CUDA Setup on GTX 1050 Ti

Hello!

I am facing issues while installing and using PyTorch with CUDA support on my computer. Here are some details about my system and the steps I have taken:

System Information:

  • Graphics Card: NVIDIA GeForce GTX 1050 Ti
  • NVIDIA Driver Version: 566.03
  • CUDA Version (from nvidia-smi): 12.7
  • CUDA Version (from nvcc): 11.7

Steps Taken:

  1. I installed Anaconda and created an environment named pytorch_env.
  2. I installed PyTorch, torchvision, and torchaudio using the command:
    conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
    
  3. I checked the installation by running Python and executing the following commands:
    import torch
    print(torch.__version__)           # PyTorch Version: 2.4.1
    print(torch.cuda.is_available())   # CUDA Availability: False
    

Problem:

Even though PyTorch is installed, CUDA availability returns False. I have checked the NVIDIA drivers and the installation of the CUDA Toolkit, but the issue persists.

Questions:

  1. How can I properly configure PyTorch to work with CUDA?
  2. Do I need to install a different version of PyTorch or NVIDIA drivers to resolve this issue?
  3. Are there any additional steps I could take to troubleshoot this problem?

I would appreciate any help or advice!