NVIDIA / NVIDIA/TensorRT-RTX

[BUG] [CMake] Package config references a non-existent header: cmake/NvInferVersion.h

Open Beginner friendly
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
109
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

cmake/TensorRT-RTXConfig.cmake adds a header file set to TRTRTX::tensorrt_headers with a file that the package
does not contain:

  target_sources(TRTRTX::tensorrt_headers
    INTERFACE
      FILE_SET "HEADERS"
      TYPE "HEADERS"
      BASE_DIRS "${_IMPORT_PREFIX}/cmake"
      FILES "${_IMPORT_PREFIX}/cmake/NvInferVersion.h"
  )

NvInferVersion.h is only in include/. CMake 4.3 reports the missing file at generate time when a file API client
requests the code model. Visual Studio does this on every configure.

Steps to reproduce

  1. Extract TensorRT-RTX-1.6.1.120-Windows-amd64-cuda-13.4-Release-external. Create an empty
    bin/tensorrt_player.exe in it, or find_package fails earlier on a different missing file (see https://github.com/NVIDIA/TensorRT/issues/4851).

  2. Create a folder with this CMakeLists.txt, with <package> set to the extracted directory:

     cmake_minimum_required(VERSION 3.27)
     project(trt_probe LANGUAGES CXX)
     set(TensorRT-RTX_DIR "<package>/cmake")
     find_package(CUDAToolkit REQUIRED)
     find_package(TensorRT-RTX CONFIG REQUIRED)
     file(WRITE "${CMAKE_BINARY_DIR}/main.cpp" "int main() {}\n")
     add_executable(probe "${CMAKE_BINARY_DIR}/main.cpp")
     target_link_libraries(probe PRIVATE TRTRTX::tensorrt)
    
  3. Open the folder in Visual Studio 2026 Insiders (18.10, bundled CMake 4.3.1) with File > Open > Folder. The CMake
    configure runs automatically. The Output window (CMake) shows:

     CMake Error in CMakeLists.txt:
       Cannot find source file:
         <package>/cmake/NvInferVersion.h
    

To reproduce on the command line instead: Visual Studio requests the CMake code model through the file API, and the
error only appears with that request. Write {"requests":[{"kind":"codemodel","version":2}]} to
build/.cmake/api/v1/query/client-x/query.json, then run cmake -S . -B build -G Ninja with CMake 4.3.1. CMake
4.2.3, and CMake 4.3.1 without the query, do not report the error.

Expected behavior

The file set uses BASE_DIRS "${_IMPORT_PREFIX}/include" and FILES "${_IMPORT_PREFIX}/include/NvInferVersion.h".
TensorRT-Enterprise 11.3.0.99 already does this: its header file set lists include/ headers, and the same repro
reports no error.

Environment

  • TensorRT-RTX version: 1.6.1.120
  • GPU: NVIDIA RTX 3500 Ada Generation Laptop GPU (driver 596.86)
  • Operating system: Windows 11 Pro 10.0.26200
  • CUDA version: 13.3 (toolkit 13.3.73)
  • CPU architecture: x86_64

Screenshots

N/A

Additional context

  • The same issue was present in TensorRT-Enterprise 11.2.1.2 and it was fixed in 11.3.0.99.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect cmake/TensorRT-RTXConfig.cmake and compare its header file set with the expected include/ path described in the issue. Use the provided minimal CMakeLists.txt and CMake 4.3.1 file API codemodel reproduction to verify the package config. Done means configuration completes without reporting a missing NvInferVersion.h source file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.