# CMake incorrectly links to nvrtc-builtins

**URL:** https://discourse.cmake.org/t/cmake-incorrectly-links-to-nvrtc-builtins/12723
**Category:** Code
**Tags:** os:linux, lang:cuda
**Created:** [October 8, 2024, 8:45pm UTC](https://discourse.cmake.org/t/cmake-incorrectly-links-to-nvrtc-builtins/12723 "2024-10-08T20:45:01Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![peastman](https://discourse.cmake.org/user_avatar/discourse.cmake.org/peastman/32/5007_2.png) [@peastman](https://discourse.cmake.org/u/peastman)
#### Post date: [October 8, 2024, 10:57pm UTC](https://discourse.cmake.org/t/cmake-incorrectly-links-to-nvrtc-builtins/12723/4 "2024-10-08T22:57:55Z")

</div>

I think I’ve found a way to work around the problem:

```auto
FIND_LIBRARY(NVRTC_LIB nvrtc PATHS "${CUDAToolkit_LIBRARY_DIR}")

```

and then I link to `${NVRTC_LIB}` instead of `CUDA::nvrtc`. I still need to test a bit more, but so far it seems to be working.

---

_[View the full topic](https://discourse.cmake.org/t/cmake-incorrectly-links-to-nvrtc-builtins/12723)._
