# Hybrid CUDA runtime linking

**URL:** https://discourse.cmake.org/t/hybrid-cuda-runtime-linking/15607
**Category:** Code
**Created:** [April 19, 2026, 7:42pm UTC](https://discourse.cmake.org/t/hybrid-cuda-runtime-linking/15607 "2026-04-19T19:42:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Krabbys](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/c68b51/32.png) [@Krabbys](https://discourse.cmake.org/u/Krabbys)
#### Post date: [April 19, 2026, 7:42pm UTC](https://discourse.cmake.org/t/hybrid-cuda-runtime-linking/15607/1 "2026-04-19T19:42:14Z")

</div>

Hello,

since CUDA Toolkit version 13.2 linking with the flag `-cudart=shared` is deprecated on Windows and has been replaced with `-cudart=hybrid`. From the nvidia docs:

> **[\--cudart - 1. Introduction — NVIDIA CUDA Compiler Driver 13.2 documentation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-compiler-driver-nvcc/index.html#cudart-none-shared-static-hybrid-cudart)**
>
> Specify name and location of the output file. | The documentation for nvcc, the CUDA compiler driver.

How can I set the flag with CMake? Before I would use

`set(CMAKE_CUDA_RUNTIME_LIBRARY Shared)`

but this now causes the warning

‘shared’ is a deprecated value for option ‘–cudart (-cudart)’. Use ‘hybrid’ instead.

when I compile with Visual Studio + CUDA 13.2. I tried setting

`set(CMAKE_CUDA_RUNTIME_LIBRARY Hybrid)`

but that does not seem to work correctly. The latest CMake documentation on `CMAKE_CUDA_RUNTIME_LIBRARY` also does not mention hybrid linking.

Any ideas to set this flag correctly? Thank you
