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

Windows 10 with CUDA 9 compile errors #91

Closed
Antreasgr opened this issue Nov 5, 2017 · 13 comments
Closed

Windows 10 with CUDA 9 compile errors #91

Antreasgr opened this issue Nov 5, 2017 · 13 comments
Assignees
Labels

Comments

@Antreasgr
Copy link

I tried to compile on Windows 10 with Visual Studio 2017 and Cuda 9.0, and i am getting the following error:

Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/Release/xmrstak_cu da_backend_generated_cuda_core.cu.obj CMake Error at xmrstak_cuda_backend_generated_cuda_core.cu.obj.Release.cmake:219 (message): Error generating C:/Users/Antreas/xmr-stak/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/Release/xmrstak_cuda _backend_generated_cuda_core.cu.obj

The full logs running the CMake generation and compiling is in the attached file.
log.txt

@psychocrypt
Copy link
Collaborator

You used this cmake -G "Visual Studio 15 2017 Win64" CMake command but the documentation say cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 ..

Please follow exactly the WINDOWS compile guide https://github.com/fireice-uk/xmr-stak/blob/dev/doc/compile_Windows.md#compile

@psychocrypt psychocrypt self-assigned this Nov 5, 2017
@Antreasgr
Copy link
Author

Thank you very much, i downloaded and installed the v140 and you were right, it now compiles correctly.
Keep in mind that the latest version of Visual Studio 2017 by default ships with the windows toolkit v141.

I now get some runtime errors related to cuda_extra.cu file. If you want any help trying to build this with the 141 version i am willing to try it out and provide logs. Thank you again

@psychocrypt
Copy link
Collaborator

psychocrypt commented Nov 6, 2017 via email

@fireice-uk
Copy link
Owner

I also get this error. Fresh install of visual studio (v141) + cuda 9.0 fails.

This is the error message:

Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/Release/xmrstak_cuda_backend_generated_cuda_core.cu.obj CMake Error at xmrstak_cuda_backend_generated_cuda_core.cu.obj.Release.cmake:222 (message): Error generating C:/Users/MAIN/github/xmr-stak/build/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/Release/xmrstak_cuda_backend_generated_cuda_core.cu.obj

@fireice-uk
Copy link
Owner

CUDA header says

#if _MSC_VER < 1600 || _MSC_VER > 1911

So it isn't CUDA <-> VS incompatibility.

@Antreasgr
Copy link
Author

I have managed to build this and it seems to be a cmake issue.
Microsoft changed the default toolkit directory to a different scheme. The cmake variable CUDA_HOST_COMPILER is set to $(VCInstallDir)bin which is no longer correct. I have set this to a absolute path like:

set(CUDA_HOST_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX64/x64/cl.exe")
(note the forward slashes)

Finally i have set the --cl-version flag to nvcc compiler but i do not know if this is required:
list(APPEND CUDA_NVCC_FLAGS --cl-version=2017)

After those changes i have managed to successfully build this.

@psychocrypt
Copy link
Collaborator

psychocrypt commented Nov 7, 2017 via email

@fireice-uk
Copy link
Owner

@psychocrypt just noting here that setting it to an absolute path is a bad idea for a general usage - it will change with VS service packs.

psychocrypt added a commit to psychocrypt/xmr-stak that referenced this issue Nov 7, 2017
fix fireice-uk#91

- add CMake workaround for wrong host compiler for cuda
- update winows compile documentation
psychocrypt added a commit to psychocrypt/xmr-stak that referenced this issue Nov 7, 2017
fix fireice-uk#91

- add CMake workaround for wrong host compiler for cuda
- update winows compile documentation
@RussIvan
Copy link

Windows 7 Professional
Visual Studio 2017 (14.12.25827)
Cuda 9.1.85
cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 .. - OK
cmake --build . --config Release --target install - BAD
I did as You wrote above
Add CMakeLists.txt:

  • set(CUDA_HOST_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/HostX64/x64/cl.exe")
  • list(APPEND CUDA_NVCC_FLAGS --cl-version=2017)

I am getting the following error:
c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/host_config.h(135): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj]

I tried to change C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h
#if _MSC_VER < 1600 || _MSC_VER > 1911 => #if _MSC_VER < 1600

and got even more errors
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(504): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(505): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(506): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(538): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(1043): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(1558): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(2371): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\type_traits(2371): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xutility(543): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xtr1common(58): error : class "std::enable_if<<error-constant>, int>" has no member "type" [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xmemory0(390): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xmemory0(1002): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xmemory0(1322): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xstring(1693): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xtr1common(58): error : class "std::enable_if<<error-constant>, void>" has no member "type" [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\xutility(298): error : expression must have a constant value [C:\xmr-stak\build\xmrstak_cuda_backend.vcxproj]

@xschral
Copy link

xschral commented Dec 23, 2017

exactly my problems...

@untra
Copy link

untra commented Jan 11, 2018

❗️ The problem is Visual Studio 2017 15.5 failed to support CUDA 9
Or vice-versa. Either way the CUDA community is pretty pissed.

@iamveritas
Copy link

so is it possible to uninstall 141 toolset and install 140
would this fix this whole mess? did anyone tried?

gnagel pushed a commit to gnagel/xmr-stak that referenced this issue Mar 23, 2019
fix fireice-uk#91

- add CMake workaround for wrong host compiler for cuda
- update winows compile documentation
@SabahKarim
Copy link

so is it possible to uninstall 141 toolset and install 140
would this fix this whole mess? did anyone tried?

I am already using 14.0 but still getting the same error..

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

No branches or pull requests

8 participants