Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enoki cannot build on VS2019 16.10 #118

Closed
andyyankai opened this issue Jun 24, 2021 · 12 comments
Closed

Enoki cannot build on VS2019 16.10 #118

andyyankai opened this issue Jun 24, 2021 · 12 comments

Comments

@andyyankai
Copy link

16.9 works pretty good. Just to notify here if anyone have any ideas. It seems Visual studio recent update have trouble with cuda related building 0.0

@Speierers
Copy link
Member

What is the compiler log?

@andyyankai
Copy link
Author

andyyankai commented Jul 1, 2021

The output might be too much I will just leave the top, others are saved in the file below
the input command are
cmake --build . --config Release && copy /y lib\Release\*.pyd lib\
cmake -G "Visual Studio 16 2019" -A x64 ..

image
log.txt

@Speierers
Copy link
Member

Interesting, looks like nvcc doesn't like the new standard library headers. It works fine on my machine. What's your nvcc version?

Here is mine:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89

@andyyankai
Copy link
Author

I am currently using cuda11.0 and cuda 11.4
It seems new visual studio (16.10) have trouble building many cuda related thing

@Speierers
Copy link
Member

It seems new visual studio (16.10) have trouble building many cuda related thing

Have you seen similar issues with the new version of MSVC on other projects online? Maybe this will be fixed in a future version of MSVC then?

@andyyankai
Copy link
Author

It seems new visual studio (16.10) have trouble building many cuda related thing

Have you seen similar issues with the new version of MSVC on other projects online? Maybe this will be fixed in a future version of MSVC then?

I do see some similar problems before. Haven't seen a solution so far. I think if this can't be fixed then just avoid updating 16.10 for now until some future solution appears. btw if I build enoki using 16.9 and link with my project which build using 16.10, it will also fail.

@andyyankai
Copy link
Author

@andyyankai
Copy link
Author

During the cmake building, I have this warning (not sure if this is important:
image

@Speierers
Copy link
Member

What's the spec of your machine?

@hesom
Copy link

hesom commented Jul 21, 2021

I solved my Windows build problems (also CUDA 11 and VS 16.10) by changing

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

to

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      #set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      #set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

in C:\Program Files\CMake\share\cmake-3.19\Modules\Compiler\NVIDIA-CUDA.cmake

Maybe that's helpful for you

@andyyankai
Copy link
Author

I solved my Windows build problems (also CUDA 11 and VS 16.10) by changing

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

to

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      #set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      #set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

in C:\Program Files\CMake\share\cmake-3.19\Modules\Compiler\NVIDIA-CUDA.cmake

Maybe that's helpful for you

Thanks! this indeed works!

@winterwindwang
Copy link

I solved my Windows build problems (also CUDA 11 and VS 16.10) by changing

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

to

if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
    if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
      #set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
      #set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
    else()
      set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
      set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
    endif()
endif()

in C:\Program Files\CMake\share\cmake-3.19\Modules\Compiler\NVIDIA-CUDA.cmake

Maybe that's helpful for you

That works for me!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants