Open ConnorBaker opened 4 hours ago
cudnn_frontend is an interface library. Need use target_link_libraries() in CMake. Interface libraries in CMake are special in that they do not generate any compiled output themselves but propagate build properties, such as include directories or other linked libraries, to targets that depend on them.
Example to use it: https://github.com/microsoft/onnxruntime/blob/bbe7c8773837aa7573e202aefd2c633a06be2c23/cmake/onnxruntime_providers_cuda.cmake#L200-L210
Here is related doc about build: https://onnxruntime.ai/docs/build/eps.html#cuda
cudnn_frontend is a cmake target. It's ok to do so, because the target_link_libraries
command will add extra compile flags for the target. In this case, for example, CUDNN_FRONTEND_SKIP_JSON_LIB. But, we may also change it to onnxruntime_add_include_to_target.
onnxruntime_add_include_to_target(${target} cudnn_frontend)
Let me know if it would solve the problem.
Describe the issue
I'm packaging
onnxruntime
for the Nixpkgs CUDA ecosystem (https://github.com/connorbaker/cuda-packages).When building with
nix
, I ran into errors while linking because the linker was unable to find-lcudnn_frontend
.My understanding was that
cudnn-frontend
was a header-only library (https://github.com/NVIDIA/cudnn-frontend) -- why doesonnxruntime
try to link against a library?https://github.com/microsoft/onnxruntime/blob/ac9c135b9543ad0374fe335bc3dc5feb0f24f010/cmake/onnxruntime_unittests.cmake#L70
https://github.com/microsoft/onnxruntime/blob/ac9c135b9543ad0374fe335bc3dc5feb0f24f010/cmake/onnxruntime_providers_cuda.cmake#L208
Urgency
No response
Target platform
x86_64-linux with TensorRT
Build script
Error / output
Visual Studio Version
No response
GCC / Compiler Version
13.3.0