conda-forge / prismatic_split-feedstock

A conda-smithy repository for prismatic_split.
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Rebuild windows cuda 0 1 h40b5d7 #17

Closed ericpre closed 3 years ago

ericpre commented 3 years ago

Checklist

Other relevant information:

conda-forge-linter commented 3 years ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

jaimergp commented 3 years ago

Hm, it looks that

  1. CUDA installation is finishing successfully (link)
  2. But then nvcc cannot be found in PATH (link)
ericpre commented 3 years ago

Indeed, the log says:

(base) D:\bld\prismatic_split_1606423578869\work>if not defined CUDA_PATH (
for /F "usebackq tokens=*" %a in (`where nvcc.exe`) do set "CUDA_NVCC_EXECUTABLE=%a"   || goto :error  
 if "" == "" (
echo "Cannot determine CUDA_PATH: nvcc.exe not in PATH"  
 exit /b 1 
)  else (for /F "usebackq tokens=*" %a in (`python -c "from pathlib import Path; print(Path('').parents[1])"`) do set "CUDA_PATH=%a"   || goto :error ) 
) 
INFO: Could not find files for the given pattern(s).
"Cannot determine CUDA_PATH: nvcc.exe not in PATH"
jaimergp commented 3 years ago

Ah, I found the bug! It's a problem in our nvcc wrapper activation. I'll submit a PR so you will have a fix soon.

In the meantime, you can set the CUDA root dir to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version% or something similar.

jaimergp commented 3 years ago

Oh, yeah, this error. CMake expect forward slashes only and you need to quote the full thing. Use this var expansion:

set "CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%cuda_compiler_version%"
set "CUDA_HOME=%CUDA_HOME:\=/%"
jaimergp commented 3 years ago

I also realized you might need this! Sorry I didn't notice earlier:

https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html#inherited-environment-variables

Edit: I am not using that on openmm-feedstock and works fine so no clue :/

ericpre commented 3 years ago

OK, I will have a look at it tomorrow. Thanks!

jaimergp commented 3 years ago

We are going to try a different thing now...

  1. Get run_conda_forge_build_setup_win.bat and install_cuda.bat from this fork (part of this PR)
  2. Copy them to this PR, under recipe
  3. Re-render.
  4. 🤞 to see if it works!

What we are going to do is to temporarily replace the conda-forge-ci-setup parts for Windows and see if that fixes this behavior. This is working on OpenMM, so it should work here too!

Thanks for your patience!

ericpre commented 3 years ago

OK, let see if this works!

jaimergp commented 3 years ago

I am honestly puzzled this does not work. All I can see is that upstream uses a deprecated CMake module to find CUDA. OpenMM does use the recommended replacement, so maybe that's something to deal with upstream? Sorry I can't help more...

jaimergp commented 3 years ago

Hm, last build for OpenMM was using CMake 3.18, but this is using 3.19. Might be worth trying the change?

ericpre commented 3 years ago

The CUDA_HOME is now defined when calling the build script, so your last fixes are working:

cli is 1 , gui is 0 and gpu is 1
CUDA_HOME is C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2
CMake prefix path: D:\bld\prismatic_split_1606471570432\_h_env\Library

I am honestly puzzled this does not work. All I can see is that upstream uses a deprecated CMake module to find CUDA. OpenMM does use the recommended replacement, so maybe that's something to deal with upstream? Sorry I can't help more...

I agree that this may be the issue here and I will patch the cmake config file to update finding CUDA. I had a version of this recipe which was working to build locally on windows, where I set a few couple of environment variables and I should be able to work out something!

ericpre commented 3 years ago

Actually, I was wrong this morning: CUDA_HOME and CUDA_PATH are not set correctly in https://github.com/conda-forge/prismatic_split-feedstock/pull/17/commits/9d66dc0751e90c911e41d88247389190ab9879cd after using the local script. Setting CUDA_PATH manually works just fine.

Once the current build is finished, I will remove the local scripts to check if it makes any difference.

ericpre commented 3 years ago

To summarise and clarify the outcome of this PR:

We tried to use local script aiming to fix CUDA_HOME and CUDA_PATH which are supposedly set by nvcc package (in the activation script). The log of https://github.com/conda-forge/prismatic_split-feedstock/pull/17/commits/446325fb6f46d700b900f80b14bbcdfc9da7e6fc shows that this isn't working as expected in this PR, the following shows some output of the build script:

cli is 1 , gui is 0 and gpu is 1
CUDA_HOME: 
CUDA_PATH: 
CUDA_PATH (after): C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
CMake prefix path: D:\bld\prismatic_split_1606515158327\_h_env\Library

To confirm, the log of https://github.com/conda-forge/prismatic_split-feedstock/pull/17/commits/3c96112cd8e8b14be250b9d4eddff98dd50fc07e where the local script have been removed shows the same:

cli is 1 , gui is 0 and gpu is 1
CUDA_HOME: 
CUDA_PATH: 
CUDA_PATH (after): C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
CMake prefix path: D:\bld\prismatic_split_1606515158327\_h_env\Library

In both case, the CUDA_PATH have been set manually in the build script so that cmake can find CUDA and the build can work. In this case, there is no need to define CUDA_TOOLKIT_ROOT_DIR - this is still using the deprecated FindCUDA cmake module.

Thanks @jaimergp for getting building cuda on windows to work on conda-forge!

jaimergp commented 3 years ago

Thanks for the summary and glad you got it working!

I'll investigate why the env vars do not reach the build script in this feedstock. Might have to do with multi-outputs.