Installing Pytorch cuda

windows 10

I have install Pytorch cuda by this …
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia

Now …

torch.cuda.is_available()
>>>False

But

torch.backends.cudnn.enabled
>>>True

Did the install logs show that the cudatoolkit was indeed installed or did you see a fallback to a CPU version?
If you’ve verified that the CUDA version was indeed picked, the error might be raised by a setup issue, i.e. your GPU cannot be detected.
Is nvidia-smi working properly and do you have a sufficiently new NVIDIA driver to run the CUDA11.1 runtime?

Please see the picture …

And also if i run a model in GPU , it show AssertionError: Torch not compiled with CUDA enabled

This could mean that a CPU-only package is already installed. Create a new virtual environment and reinstall PyTorch there (and check the install logs for cudatoolkit or the corresponding CUDA tag in the wheel name) or alternatively uninstall all PyTorch packages in your current environment and reinstall it again.