# CUDAToolkit\_INCLUDE\_DIR and CUDAToolkit\_ROOT have no effect.

**URL:** https://discourse.cmake.org/t/cudatoolkit-include-dir-and-cudatoolkit-root-have-no-effect/8621
**Category:** Usage
**Tags:** os:linux, lang:cuda
**Created:** [July 28, 2023, 5:48pm UTC](https://discourse.cmake.org/t/cudatoolkit-include-dir-and-cudatoolkit-root-have-no-effect/8621 "2023-07-28T17:48:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Geremia](https://discourse.cmake.org/user_avatar/discourse.cmake.org/geremia/32/3656_2.png) [@Geremia](https://discourse.cmake.org/u/Geremia)
#### Post date: [July 28, 2023, 5:48pm UTC](https://discourse.cmake.org/t/cudatoolkit-include-dir-and-cudatoolkit-root-have-no-effect/8621/1 "2023-07-28T17:48:27Z")

</div>

`CMakeLists.txt` MWE:

```auto
cmake_minimum_required(VERSION 3.17)
project(ProjectName)
find_package(CUDAToolkit)

```

```bash
$ cmake .. 
-- Unable to find cuda_runtime.h in "/usr/share/cuda/include" for CUDAToolkit_INCLUDE_DIR.
-- Unable to find cudart library.
-- Could NOT find CUDAToolkit (missing: CUDA_CUDART) (found version "12.2.91")
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/Geremia/Downloads

```

When I specify the include directory containing `cuda_runtime.h` on my build of CUDA, it doesn’t search that directory:

```bash
$ cmake .. -DCUDAToolkit_INCLUDE_DIR=/usr/share/cuda/targets/x86_64-linux/include
-- Unable to find cuda_runtime.h in "/usr/share/cuda/include" for CUDAToolkit_INCLUDE_DIR.
-- Unable to find cudart library.
-- Could NOT find CUDAToolkit (missing: CUDA_CUDART) (found version "12.2.91")
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/Geremia/Downloads

```

The same holds for `CUDAToolkit_ROOT`, too; it has no effect.

cmake version 3.27.1

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 29, 2023, 8:46pm UTC](https://discourse.cmake.org/t/cudatoolkit-include-dir-and-cudatoolkit-root-have-no-effect/8621/2 "2023-07-29T20:46:37Z")

</div>

@robert.maynard

---

<div class="post-metadata">

### Author: ![robert.maynard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/robert.maynard/32/4_2.png) [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)
#### Post date: [July 31, 2023, 12:59pm UTC](https://discourse.cmake.org/t/cudatoolkit-include-dir-and-cudatoolkit-root-have-no-effect/8621/3 "2023-07-31T12:59:59Z")

</div>

[https://gitlab.kitware.com/cmake/cmake/-/issues/25139](https://gitlab.kitware.com/cmake/cmake/-/issues/25139)
