adaption to CUDA13/GCC13/ARM arch#2065
adaption to CUDA13/GCC13/ARM arch#2065pcastelovigo wants to merge 2 commits intoalicevision:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adapts the build system and GPU reporting code to better support building on newer toolchains (CUDA 13 / GCC 13) and ARM targets (e.g., NVIDIA DGX Spark), primarily by extending CUDA architecture/CC handling and working around a GCC 13 dependency compile issue.
Changes:
- Adds superbuild cache parameters for controlling CUDA architectures for dependencies and CUDA CC list for AliceVision.
- Updates CUDA compute capability defaults for CUDA 13 and removes use of a deprecated CUDA runtime field at compile time.
- Adjusts OpenMP option handling for AppleClang and adds an assimp/draco patch step for GCC 13.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/cmake/Dependencies.cmake |
Adds CUDA arch/CC configuration knobs, introduces GCC13 workaround patch for assimp’s bundled draco, tweaks superbuild configure flags. |
src/aliceVision/gpu/gpu.cpp |
Guards printing clockRate because it’s removed in CUDA 13. |
src/CMakeLists.txt |
Extends the default CUDA CC list for CUDA 13 (adds new architectures). |
CMakeLists.txt |
Changes how OpenMP default/disable behavior is expressed for AppleClang. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=generic | ||
| -DALICEVISION_ROOT=${ALICEVISION_ROOT} | ||
| -DALICEVISION_CUDA_CC_LIST=${AV_ALICEVISION_CUDA_CC_LIST} | ||
| -DALICEVISION_USE_ALEMBIC=ON |
There was a problem hiding this comment.
-DALICEVISION_CUDA_CC_LIST=${AV_ALICEVISION_CUDA_CC_LIST} is always passed and has two concrete problems:
- When
AV_ALICEVISION_CUDA_CC_LISTis empty, this sets the cache entry to empty and can break later logic insrc/CMakeLists.txtthat assumes at least one CC (e.g., choosing the last entry for JIT flags). - If the user provides multiple CCs (e.g.
90;120), the semicolon will be treated as a list separator in CMake argument lists, splitting the-D...into multiple arguments and breaking the configure command.
Only add this-Dargument when non-empty, and pass it as a single escaped:STRINGvalue so semicolons survive intact.
| # GCC 13 requires explicit <cstdint> include in draco (bundled with assimp 5.2.5) | ||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13") | ||
| set(ASSIMP_PATCH_COMMAND | ||
| PATCH_COMMAND sed -i "s|#include <vector>|#include <vector>\\n#include <cstdint>|" <SOURCE_DIR>/contrib/draco/src/draco/io/file_utils.h | ||
| ) |
There was a problem hiding this comment.
The PATCH_COMMAND sed -i ... is not portable across platforms (BSD sed on macOS requires -i '', and some environments may not have GNU sed). Consider using a CMake-script patch step (e.g., PATCH_COMMAND ${CMAKE_COMMAND} -P ...) or a patch file applied via cmake -E/patch so the superbuild works consistently on non-Linux systems that may still use GCC 13.
| if (CUDA_VERSION_MAJOR VERSION_GREATER_EQUAL 13) | ||
| set(ALICEVISION_CUDA_CC_LIST_BASIC 50 52 60 61 62 70 72 75 80 86 87 89 90 100 120) | ||
| elseif (CUDA_VERSION_MAJOR VERSION_GREATER_EQUAL 12) |
There was a problem hiding this comment.
With CUDA 13 you add CC values 100 and 120, but the build later uses list(SORT ALICEVISION_CUDA_CC_LIST) (string sort) and then picks the last element as the highest CC for JIT compilation. String sorting will mis-order 3-digit CCs (e.g., 90 sorts after 120), causing the wrong "highest" CC to be selected. Sort using natural/numeric ordering (e.g., list(SORT ... COMPARE NATURAL)), or compute the numeric max explicitly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Start to adapt code to compile with ARM/CUDA13/GCC13. The goal is to support NVIDIA DGX Spark workstation
I'll try to send all patches in next two weeks without breaking anything. I have it compiled, but it was arduous.