transcribe.cpp icon indicating copy to clipboard operation
transcribe.cpp copied to clipboard

CMake install manifest not capturing `ggml-cuda`'s private CUDA/cuBLAS/driver link libraries for static Windows builds

Open SaptaDey opened this issue 4 months ago • 1 comments

Bug Description

Building with -DTRANSCRIBE_CUDA=ON -DTRANSCRIBE_BUILD_SHARED=OFF (the static posture) produces a transcribe-link.json manifest that omits every CUDA runtime/cuBLAS/driver link dependency ggml-cuda actually needs.

Root cause

transcribe-install.cmake:118 builds the manifest from only the transcribe target's own LINK_LIBRARIES`:

get_target_property(_transcribe_links transcribe LINK_LIBRARIES)

The per-backend translation block right after it (lines 130-139) has explicit cases for metal, blas+APPLE, and vulkan, but no cuda case:

if("metal" IN_LIST _kinds)
    list(APPEND _frameworks Foundation Metal MetalKit)
endif()
if("blas" IN_LIST _kinds AND APPLE)
    list(APPEND _frameworks Accelerate)
endif()
if("vulkan" IN_LIST _kinds)
    list(APPEND _system_libs vulkan)
endif()
# no cuda case

Meanwhile ggml/src/ggml-cuda/CMakeLists.txt:158-183 attaches CUDA's actual link deps to the ggml-cuda target as PRIVATE, so they never show up on transcribe's own property:

  • GGML_STATIC OFF (the default — nothing in transcribe.cpp's CMakeLists.txt or the Rust build.rs ever sets it): CUDA::cudart + CUDA::cublas (line 176)
  • GGML_STATIC ON + WIN32: CUDA::cudart_static + CUDA::cublas (line 161, with your own comment: "As of 12.3.1 CUDA Toolkit for Windows does not offer a static cublas library" cublas is a Windows DLL dependency either way)
  • Unless GGML_CUDA_NO_VMM: CUDA::cuda_driver too (lines 179-182)

Why this only shows up in the static posture

In the shared/dynamic-backends posture, ggml-cuda.dll resolves its own CUDA deps at DLL-link time unaffected. That's presumably why this hasn't surfaced before: the shipped Windows/Linux provider wheels use dynamic-backends, and link_smoke.py's linux+macos coverage doesn't include a CUDA config either way.

System Information

  • Windows 11, MSVC 19.51 (VS 2026 toolset), CUDA Toolkit 13.3, CMake 4.3.4
  • GPU: RTX 4060 (Ada Lovelace, compute capability 8.9)

SaptaDey avatar Jul 11 '26 10:07 SaptaDey

Thanks for the issue, @SaptaDey would you like to submit a PR?

cjpais avatar Jul 11 '26 14:07 cjpais