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

Use CMAKE_CUDA_ARCHITECTURES value when ENV{CUDAARCHS} is set #659

Conversation

robertmaynard
Copy link
Contributor

Description

When a user has both the env variable and CMake command line cache value specified we need to ensure that the users cache value is used.

Checklist

@robertmaynard robertmaynard added bug Something isn't working non-breaking Introduces a non-breaking change 3 - Ready for Review Ready for review by team labels Jul 29, 2024
@robertmaynard robertmaynard requested a review from a team as a code owner July 29, 2024 14:08
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the choice of deprioritizing environment variables consistent with how CMake handles other variables? Do we need a documentation update to explain the order of preference?

@KyleFromNVIDIA
Copy link
Contributor

Is the choice of deprioritizing environment variables consistent with how CMake handles other variables?

Yes.

Do we need a documentation update to explain the order of preference?

Wouldn't be a bad idea.

@robertmaynard
Copy link
Contributor Author

Is the choice of deprioritizing environment variables consistent with how CMake handles other variables? Do we need a documentation update to explain the order of preference?

This aligns rapids-cmake with CMake's evaluation rules:

$ CUDAARCHS=80  cmake -S . -B build -DCMAKE_CUDA_ARCHITECTURES="75-real" && cat build/CMakeCache.txt | grep CMAKE_CUDA_ARCHITECTURES
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The CUDA compiler identification is NVIDIA 12.4.131
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- foo_lib: foo_lib-NOTFOUND
-- Configuring done (1.5s)
-- Generating done (0.0s)
-- Build files have been written to: ..../build
CMAKE_CUDA_ARCHITECTURES:STRING=75-real

@AyodeAwe AyodeAwe merged commit 844903d into rapidsai:branch-24.08 Jul 29, 2024
13 of 14 checks passed
@robertmaynard robertmaynard deleted the bug/correct_order_of_cmake_cuda_arch_evals branch July 29, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants