Support CUDA 12 + Windows#292
Conversation
|
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 ( |
| set "CUDA_PATH=" | ||
| set "CONDA_OVERRIDE_CUDA=%CUDA_VERSION%" | ||
| :: Export CONDA_OVERRIDE_CUDA to allow __cuda to be detected on CI systems without GPUs | ||
| echo set "CONDA_OVERRIDE_CUDA=%CONDA_OVERRIDE_CUDA%" >> "%CONDA_PREFIX%\etc\conda\activate.d\conda-forge-ci-setup-activate.bat" |
There was a problem hiding this comment.
Why do we need this, too, in the 12.x case? It also looks like it doesn't really do anything as it sets the variable to itself.
There was a problem hiding this comment.
I thought the comment is self-explanatory? Also, this treatment is copied from existing code (see line 133-134 below), I didn't reinvent any wheel 🙂
There was a problem hiding this comment.
I thought the comment is self-explanatory?
Not fully. Reading the source again, it makes sense. "Bake-in" instead of "Export" would have made it clear to me but probably not to everyone else. Happy to keep it as-is.
There was a problem hiding this comment.
Basically with how CUDA 11 is handled (both on Linux and Windows), most CUDA packages come from the system. There is a bunch of logic here to handle those CUDA 11 cases
With CUDA 12, we now have Conda packages and so don't need to use that logic. Eventually we could drop the CUDA 11 logic from here when we drop CUDA 11. In the interim, we just need to make sure we "do nothing" on CUDA 12
Edit: Though independent of CUDA version, we still have an issue when building on machines that don't have a GPU. Namely we need to convince Conda that it is ok to install CUDA dependent packages there. So we set this variable to tell Conda what CUDA version we support
| set "CUDA_PATH=" | ||
| set "CONDA_OVERRIDE_CUDA=%CUDA_VERSION%" | ||
| :: Export CONDA_OVERRIDE_CUDA to allow __cuda to be detected on CI systems without GPUs | ||
| echo set "CONDA_OVERRIDE_CUDA=%CONDA_OVERRIDE_CUDA%" >> "%CONDA_PREFIX%\etc\conda\activate.d\conda-forge-ci-setup-activate.bat" |
There was a problem hiding this comment.
I thought the comment is self-explanatory?
Not fully. Reading the source again, it makes sense. "Bake-in" instead of "Export" would have made it clear to me but probably not to everyone else. Happy to keep it as-is.
| if errorlevel 1 ( | ||
| echo Could not install CUDA | ||
| exit 1 | ||
| if "%CUDA_VERSION:~0,2%" == "12" ( |
There was a problem hiding this comment.
btw I tried to make this line more robust
| if "%CUDA_VERSION:~0,2%" == "12" ( | |
| for /f "delims=." %%f in ("%CUDA_VERSION%") do (set /a "CUDA_MAJOR_VERSION=%%f") | |
| if %CUDA_MAJOR_VERSION% geq 12 ( |
but for some reason the CI just hated the change (it worked fine locally), so I didn't use it here... Like John said, in the future we'll drop most of the complex logic here, so I hope this is OK.
|
Think we might need to update these lines as well Edit: Specifically looking at conda-forge-ci-setup-feedstock/recipe/run_conda_forge_build_setup_win.bat Lines 130 to 135 in fe41924 |
|
Yes, this block is only reachable by CUDA 11 and below (where |
|
Ah gotcha. May just be my fault for looking on my phone |
|
@conda-forge/core , any other thoughts on this change? |
|
Thanks all! 🙏 Let's give this a try and follow up on anything else after Note: Missed we didn't have the version number bump. So did that in commit ( 902a2be ) |
|
Thanks for catching the version bump, John. Sent a backport PR (#293). |
The logic here is to treat CUDA 12+ differently from previous CUDA versions. Specifically, for CUDA 12+ we
CUDA_PATHor updatePATHCONDA_OVERRIDE_CUDATested in conda-forge/cupy-feedstock#228.
cc: @conda-forge/cuda
Checklist
0(if the version changed)conda-smithy(Use the phrase@conda-forge-admin, please rerenderin a comment in this PR for automated rerendering)