Skip to content

adaption to CUDA13/GCC13/ARM arch#2065

Open
pcastelovigo wants to merge 2 commits intoalicevision:developfrom
flinq-ingenieria:develop
Open

adaption to CUDA13/GCC13/ARM arch#2065
pcastelovigo wants to merge 2 commits intoalicevision:developfrom
flinq-ingenieria:develop

Conversation

@pcastelovigo
Copy link

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.

  • Add CUDA 13 compute capabilities
  • Remove deprecated clockRate call if using CUDA 13
  • Add parameter to specify CUDA CC manually if needed
  • GCC 13 requires explicit include in draco, added conditionally

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +1480 to 1483
-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
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

-DALICEVISION_CUDA_CC_LIST=${AV_ALICEVISION_CUDA_CC_LIST} is always passed and has two concrete problems:

  1. When AV_ALICEVISION_CUDA_CC_LIST is empty, this sets the cache entry to empty and can break later logic in src/CMakeLists.txt that assumes at least one CC (e.g., choosing the last entry for JIT flags).
  2. 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 -D argument when non-empty, and pass it as a single escaped :STRING value so semicolons survive intact.

Copilot uses AI. Check for mistakes.
Comment on lines +255 to +259
# 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
)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +695 to +697
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)
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants