Skip to content

CUDA incorrectly parsed and invalid options forwarded by cmake #1865

Open
@fmigneault

Description

@fmigneault

I am trying to build the C++ API on Windows 10 with CUDA 10.1 for Visual Studio 2019.

Part of cmake seems to indicate that it uses CUDA 10.2, then counter indicates it uses CUDA 10.1
(I am targeting 10.1, all my env is configured to point to it)
Output from cmake:

  Environment variable CUDA_ROOT is set to:

    %DEVELOP%/cuda/cuda-10.1

  For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
  E:/develop/torch/torch-1.5.0a-source-20200208/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
  E:/develop/torch/torch-1.5.0a-source-20200208/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
  CMakeLists.txt:13 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Caffe2: CUDA detected: 10.2
Caffe2: CUDA nvcc is: E:/develop/cuda/cuda-10.1/bin/nvcc.exe
Caffe2: CUDA toolkit directory: E:/develop/cuda/cuda-10.1
Caffe2: Header version is: 10.1
CMake Warning (dev) at E:/develop/torch/torch-1.5.0a-source-20200208/share/cmake/Caffe2/public/cuda.cmake:106 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable CUDNN_ROOT is set to:

    E:/develop/cuda/cudnn-10.1

  Environment variable CUDNN_ROOT is set to:

    %DEVELOP%/cuda/cuda-10.1/../cudnn-10.1

Resulting Visual Studio 2019 solution doesn't have the proper options forwarded :
(for example, I should have compute_61;sm_61)

image

And although cmake seemed to indicate it correctly found my CUDA 10.1 in the end, it still points to CUDA 10.2 when trying to compile:

image

I have managed to compile https://github.com/pytorch/pytorch without issue using CUDA 10.1, so I really think this is not a ENV/config issue of CUDA, but a cmake parsing problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions