I suggest using conda to install cuda for version control your project.
Note that nvidia-smi lists the maximum CUDA version supported by the GPU driver, not the installed version of CUDA.
You can have a different version of CUDA installed in each conda environment, independently of the version supported by the GPU driver.
# Install the runtime only
condainstall-c"nvidia/label/cuda-11.8.0"cuda-toolkit
# Install the runtime and the development tools
condainstall-c"nvidia/label/cuda-11.8.0"cuda-toolkitcuda-libraries-devcuda-nvcc