I want to compile pytorch v1.3.0 from source with specified CUDA version 9.0. However, even I set the CUDA_PATH and CUDA_HOME to /usr/local/cuda-9.0. It always tries to find cuda from the path /usr/local/cuda.
This might be tricky, e.g., if tools like nvidia-smi show a newer CUDA version…
You might want to try changing other environment variables like CUDA_BIN_PATH like the cmake docs state: FindCUDA — CMake 3.20.2 Documentation