Skip to content

Conversation

@Jimver
Copy link

@Jimver Jimver commented Mar 26, 2021

I looked at the CI and it seems you use a bit outdated version of getting cuda in your cmakelists.txt

I now use find_package(CUDAToolkit) which was introduced in CMake 3.17, so I updated those to 3.17 as well, not sure if that impacts other stuff though. But the CI seems to run fine on my fork.

I also changed floor to floorf and ceil to ceilf, see: https://devtalk.blender.org/t/cuda-compile-error-windows-10/17886/2

@Haydnspass
Copy link
Collaborator

Hey @Jimver
really awesome that you are actually contributing! Thanks already for that.
Unfortunately, although the Job indicates green, CMAke fails in your job on windows with a broken CUDA compiler which is quite odd:

-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe - broken
-- Configuring incomplete, errors occurred!
See also "C:/Miniconda/envs/test/conda-bld/spline_1616761487310/work/python/build/temp.win-amd64-3.9/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Miniconda/envs/test/conda-bld/spline_1616761487310/work/python/build/temp.win-amd64-3.9/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):

@Haydnspass
Copy link
Collaborator

@Jimver It's quite strange, isn't it? I wonder if I made something weird in the CMakeLists or conda build that leads to this?
Any new insights?

@Jimver
Copy link
Author

Jimver commented Mar 28, 2021

Yeah I debugged it for a bit and managed to get the CMakeError.log as an artifact. See: https://github.com/TuragaLab/SplinePSF/suites/2359120187/artifacts/49944202

First part of the error log file:

Looking for a CUDA compiler failed with the following output:
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe - broken
CMake Error at C:/Miniconda/envs/test/conda-bld/spline_1616863076905/_build_env/Library/share/cmake-3.17/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Miniconda/envs/test/conda-bld/spline_1616863076905/work/python/build/temp.win-amd64-3.7/Release/CMakeFiles/CheckCUDA/CMakeFiles/CMakeTmp
    
    Run Build Command(s):C:/Miniconda/envs/test/conda-bld/spline_1616863076905/_build_env/Library/bin/ninja.exe cmTC_d1238 && [1/2] Building CUDA object CMakeFiles\cmTC_d1238.dir\main.cu.obj
    FAILED: CMakeFiles/cmTC_d1238.dir/main.cu.obj 
    cmd.exe /C "C:\PROGRA~1\NVIDIA~2\CUDA\v11.2\bin\nvcc.exe     -x cu -c main.cu -o CMakeFiles\cmTC_d1238.dir\main.cu.obj && C:\PROGRA~1\NVIDIA~2\CUDA\v11.2\bin\nvcc.exe     -x cu -M main.cu -MT CMakeFiles\cmTC_d1238.dir\main.cu.obj -o CMakeFiles\cmTC_d1238.dir\main.cu.obj.d"
    nvcc fatal   : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
    ninja: build stopped: subcommand failed.

So it seems to fail when calling vcvars64.bat which I belive is used to setup the dev environment on Windows.

Afterwards I set VSCMD_DEBUG to 3 which makes the vcvars64.bat print more information, but now the CMakeError.log is hundreds of lines so I haven't looked through it all yet. If you want to take a look it's in the artifact I linked above.

@Jimver
Copy link
Author

Jimver commented Mar 28, 2021

Ok after a bit of digging I found to following at line 2386-2396 in CMakeError.log:

...
C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\ext\roslyn.bat" 

C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>set __VSCMD_script_err_count=0 

C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>if "" NEQ "" goto :test 

C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>if "" NEQ "" goto :clean_env 
The input line is too long.
The syntax of the command is incorrect.
C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>set "PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\Roslyn;at"#$ C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat
nvcc fatal   : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
...

So it seems to call roslyn.bat. I found it on my local machine at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\ext\roslyn.bat and the first lines are:

set __VSCMD_script_err_count=0
if "%VSCMD_TEST%" NEQ "" goto :test
if "%VSCMD_ARG_CLEAN_ENV%" NEQ "" goto :clean_env

@REM ------------------------------------------------------------------------
:start

set "PATH=%VSINSTALLDIR%MSBuild\Current\bin\Roslyn;%PATH%"

goto :end
...

So my suspicion is that it fails at the following line:

set "PATH=%VSINSTALLDIR%MSBuild\Current\bin\Roslyn;%PATH%"

As in the error log it says this:

The input line is too long.
The syntax of the command is incorrect.
C:\Miniconda\envs\test\conda-bld\spline_1616863076905\work\python\build\temp.win-amd64-3.7\Release\CMakeFiles\3.17.0\CompilerIdCUDA>set "PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\Roslyn;at"#$ C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat

So maybe the PATH is becoming too large? Not sure if that is tunable.

@Haydnspass
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

2 participants