Skip to content

fix: Jetson Orin + JetPack 6.2 (CUDA 12.6, listed as Compatible platform) fails to build with ENABLE_CUTE_DSL=ALL — missing cudaLibrary_t compat shim in cuteDslF16MoeRunner.h #183

Description

@twjww

Describe the bug

The documented build flow for Jetson Orin + JetPack 6.2+ — a platform listed
in the Official Support Matrix
as Compatible ("expected to work with the stated constraints") — fails to
compile in 0.10.0:

In file included from cpp/kernels/cuteDSLArtifact/aarch64/sm_87/include/cutedsl_f16_moe_all.h:3,
                 from cpp/kernels/moe/f16_cutedsl/cuteDslF16MoeRunner.h:28,
                 from cpp/kernels/moe/f16_cutedsl/cuteDslF16MoeRunner.cpp:20:
cpp/kernels/cuteDSLArtifact/aarch64/sm_87/include/f16_moe_ampere_grouped_fp16.h:21:5:
error: 'cudaLibrary_t' does not name a type; did you mean 'cudaArray_t'?
   21 |     cudaLibrary_t module;

Impact: blocker — the support matrix promises Jetson Orin / JetPack 6.2+ /
CUDA 12.6 works, and the Installation guide gives a dedicated "JetPack 6.2+
Orin" CMake command that includes -DENABLE_CUTE_DSL=ALL ("All commands
enable CuTe DSL kernels because Qwen3.5 and several other model paths require
them"). Following that documented command does not build.

Root cause: cudaLibrary_t is a CUDA runtime type introduced in CUDA
12.8, but AOT-generated CuTe DSL artifact headers use it unconditionally. All
other CuTe DSL runner headers compensate with a compat typedef
(typedef CUlibrary cudaLibrary_t + inline cudaLibraryUnload) guarded by
TRT_EDGELLM_CUDA_LIBRARY_T_COMPAT — which the root CMakeLists.txt
auto-defines for EMBEDDED_TARGET=jetson-orin (see comment at
CMakeLists.txt:92-96). cuteDslF16MoeRunner.h is the only runner header
missing this block:

Header Compat block
cpp/kernels/gdnKernels/cuteDslGDNRunner.h
cpp/kernels/mamba/cuteDslSSDRunner.h
cpp/kernels/moe/nvfp4_cutedsl/cuteDslNvfp4MoeRunner.h
cpp/kernels/talkerMLPKernels/cuteDslGemmRunner.h
cpp/plugins/int4GroupwiseGemmPluginV2/cuteDslInt4Gemm.cpp / cuteDslInt4Gemv.cpp
cpp/kernels/moe/f16_cutedsl/cuteDslF16MoeRunner.h missing

Related gap: kernelSrcs/cuteDSLPrebuilt/ only ships cuda13 tarballs
(e.g. cutedsl_aarch64_sm_87_cuda13.tar.gz), so CUDA 12.6 Orin users must
generate artifacts locally via build_cutedsl.py — the failure reproduces
with a freshly generated cuda12/sm_87 artifact, so it is independent of
artifact provenance.

Proposed fix: add the identical compat block to cuteDslF16MoeRunner.h.
I have a verified patch (full build succeeds, binaries produced) and can send
a PR if approved.

Steps/Code to reproduce bug

  1. Generate a local CUDA 12 / sm_87 CuTe DSL artifact (no cuda12 prebuilt
    tarball ships in the repo):
python kernelSrcs/build_cutedsl.py --kernels ALL --gpu_arch sm_87 --cuda-version 12
  1. Configure and build with the exact "JetPack 6.2+ Orin" command from the
    Installation guide:

Build configuration:

mkdir -p build && cd build
cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DTRT_PACKAGE_DIR=/usr \
    -DCMAKE_TOOLCHAIN_FILE=cmake/aarch64_linux_toolchain.cmake \
    -DEMBEDDED_TARGET=jetson-orin \
    -DCUDA_CTK_VERSION=12.6 \
    -DENABLE_CUTE_DSL=ALL
make -j$(nproc)

Runtime command used:

# N/A — compile-time failure; no runtime reached.

Expected behavior

The build succeeds as promised by the support matrix for the Compatible
Jetson Orin / JetPack 6.2+ / CUDA 12.6 combination. Verified locally: adding
the same compat block used by the sibling runner headers fixes the build:

 #if defined(CUTE_DSL_F16_MOE_ENABLED)

+#include <cuda.h>
+#if defined(TRT_EDGELLM_CUDA_LIBRARY_T_COMPAT)
+#include <cuda_runtime.h>
+#if CUDA_VERSION >= 12000 && CUDA_VERSION < 12080
+typedef CUlibrary cudaLibrary_t;
+static inline cudaError_t cudaLibraryUnload(cudaLibrary_t lib)
+{
+    CUresult r = cuLibraryUnload(lib);
+    return static_cast<cudaError_t>(r);
+}
+#endif // CUDA_VERSION >= 12000 && CUDA_VERSION < 12080
+#endif // TRT_EDGELLM_CUDA_LIBRARY_T_COMPAT
+
 #include "kernels/cuteDslModuleLoader.h"

After the patch, make -j reaches 100% and produces llm_build /
llm_inference / visual_build.

System information (Edge Device)

  • Platform: NVIDIA Jetson AGX Orin Developer Kit
  • Software release: JetPack 6.2
  • CPU architecture: aarch64
  • GPU compute capability: SM87
  • Total device memory: 61Gi (unified)
  • Build type: Release
  • Library versions:
    • TensorRT Edge-LLM version or commit hash: 0.10.0 (release commit 0ce6ce2)
    • CUDA: 12.6 (V12.6.68)
    • TensorRT: 10.3.0.30
    • C++ compiler: GCC 11.4.0
  • CMake options used:
    • CMAKE_TOOLCHAIN_FILE: cmake/aarch64_linux_toolchain.cmake
    • EMBEDDED_TARGET: jetson-orin
    • TRT_PACKAGE_DIR: /usr
  • Any other details that may help:
    • ENABLE_CUTE_DSL=ALL, CUDA_CTK_VERSION=12.6
    • CuTe DSL artifact metadata groups: f16_moe, fmha, gdn, gemm, int4_fp16_gemm, ssd (generated with nvidia-cutlass-dsl[cu12]==4.6.1)
    • Failure is specific to the f16_moe group; builds without it are
      unaffected
    • The same failure applies to x86 CUDA 12 hosts passing
      -DCMAKE_CXX_FLAGS=-DTRT_EDGELLM_CUDA_LIBRARY_T_COMPAT per
      kernelSrcs/int4_fp16_gemm_cutedsl/README.md
      `

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions