On windows11, nvcc cannot show the correct version of CUDA

Question:

The version I originally installed is 11.6. To match the tensorflow2.11.0, I had to install the v11.2 of CUDA, during which I first uinstall the newer version of CUDA(every thing about it) and then install the earlier version that is 11.2. However, after the atuomatic installation and correctly (I think so) configured system environment variables, the nvcc -V command still dispaly that the version of my CUDA is 11.6. I thought it may due to the downgrade, so I install the v11.7 version of CUDA, thinking it maybe right this time, well, it’s not. It still reminded that the current version is 11.6. Hope someone could help me out!

enter image description here
And the following img shows how I configure the system environment.
enter image description here
enter image description here
The default configuration didn’t work correctly either.
And my goal is to keep both version of CUDA so that I can switch between them when I need to do so.
Much appreciation!

Asked By: Steven Cao

||

Answers:

To answer my own question, things turned out that you have to add C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.x(depend on your own version) to the
path. Yes, that’s it, case closed. Don’t learn from me leaving the CUDA path outside…And nvcc -V does correctly show the CUDA version that you are currently using.

Answered By: Steven Cao