How to use cuda in ubantu 20.04?

Hello there,
I have recently change my os to ubantu 20.04. Installed Anaconda, and then in an environment using spyder, I have successfully installed pytorch in same, now after execulting following command:


The result is


I have graphic card in my laptop.
Can anybody please help with this.


The PyTorch binaries ship with their own CUDA dependencies and only a properly installed NVIDIA driver is needed.
Either your driver installation is broken or you’ve installed the CPU-only binaries.

Thank you @ptrblck
However my cuda is stable and I am installing using command available on official website. Sir, my cuda is 12.0 , and the available link for pytorch downloading is for 11.8. I think this is the problem. Is pytorch supporting currently for cuda 12?

No, this shouldn’t be a problem as your locally installed CUDA toolkit won’t be used unless you build PyTorch from source or a custom CUDA extension.
To run any script with the Pytorch binary you would only need a properly installed NVIDIA driver.
The PyTorch nightly binaries ship with CUDA 11.8 and 12.1 and you can select them in the install matrix.
What is python -m torch.utils.collect_env returning?