added build support on Ampere - #2267
Open
kmuseth wants to merge 2 commits into
Open
Conversation
Signed-off-by: Ken Museth <ken.museth@gmail.com>
swahtz
reviewed
Aug 5, 2026
| target_link_libraries(ex_make_mgpu_nanovdb PRIVATE CUDA::curand) | ||
| # ex_make_mgpu_nanovdb uses TF32 WMMA which requires SM_80+ (Ampere or newer) | ||
| execute_process( | ||
| COMMAND bash -c "nvidia-smi --query-gpu=compute_cap --format=csv,noheader 2>/dev/null | sort -n | tail -1 | tr -d '.'" |
Contributor
There was a problem hiding this comment.
What if you're building on a machine that doesn't have a GPU and going to run it on an SM >=8.0 machine? Or are we assuming all examples are built/run on the same machine and/or they're not used as CI tests (which might have this behaviour)?
apradhana
reviewed
Aug 5, 2026
| target_link_libraries(ex_make_mgpu_nanovdb PRIVATE CUDA::curand) | ||
| # ex_make_mgpu_nanovdb uses TF32 WMMA which requires SM_80+ (Ampere or newer) | ||
| execute_process( | ||
| COMMAND bash -c "nvidia-smi --query-gpu=compute_cap --format=csv,noheader 2>/dev/null | sort -n | tail -1 | tr -d '.'" |
Contributor
There was a problem hiding this comment.
For Windows, assuming availability of bash is a hard requirement. Can we rely on something like CMAKE_CUDA_ARCHITECTURES (see, e.g. this) instead of probing the local machine with bash and nvidia-smi?
Contributor
There was a problem hiding this comment.
I asked Codex to scan CMAKE_CUDA_ARCHITECTURES and only add target if at least one architecture is >=80
if(CUDAToolkit_FOUND)
set(_nanovdb_has_sm80 OFF)
foreach(_cuda_arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
string(REGEX MATCH "^[0-9]+" _cuda_arch_number "${_cuda_arch}")
if(_cuda_arch_number GREATER_EQUAL 80)
set(_nanovdb_has_sm80 ON)
endif()
endforeach()
if(_nanovdb_has_sm80)
nanovdb_example(NAME "ex_make_mgpu_nanovdb") # requires cuRAND and SM_80+ (TF32 WMMA)
target_link_libraries(ex_make_mgpu_nanovdb PRIVATE CUDA::curand)
else()
message(STATUS "Skipping ex_make_mgpu_nanovdb: requires CUDA architecture 80 or newer")
endif()
unset(_nanovdb_has_sm80)
unset(_cuda_arch_number)
unset(_cuda_arch)
endif()
The unit test provides its own main() and uses only gtest (no gmock), so it needs just GTest::gtest. Listing gmock / gtest_main / gmock_main as well pulled libgtest.a and libgmock.a onto the link line multiple times, which the macOS (Xcode 15+) linker flags as "ignoring duplicate libraries". Linking only GTest::gtest removes the warning and also works against gtest-only GoogleTest installs (BUILD_GMOCK=OFF). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ex_make_mgpu_nanovdb uses TF32 WMMA which requires SM_80+ (Ampere or newer)
changed cmake to address this issue