Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild for CUDA 12 #34

Conversation

regro-cf-autotick-bot
Copy link
Contributor

This PR has been triggered in an effort to update cuda120.

Notes and instructions for merging this PR:

  1. Please merge the PR only after the tests have passed.
  2. Feel free to push to the bot's branch to update this PR if needed.

Please note that if you close this PR we presume that the feedstock has been rebuilt, so if you are going to perform the rebuild yourself don't close this PR until the your rebuild has been merged.

If this PR was opened in error or needs to be updated please add the bot-rerun label to this PR. The bot will close this PR and schedule another one. If you do not have permissions to add this label, you can use the phrase @conda-forge-admin, please rerun bot in a PR comment to have the conda-forge-admin add it for you.

This PR was created by the regro-cf-autotick-bot. The regro-cf-autotick-bot is a service to automatically track the dependency graph, migrate packages, and propose package version updates for conda-forge. Feel free to drop us a line if there are any issues! This PR was generated by https://github.com/regro/cf-scripts/actions/runs/5140655335, please use this URL for debugging.

@conda-forge-webservices
Copy link
Contributor

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.

@traversaro
Copy link
Contributor

traversaro commented Jun 3, 2023

Failure on CUDA 12:

+GXX=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-g++
cuda_compiler_version=12.0 CUDA_HOME=
which: no cuda-gdb in (/home/conda/feedstock_root/build_artifacts/librealsense_1685598399374/_build_env/bin:/home/conda/feedstock_root/build_artifacts/librealsense_1685598399374/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin:/opt/conda/condabin:/home/conda/feedstock_root/build_artifacts/librealsense_1685598399374/_build_env/bin:/home/conda/feedstock_root/build_artifacts/librealsense_1685598399374/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin:/opt/conda/bin:/opt/conda/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/conda/bin)
Cannot determine CUDA_HOME: cuda-gdb not in PATH
/home/conda/feedstock_root/build_artifacts/librealsense_1685598399374/work/conda_build.sh: line 25: return: can only `return' from a function or sourced script

@jakirkham
Copy link
Member

jakirkham commented Jun 3, 2023

IIUC this is due to this detection logic

# Enable CUDA support
if [[ ! -z "${cuda_compiler_version+x}" && "${cuda_compiler_version}" != "None" ]]
then
if [[ -z "${CUDA_HOME+x}" ]]
then
echo "cuda_compiler_version=${cuda_compiler_version} CUDA_HOME=$CUDA_HOME"
CUDA_GDB_EXECUTABLE=$(which cuda-gdb || exit 0)
if [[ -n "$CUDA_GDB_EXECUTABLE" ]]
then
CUDA_HOME=$(dirname $(dirname $CUDA_GDB_EXECUTABLE))
else
echo "Cannot determine CUDA_HOME: cuda-gdb not in PATH"
return 1
fi
fi
CMAKE_ARGS="${CMAKE_ARGS} -DBUILD_WITH_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME} -DCMAKE_LIBRARY_PATH=${CUDA_HOME}/lib64/stubs"
else
CMAKE_ARGS="${CMAKE_ARGS} -DBUILD_WITH_CUDA=OFF"
fi

In particular this line

CUDA_GDB_EXECUTABLE=$(which cuda-gdb || exit 0)

This works in the CUDA 11 case as nvidia/cuda-based Docker images are used, which have all the build tools in the container

However in CUDA 12, typical conda-forge Docker images are used. The CTK is shipped as Conda packages ( conda-forge/staged-recipes#21382 ). So users can just list what packages they need. This allows greater customization and flexibility, but comes with the cost of some additional maintenance effort. More details and discussion in issue ( conda-forge/conda-forge.github.io#1963 )

In this case would suggest moving the logic above under a CUDA 11 branch. The CUDA 12+ case can just use $PREFIX for headers & libraries and $BUILD_PREFIX for build tools (like nvcc)

Hope that helps. Happy to answer any other questions that come up

@traversaro
Copy link
Contributor

Thanks @jakirkham ! As soon as I am on the laptop I will try your solution.

@traversaro
Copy link
Contributor

Just for complete transparency, this was my first test with a CUDA-enabled build (see #19), so it is possible that I did something wrong and/or not necessary in the recipe.

@traversaro
Copy link
Contributor

Ok, following @jakirkham suggestion seems to be working fine, with the advantage that the recipe can be drastically simplified once we drop CUDA 11 support.

@traversaro traversaro added the automerge Merge the PR when CI passes label Jun 4, 2023
@github-actions github-actions bot merged commit 7851862 into conda-forge:main Jun 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2023

Hi! This is the friendly conda-forge automerge bot!

I considered the following status checks when analyzing this PR:

  • linter: passed
  • azure: passed

Thus the PR was passing and merged! Have a great day!

@regro-cf-autotick-bot regro-cf-autotick-bot deleted the rebuild-cuda120-0-1_hf8846d branch June 4, 2023 17:58
@jakirkham
Copy link
Member

Thanks Silvio! 🙏

Glad this is moving in the direction of being simpler to maintain 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the PR when CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants