conda-forge / nvcc-feedstock

A conda-smithy repository for nvcc.
BSD 3-Clause "New" or "Revised" License
12 stars 23 forks source link

CMake cannot verify NVCC compiler after rerender to 2019 Windows Image #76

Open carterbox opened 2 years ago

carterbox commented 2 years ago

Issue: After a feedstock was re-rendered to the 2019 Windows image, CMake can no longer verify NVCC as a working compiler. The version of the nvcc_win-64 is the same before and after the rerender. At first, I thought the problem was that the wrong host compiler was being assigned to NVCC because the version of the compiler linked to %CXX% did not match the host compiler reported by CMake, but then I also tried manually assigning NVCC and host compiler paths.

I really don't know what's going on.


Environment (conda list):

``` cmake: 3.21.3-h39d44d4_0 conda-forge ninja: 1.10.2-h2d74725_1 conda-forge nvcc_win-64: 11.2-h929061a_15 conda-forge ucrt: 10.0.20348.0-h57928b3_0 conda-forge vc: 14.2-hb210afc_5 conda-forge vs2015_runtime: 14.29.30037-h902a5da_5 conda-forge vs2017_win-64: 19.16.27038-h2e3bad8_2 conda-forge vswhere: 2.8.4-h57928b3_0 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info ```
leofang commented 2 years ago

cc: @jaimergp for vis

leofang commented 2 years ago

Looks like we have a growing number of people hitting this issue:

'cl.exe' is not recognized as an internal or external command,
operable program or batch file.

Sounds like vs2019 is to blame?

cc: @conda-forge/core @conda-forge/nvcc @conda-forge/cudatoolkit

leofang commented 2 years ago

I figured it out. We need to set --use-local-env flag to nvcc. Let me send a patch.

leofang commented 2 years ago

I could be wrong, but I suspect we never caught this bug in this feedstock because nvcc.bat is never used. From the Windows docs

The PATHEXT environment variable defines the list of file extensions checked by Windows NT when searching for an executable file. Like the PATH variable, semi-colons separate individual items in the PATHEXT variable. The default value of PATHEXT is .COM;.EXE;.BAT;.CMD.

So it might be possible that we've been using nvcc.exe from CTK instead of nvcc.bat from this feedstock all the time. UPDATE: No, this is not true, I checked.

leofang commented 2 years ago

https://github.com/conda-forge/nvcc-feedstock/pull/88#issuecomment-1172916314

hadim commented 2 years ago

I am not sure what is the status here but also got the cl.exe error at https://github.com/conda-forge/katago-feedstock/pull/1 and when trying to use your fix:

    set CUDNN_INCLUDE_DIR=%LIBRARY_PREFIX%\include
    for /f "tokens=* usebackq" %%f in (`where nvcc`) do (set "dummy=%%f" && call set "NVCC=%%dummy:\=\\%%")
    set "NVCC=%NVCC% --use-local-env"
    echo "nvcc is %NVCC%, CUDA path is %CUDA_PATH%"

then I got a Failed to find nvcc. error.

Any idea?

leofang commented 2 years ago

No, unfortunately. I don't really know what's going on. The patch #88 did not work...

jaimergp commented 2 years ago

Isuru's patch did work in this other PR, so I don't know :(

leofang commented 2 years ago

Interesting, @isuruf have you figured out what's missing in #88?