pytorch / pytorch/vision

CUDA incorrectly parsed and invalid options forwarded by cmake

Open
#1,865 15 comments 0 reactions 1 assignee View on GitHub

@cpuhrsch is already working on this.

Since Feb 24, 2020.

module: c++ frontend topic: build windows
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.