# \[resolved\] How do I debug missing find\_package module (CUDAToolkit) on a specific machine?

**URL:** https://discourse.cmake.org/t/resolved-how-do-i-debug-missing-find-package-module-cudatoolkit-on-a-specific-machine/3327
**Category:** Code
**Tags:** os:linux
**Created:** [May 14, 2021, 6:16pm UTC](https://discourse.cmake.org/t/resolved-how-do-i-debug-missing-find-package-module-cudatoolkit-on-a-specific-machine/3327 "2021-05-14T18:16:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EricAtORS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ericators/32/1446_2.png) [@EricAtORS](https://discourse.cmake.org/u/EricAtORS)
#### Post date: [May 14, 2021, 6:16pm UTC](https://discourse.cmake.org/t/resolved-how-do-i-debug-missing-find-package-module-cudatoolkit-on-a-specific-machine/3327/1 "2021-05-14T18:16:56Z")

</div>

Hi,

I have a cmake project that is using `find_package(CUDAToolkit)`.  
I get this error:

```auto
-- Could NOT find CUDAToolkit (missing: CUDAToolkit_DIR)
CMake Error at cmake/find_voreen_libraries.cmake:40 (find_package):
  Could not find a package configuration file provided by "CUDAToolkit" with
  any of the following names:

    CUDAToolkitConfig.cmake
    cudatoolkit-config.cmake

  Add the installation prefix of "CUDAToolkit" to CMAKE_PREFIX_PATH or set
  "CUDAToolkit_DIR" to a directory containing one of the above files. If
  "CUDAToolkit" provides a separate development package or SDK, be sure it
  has been installed.

```

To me, it seems like there’s some particularly broken about this system but I don’t know what it could be. I just installed latest stable release of cmake just in case, but I still get the same issue. The modules are there:

```auto
/usr/share/cmake-3.20/Help/module/FindCUDAToolkit.rst
/usr/share/cmake-3.20/Modules/FindCUDAToolkit.cmake

```

but cmake is not finding them.

What should I do next?  
The find\_package for cudatoolkit works elsewhere (both windows and linux), just not on that machine. So it’s definitely not a typo somewhere.

Eric

---

<div class="post-metadata">

### Author: ![EricAtORS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ericators/32/1446_2.png) [@EricAtORS](https://discourse.cmake.org/u/EricAtORS)
#### Post date: [May 14, 2021, 6:24pm UTC](https://discourse.cmake.org/t/resolved-how-do-i-debug-missing-find-package-module-cudatoolkit-on-a-specific-machine/3327/2 "2021-05-14T18:24:53Z")

</div>

This is the output after running with cmake\_find\_debug\_mode

```auto
CMake Debug Log at cmake/find_voreen_libraries.cmake:41 (find_package):
    /home/jenkins/miniconda3/envs/dragonfly_development/share/cmake-3.19/CUDAToolkitConfig.cmake
    /home/jenkins/miniconda3/envs/dragonfly_development/share/cmake-3.19/cudatoolkit-config.cmake

  <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH].

    /usr/local/cuda-11.1

  CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
  [CMAKE_FIND_USE_CMAKE_PATH].

    none

  Env variable CUDAToolkit_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
  [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  Paths specified by the find_package HINTS option.

    /usr/local/cuda
    /usr/local/cuda-11

  Standard system environment variables
  [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].

    /
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/libs
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/plugins
    /home/jenkins/workspace/Test environment/cmake_windows_migration/$CONDA_PREFIX
    /home/jenkins/workspace/Test environment/cmake_windows_migration/$PATH
    /home/jenkins/.local
    /home/jenkins/miniconda3/condabin
    /home/jenkins/sonar-scanner/sonar-scanner-4.3.0.2102-linux
    /usr/local
    /usr
    /usr/games
    /usr/local/games
    /snap

  CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].

    none

  CMake variables defined in the Platform file
  [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].

    /usr/X11R6
    /usr/pkg
    /opt

  CMake System Package Registry
  [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].

    none

  Paths specified by the find_package PATHS option.

    none

  find_package considered the following locations for the Config module:

    /usr/local/cuda-11.1/CUDAToolkitConfig.cmake
    /usr/local/cuda-11.1/cudatoolkit-config.cmake
    /usr/local/cuda/CUDAToolkitConfig.cmake
    /usr/local/cuda/cudatoolkit-config.cmake
    /usr/local/cuda-11/CUDAToolkitConfig.cmake
    /usr/local/cuda-11/cudatoolkit-config.cmake
    /CUDAToolkitConfig.cmake
    /cudatoolkit-config.cmake
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/libs/CUDAToolkitConfig.cmake
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/libs/cudatoolkit-config.cmake
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/plugins/CUDAToolkitConfig.cmake
    /home/jenkins/workspace/build_pipeline_dragonfly/Dragonfly/OrsQtPlateform/plugins/cudatoolkit-config.cmake
    /home/jenkins/.local/CUDAToolkitConfig.cmake
    /home/jenkins/.local/cudatoolkit-config.cmake
    /home/jenkins/miniconda3/condabin/CUDAToolkitConfig.cmake
    /home/jenkins/miniconda3/condabin/cudatoolkit-config.cmake
    /home/jenkins/sonar-scanner/sonar-scanner-4.3.0.2102-linux/CUDAToolkitConfig.cmake
    /home/jenkins/sonar-scanner/sonar-scanner-4.3.0.2102-linux/cudatoolkit-config.cmake
    /usr/local/CUDAToolkitConfig.cmake
    /usr/local/cudatoolkit-config.cmake
    /usr/CUDAToolkitConfig.cmake
    /usr/cudatoolkit-config.cmake
    /usr/games/CUDAToolkitConfig.cmake
    /usr/games/cudatoolkit-config.cmake
    /usr/local/games/CUDAToolkitConfig.cmake
    /usr/local/games/cudatoolkit-config.cmake
    /snap/CUDAToolkitConfig.cmake
    /snap/cudatoolkit-config.cmake
    /opt/CUDAToolkitConfig.cmake
    /opt/cudatoolkit-config.cmake

  The file was not found.

Call Stack (most recent call first):
  CMakeLists.txt:124 (include)

CMake Error at cmake/find_voreen_libraries.cmake:41 (find_package):
  Could not find a package configuration file provided by "CUDAToolkit" with
  any of the following names:

    CUDAToolkitConfig.cmake
    cudatoolkit-config.cmake

  Add the installation prefix of "CUDAToolkit" to CMAKE_PREFIX_PATH or set
  "CUDAToolkit_DIR" to a directory containing one of the above files. If
  "CUDAToolkit" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:124 (include)

```

---

<div class="post-metadata">

### Author: ![EricAtORS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ericators/32/1446_2.png) [@EricAtORS](https://discourse.cmake.org/u/EricAtORS)
#### Post date: [May 14, 2021, 7:08pm UTC](https://discourse.cmake.org/t/resolved-how-do-i-debug-missing-find-package-module-cudatoolkit-on-a-specific-machine/3327/3 "2021-05-14T19:08:27Z")

</div>

No idea what happened. Clearly there are some issues with the environment, but it works now.
