user77540
user77540

Reputation: 1

How to add the path of CUDA compiler in CMake under WSL?

I am using Ubuntu on Windows (in WSL), I have CMake 3.10.1 and CUDA Toolkit 9.0. When I run

cmake ..

I got this error:

CMake Error at CMakeLists.txt:5 (project):
  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!
See also "/mnt/d/Open3D-PointNet2-Semantic3D-master/tf_ops/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/Open3D-PointNet2-Semantic3D-master/tf_ops/build/CMakeFiles/CMakeError.log".

Is it possible to link CUDA and CMake in WSL and how can I add the path to CUDA?

Upvotes: 0

Views: 7373

Answers (1)

Oblivion
Oblivion

Reputation: 7374

You can use:

cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.1 ..

Just change the path to where you installed


cuda can be installed on WSL with commands:

sudo apt-get install nvidia-cuda-toolkit

cmake then can find the path for the build. But the executable can not be ran on the WSL because Nvidia doesn't support yet.

Upvotes: 3

Related Questions