[BUG] [CMake] Package config references a non-existent header: cmake/NvInferVersion.h
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
-
Extract
TensorRT-RTX-1.6.1.120-Windows-amd64-cuda-13.4-Release-external. Create an empty
bin/tensorrt_player.exein it, orfind_packagefails earlier on a different missing file (see https://github.com/NVIDIA/TensorRT/issues/4851). -
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) -
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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