Install NVIDIA CUDA Toolkit 12.1 on Ubuntu 21.10 / Debian 11 / Linux Mint 20.3
This is guide, howto install NVIDIA CUDA Toolkit 12.1 on Ubuntu 21.10, 21.04, 20.04.3 LTS, 18.04.6 LTS / Debian 11, 10, Sid / Linux Mint 20.3, 20.2, 20.1. I assume here that you have installed NVIDIA drivers successfully using my earlier Install NVIDIA 495.xx Drivers on Debian / Ubuntu / Linux Mint Guide. You will need NVIDIA 495.xx drivers. As always remember backup important files before doing anything!
Check video version of guide, Howto Install NVIDIA CUDA Toolkit 12.