在cmd中输入nvidia-smi。显示CUDA Version:12.3,所以只能下载小于等于12.3的版本。如下图:

进这个网址:https://developer.nvidia.com/cuda-toolkit-archive

选择一个版本下载。
选择完后之后这样选择:

最后点击下载即可,下载完后安装(安装过程中可能会出现没安装相应的VS配件,可以选择先忽略这个直接安装)
我这里安装的版本是11.8,默认安装到C:\Program Files\NVIDIA GPU Computing Toolkit
安装完成后,环境变量中会自动出现
path中有:

之后,打开cmd,输入nvcc -V
,结果如下,说明成功安装。
后续:安装Visual Studio相关配件
在这里进去:
最终进这个网址:
https://docs.nvidia.com/cuda/archive/11.8.0/cuda-installation-guide-microsoft-windows/index.html
看到下面这个表,这个对应的VS版本
下载完Visual Studio安装程序后,选择下图这个,其他的无所谓。选择完后,点击安装即可。