0

Have a look at this GitHub actions run result on a machine running Windows 10:

nvcc_11.7 visual_studio_integration_11.7 curand_dev_11.7 nvrtc_dev_11.7 nvtx_11.7 cudart_11.7 visual_studio_integration_11.7 nsight_nvtx_11.7
Downloading CUDA Network Installer for 11.7.0 from: https://developer.download.nvidia.com/compute/cuda/11.7.0/network_installers/cuda_11.7.0_windows_network.exe
Downloading Complete
Installing CUDA 11.7.0. Subpackages  nvcc_11.7 visual_studio_integration_11.7 curand_dev_11.7 nvrtc_dev_11.7 nvtx_11.7 cudart_11.7 visual_studio_integration_11.7 nsight_nvtx_11.7
CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
CUDA_PATH_VX_Y CUDA_PATH_V11_7
Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH
1m 2s
Run cmake -B build -G "Visual Studio 16 2019" -A x64 -DBUILD_EXAMPLES=ON
-- The CUDA compiler identification is NVIDIA 11.7.64
-- The CXX compiler identification is MSVC 19.29.30145.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Unable to find cublas_v2.h in either "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include" or "C:/Program Files/NVIDIA GPU Computing Toolkit/math_libs/include"
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include (found suitable version "11.7.64", minimum required is "9.0") 
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE  
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 5.3;6.0;6.1;7.0;7.5;8.0;8.6;8.6+PTX
-- Configuring done
CMake Error at CMakeLists.txt:58 (target_link_libraries):
  The link interface of target "nvtx" contains:
-- Generating done

    CUDA::nvToolsExt

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.



CMake Generate step failed.  Build files cannot be regenerated correctly.
Error: Process completed with exit code 1.

It seems the installer is installing everything it needs, including NVTX - but somehow, CMake is not then able to locate the installed NVTX library.

Why would this happen? What can I do about it?

einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • 1
    nvtx requires library locations be added to your windows path variables that are not automatically done by the installer. You can find questions covering this topic here on SO: https://stackoverflow.com/q/14717203/1695960 – Robert Crovella May 29 '22 at 22:19
  • @RobertCrovella: So, you're saying the the Kitware guys did not account for this in the CMake CUDAToolkit package. Thanks for the link, I'll have a look and post an answer here when I have an exact solution. – einpoklum May 29 '22 at 22:23
  • I don't know what kitware did, and I don't know the problem here. I am saying that people who are having trouble locating nvtx libraries may want to become aware of their locations. The installer i was referring to is the NVIDIA CUDA installer for windows. I don't see any reason to point a finger at kitware but I am not a cmake expert. – Robert Crovella May 29 '22 at 23:07
  • @RobertCrovella: I'm pointing the finger because if one uses the official installer and selects NVTX, without setting a custom install location, then it is the package's responsibility to figure out where NVTX is. That's kind of the point of `find_package()`... – einpoklum May 29 '22 at 23:25

1 Answers1

1

This is an open bug against CMake:

Bug 22893: FindCUDAToolkit: Fails to locate nvToolsExt, no error nor warning

Please let Kitware know it's important to you, because they don't seem very keen on fixing it for some reason.

einpoklum
  • 118,144
  • 57
  • 340
  • 684