# FindCUDAToolkit CUDA::cupti fails since 3.24.1

**URL:** https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327
**Category:** Development
**Tags:** os:linux, lang:cuda
**Created:** [August 24, 2022, 2:53am UTC](https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327 "2022-08-24T02:53:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sami](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@sami](https://discourse.cmake.org/u/sami)
#### Post date: [August 24, 2022, 2:53am UTC](https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327/1 "2022-08-24T02:53:39Z")

</div>

Hi,  
Since possibly a recent change, FindCUDAToolkit fails to find the libcupti since it is not looking to `/usr/loca/cuda/include` path anymore. Nvidia cuda packages install headers together with the other headers instead of `/usr/local/cuda/extras/CUPTI/` as searched by the package.

```auto
$ dpkg -L cuda-cupti-dev-11-4 |grep cupti.h
/usr/local/cuda-11.4/targets/x86_64-linux/include/cupti.h

```

```auto
$ cmake --version
make version 3.24.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ CUDAToolkit_ROOT_DIR=/usr/local/cuda cmake --debug-find-pkg=CUDAToolkit ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=ON -DCUDAToolkit_ROOT_DIR=/usr/local/cuda 

<...truncated for brevity ...>

Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindCUDAToolkit.cmake:977 (_CUDAToolkit_find_and_add_import_lib)
  CMakeLists.txt:20 (find_package)

CMake Debug Log at /usr/share/cmake-3.24/Modules/FindCUDAToolkit.cmake:980 (find_path):
  find_path called with the following settings:

    VAR: CUDAToolkit_CUPTI_INCLUDE_DIR
    NAMES: "cupti.h"
    Documentation: Path to a file.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    NO_DEFAULT_PATH Enabled

  find_path considered the following locations:

    /usr/local/cuda/extras/CUPTI/include/cupti.h
    <PROJECT_ROOT_REDACTED>/cupti.h

  The item was not found.

 <.. truncated for brevity ...>

Call Stack (most recent call first):
  CMakeLists.txt:20 (find_package)

CMake Debug Log at CMakeLists.txt:20 (find_package):
  find_package considered the following paths for FindCUDAToolkit.cmake:

    <PROJECT_ROOT_REDACTED>/cmake/FindCUDAToolkit.cmake

  The file was found at

    /usr/share/cmake-3.24/Modules/FindCUDAToolkit.cmake

```

Is it possible to add CUDAToolkit\_INCLUDE\_DIR to search paths? What is the suggested solution here other than setting the `CUDAToolkit_CUPTI_INCLUDE_DIR` manually?

Thanks,  
Sami

---

<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: [August 24, 2022, 12:09pm UTC](https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327/2 "2022-08-24T12:09:34Z")

</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: [August 24, 2022, 1:49pm UTC](https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327/3 "2022-08-24T13:49:49Z")

</div>

[https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/7608](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7608)

---

<div class="post-metadata">

### Author: ![sami](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@sami](https://discourse.cmake.org/u/sami)
#### Post date: [August 24, 2022, 4:11pm UTC](https://discourse.cmake.org/t/findcudatoolkit-cuda-cupti-fails-since-3-24-1/6327/4 "2022-08-24T16:11:51Z")

</div>

Thank you very much!
