Coder Social home page Coder Social logo

Comments (13)

RussIvan avatar RussIvan commented on May 14, 2024 6

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]

from xmr-stak.

Antreasgr avatar Antreasgr commented on May 14, 2024 3

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.

from xmr-stak.

xschral avatar xschral commented on May 14, 2024 2

exactly my problems...

from xmr-stak.

psychocrypt avatar psychocrypt commented on May 14, 2024

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

from xmr-stak.

Antreasgr avatar Antreasgr commented on May 14, 2024

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

from xmr-stak.

psychocrypt avatar psychocrypt commented on May 14, 2024

from xmr-stak.

fireice-uk avatar fireice-uk commented on May 14, 2024

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

from xmr-stak.

fireice-uk avatar fireice-uk commented on May 14, 2024

CUDA header says

#if _MSC_VER < 1600 || _MSC_VER > 1911

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

from xmr-stak.

psychocrypt avatar psychocrypt commented on May 14, 2024

from xmr-stak.

fireice-uk avatar fireice-uk commented on May 14, 2024

@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.

from xmr-stak.

untra avatar untra commented on May 14, 2024

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

from xmr-stak.

iamveritas avatar iamveritas commented on May 14, 2024

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

from xmr-stak.

SabahKarim avatar SabahKarim commented on May 14, 2024

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..

from xmr-stak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.