System Info
TRTLLM: today's main commit 81fd468
TRT: 10.11
cuda: 12.9
GCC: 11.3
OS: rocky8.10
Who can help?
@tongyuantongyu
Information
Tasks
Reproduction
1 cd cpp/build && cmake -DUSE_CXX11_ABI=OFF ..
2 make
3 cd ../../examples/cpp/executor/build
4 cmake ..
5 make
Expected behavior
Build success
actual behavior
Linking failure:
[ 10%] Building CXX object CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o
g++ -DENABLE_BF16 -DENABLE_FP8 -Iexamples/cpp/executor/../../../cpp/include
-isystem /usr/local/cuda-12/include -Wall -pthread -lstdc++ -DENABLE_MULTI_DEVICE=0 -O3
-std=gnu++17
-D_GLIBCXX_USE_CXX11_ABI=1
-MD -MT CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o
-MF CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o.d
-o CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o -c
/local/wtambellini/TensorRT-LLM/examples/cpp/executor/executorExampleBasic.cpp
[ 20%] Linking CXX executable executorExampleBasic
cmake -E cmake_link_script CMakeFiles/executorExampleBasic.dir/link.txt --verbose=1
g++ -Wall -pthread -lstdc++ -DENABLE_MULTI_DEVICE=0 -O3 CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o -o executorExampleBasic libnvinfer_plugin_tensorrt_llm.so libtensorrt_llm.so /usr/lib64/libcuda.so /usr/local/cuda-12.9/targets/x86_64-linux/lib/libcudart_static.a -lpthread -ldl /usr/lib64/librt.so /usr/lib64/libnvidia-ml.so
CMakeFiles/executorExampleBasic.dir/executorExampleBasic.cpp.o: In function `main':
executorExampleBasic.cpp:(.text.startup+0x375): undefined reference to
`tensorrt_llm::executor::Executor::Executor(std::filesystem::__cxx11::path const&,
tensorrt_llm::executor::ModelType, tensorrt_llm::executor::ExecutorConfig const&)'
...
See that _GLIBCXX_USE_CXX11_ABI has been set to 1
additional notes
It s because the example executor cmake script tries to auto guess if cxx11ABI was on in libtensorrt_llm.so:
|
COMMAND bash -c "nm -f posix -D ${TRTLLM_LIB_PATH} | grep __cxx11" |
Despite building without cxx11 ABI, my libtensorrt_llm.so still has a small dozen of 'cxx11' keywords in some symbols:
$ nm -f posix -D cpp/Release/tensorrt_llm/libtensorrt_llm.so | grep __cxx11
_ZN12tensorrt_llm6common14printArrayInfoI13__nv_bfloat16EEvPKT_mNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb W 00000000045005e0 0000000000000d88
...
When I force set USE_CXX11_ABI=0, the examples link fine.
Proposal:
I propose to just add a cmake option to examples/cpp/executor/CMakeLists.txt in order for the user to let the script autodetects USE_CXX11_ABI or not.
Example:
option(AUTODETECT_USE_CXX11_ABI ON)
if(${AUTODETECT_USE_CXX11_ABI})
execute_process(
COMMAND bash -c "nm -f posix -D ${TRTLLM_LIB_PATH} | grep __cxx11"
RESULT_VARIABLE GLIB_CXX11_FOUND
OUTPUT_QUIET)
if(GLIB_CXX11_FOUND EQUAL 0)
set(USE_CXX11_ABI 1)
else()
set(USE_CXX11_ABI 0)
endif()
endif()
Before submitting a new issue...
System Info
TRTLLM: today's main commit 81fd468
TRT: 10.11
cuda: 12.9
GCC: 11.3
OS: rocky8.10
Who can help?
@tongyuantongyu
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
1 cd cpp/build && cmake -DUSE_CXX11_ABI=OFF ..
2 make
3 cd ../../examples/cpp/executor/build
4 cmake ..
5 make
Expected behavior
Build success
actual behavior
Linking failure:
See that _GLIBCXX_USE_CXX11_ABI has been set to 1
additional notes
It s because the example executor cmake script tries to auto guess if cxx11ABI was on in libtensorrt_llm.so:
TensorRT-LLM/examples/cpp/executor/CMakeLists.txt
Line 41 in 81fd468
Despite building without cxx11 ABI, my libtensorrt_llm.so still has a small dozen of 'cxx11' keywords in some symbols:
When I force set USE_CXX11_ABI=0, the examples link fine.
Proposal:
I propose to just add a cmake option to examples/cpp/executor/CMakeLists.txt in order for the user to let the script autodetects USE_CXX11_ABI or not.
Example:
Before submitting a new issue...