-
Notifications
You must be signed in to change notification settings - Fork 2
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
auto-detect native CUDA arch #31
Conversation
casperdcl
commented
May 21, 2023
- auto-detect native CUDA arch (as per SWIG support #30 (comment))
- temporary work-around for https://gitlab.kitware.com/cmake/cmake/-/issues/24921
try: | ||
from miutil import cuinfo | ||
nvcc_arch_raw = map(cuinfo.compute_capability, range(cuinfo.num_devices())) | ||
nvcc_arches = {"%d%d" % i for i in nvcc_arch_raw if i >= (3, 5)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this error-prone hack (hardcoding min compute capability 3.5
rather than using proper tables123) is required due to https://gitlab.kitware.com/cmake/cmake/-/issues/24921
Footnotes
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 182 182
=========================================
Hits 182 182 ☔ View full report in Codecov by Sentry. |
3354fda
to
a133446
Compare
# work-around for https://gitlab.kitware.com/cmake/cmake/-/issues/24921 to | ||
# detect local GPU architectures | ||
# (inspired by ${CMAKE_ROOT}/Modules/CMakeTestCUDACompiler.cmake) | ||
message(WARNING "overriding CMAKE_CUDA_ARCHITECTURES") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not guaranteed to always exist:
${CMAKE_ROOT}/Modules/CMakeTestCUDACompiler.cmake
${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake
${CMAKE_CUDA_ARCHITECTURES_ALL}
also overriding potentially user-specified CMAKE_CUDA_ARCHITECTURES
isn't ideal