[PR #717] [CLOSED] fix: make the CUDA language link the shared runtime (Windows sm_70 LNK1169, #585) #2785

Closed
opened 2026-11-04 02:03:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/717
Author: @noahark
Created: 10/4/2026
Status: ❌ Closed

Base: main ← Head: fix-win-sm70-cudart-link


📝 Commits (1)

  • 2100ca2 fix: make the CUDA language link the shared runtime (#585)

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+8 -0)

📄 Description

Fixes #585.

The final link of strata.exe failed on a Windows sm_70 source build (MSVC 14.44, CUDA 12.4):
cudart_static.lib(...) raised LNK2005 for every runtime symbol already defined in
cudart.lib(cudart64_12.dll), ending in LNK1169. Root cause: enable_language(CUDA) links the
runtime per CMAKE_CUDA_RUNTIME_LIBRARY (default Static -> cudart_static.lib), while the
project also links the imported CUDA::cudart target explicitly - both libraries on one link line.
GNU ld tolerates the duplicates, which is why the Pascal/Volta path (#295, tested on Linux) never
hit this on Linux.

The fix sets the language runtime to Shared so it agrees with the explicit CUDA::cudart
links, guarded by if(NOT DEFINED ...) so a user's explicit -D still wins.

Verified on the reporting machine (V100-PCIE-32GB, Windows, CUDA 12.4 + MSVC):

  • before: all 129 objects compile, link.exe line contains both cudart.lib and
    cudart_static.lib -> LNK1169, build fails
  • with this patch (fresh configure, no -D): the generated link line references only cudart.lib
    (178 occurrences, cudart_static.lib gone); the engine builds, runs, and serves - field numbers
    in #617 and PR #707 come from this build (16.5 -> 33.5 tok/s after calibration, IQ3_XXS)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/717 **Author:** [@noahark](https://github.com/noahark) **Created:** 10/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-win-sm70-cudart-link` --- ### 📝 Commits (1) - [`2100ca2`](https://github.com/Niko1221/Strata/commit/2100ca21e139cd1c03a53b261fdb4d7ff56f8eff) fix: make the CUDA language link the shared runtime (#585) ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+8 -0) </details> ### 📄 Description Fixes #585. The final link of `strata.exe` failed on a Windows sm_70 source build (MSVC 14.44, CUDA 12.4): `cudart_static.lib(...)` raised LNK2005 for every runtime symbol already defined in `cudart.lib(cudart64_12.dll)`, ending in LNK1169. Root cause: `enable_language(CUDA)` links the runtime per `CMAKE_CUDA_RUNTIME_LIBRARY` (default **Static** -> `cudart_static.lib`), while the project also links the imported `CUDA::cudart` target explicitly - both libraries on one link line. GNU ld tolerates the duplicates, which is why the Pascal/Volta path (#295, tested on Linux) never hit this on Linux. The fix sets the language runtime to `Shared` so it agrees with the explicit `CUDA::cudart` links, guarded by `if(NOT DEFINED ...)` so a user's explicit `-D` still wins. Verified on the reporting machine (V100-PCIE-32GB, Windows, CUDA 12.4 + MSVC): - before: all 129 objects compile, `link.exe` line contains both `cudart.lib` and `cudart_static.lib` -> LNK1169, build fails - with this patch (fresh configure, no `-D`): the generated link line references only `cudart.lib` (178 occurrences, `cudart_static.lib` gone); the engine builds, runs, and serves - field numbers in #617 and PR #707 come from this build (16.5 -> 33.5 tok/s after calibration, IQ3_XXS) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2785
No description provided.