I had to install cuda 11.4 then it worked.
For this I followed CUDA Toolkit 11.4 Downloads but specified cuda 11.4 in the last command.
sudo apt-get -y install cuda-11.4
I had to install cuda 11.4 then it worked.
For this I followed CUDA Toolkit 11.4 Downloads but specified cuda 11.4 in the last command.
sudo apt-get -y install cuda-11.4