NVIDIA / FasterTransformer

Transformer related optimization, including BERT, GPT
Apache License 2.0
5.86k stars 891 forks source link

link error: /usr/bin/ld: cannot find -lmpi #665

Open elinx opened 1 year ago

elinx commented 1 year ago

Branch/Tag/Commit

main

Docker Image Version

-

GPU name

A100

CUDA Driver

-

Reproduced Steps

1. install mpi library to directory like `/opt/third_party/mpi` other than the default place(/usr/local/mpi)
2. build the project and the following error will happend:

cd /workspace/FasterTransformer/build/src/fastertransformer/triton_backend && /usr/local/lib/python3.8/dist-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/TransformerTritonBackend.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -std=c++17  -DWMMA -O3 -DNDEBUG -O3 -shared -Wl,-soname,libTransformerTritonBackend.so -o ../../../lib/libTransformerTritonBackend.so CMakeFiles/TransformerTritonBackend.dir/transformer_triton_backend.cpp.o   -L/usr/local/cuda/lib64  -L/usr/local/mpi/lib  -Wl,-rpath,/usr/local/cuda/lib64:/usr/local/mpi/lib ../../../lib/libnccl_utils.a ../../../lib/libmpi_utils.a -lmpi /usr/lib/x86_64-linux-gnu/libnccl.so ../../../lib/liblogger.a -lcudart 
/usr/bin/ld: cannot find -lmpi
collect2: error: ld returned 1 exit status
make[2]: *** [src/fastertransformer/triton_backend/CMakeFiles/TransformerTritonBackend.dir/build.make:101: lib/libTransformerTritonBackend.so] Error 1
make[2]: Leaving directory '/workspace/FasterTransformer/build'
make[1]: *** [CMakeFiles/Makefile2:7062: src/fastertransformer/triton_backend/CMakeFiles/TransformerTritonBackend.dir/all] Error 2
make[1]: Leaving directory '/workspace/FasterTransformer/build'
make: *** [Makefile:136: all] Error 2

```[tasklist]
### Tasks
himarora commented 1 year ago

Updating the correct path here worked for me https://github.com/NVIDIA/FasterTransformer/blob/c6e8f60ec40da218804a60e6aa986903e7fa8594/CMakeLists.txt#L286

himarora commented 1 year ago

There's an open PR for this too: https://github.com/NVIDIA/FasterTransformer/pull/612