ComputationalRadiationPhysics / cuda_memtest

Fork of CUDA GPU memtest :eyeglasses:
http://sourceforge.net/projects/cudagpumemtest
110 stars 31 forks source link

No CMAKE_CUDA_COMPILER could be found #45

Closed gmferise closed 11 months ago

gmferise commented 11 months ago
➜  build git:(dev) ✗ cmake -DCMAKE_CUDA_ARCHITECTURES=61 ..
-- The CXX compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:43 (enable_language):
  No CMAKE_CUDA_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!

I was able to fix this with the following addition to my command: cmake -E env CUDACXX=/usr/local/cuda/bin/nvcc cmake -DCMAKE_CUDA_ARCHITECTURES=61 ..

psychocoderHPC commented 11 months ago

It looks like nvcc was not within the environment variable PATH. Please run which nvcc on the terminal and post the output. Then please run nvcc --version too.

Good that you found a workaround but we should check what's wrong.

gmferise commented 11 months ago

Looks like it's working now without the cmake ENV addition.

I didn't have CUDA installed before this. When I installed it added /usr/local/cuda/bin to PATH via my bashrc, then reloaded my bashrc with the source command. My terminal's history confirms this. I would have to guess my PATH did not update anyways though, and now that my terminal is fresh it has.

We can call this one user error I suppose 😅