marian-nmt / marian

Fast Neural Machine Translation in C++
https://marian-nmt.github.io
Other
1.21k stars 227 forks source link

Cannot link marian-decoder on Fedora 33, CUDA 11.0.2, gcc 10.2.1 #374

Open vlisivka opened 3 years ago

vlisivka commented 3 years ago

This bug is already fixed in marian-dev, but not backported to marian. See: https://github.com/marian-nmt/marian-dev/issues/798 .

Bug description

Marian compiles succesfully, but fails on linking stage with following error message:

[ 94%] Linking CXX executable ../marian-decoder
/usr/bin/ld: libmarian_cuda.a(marian_cuda_generated_add.cu.o): in function `void marian::gpu::AggregateTyped<float, float, marian::functional::Assignee<1>, marian::functional::BinaryFunctor<marian::functional::elem::Plus, marian::functional::Assignee<1>, marian::functional::Assignee<2> >, IntrusivePtr<marian::TensorBase> >(marian::functional::Assignee<1>, float, marian::functional::BinaryFunctor<marian::functional::elem::Plus, marian::functional::Assignee<1>, marian::functional::Assignee<2> >, float, IntrusivePtr<marian::TensorBase>, IntrusivePtr<marian::TensorBase>)':
/home/vlisivka/workspace/marian/src/tensors/gpu/add.cu:148: undefined reference to `void marian::AggregateAll<float, float, marian::functional::Assignee<1>, marian::functional::BinaryFunctor<marian::functional::elem::Plus, marian::functional::Assignee<1>, marian::functional::Assignee<2> > >(std::shared_ptr<marian::Allocator>, marian::functional::Assignee<1>, float, marian::functional::BinaryFunctor<marian::functional::elem::Plus, marian::functional::Assignee<1>, marian::functional::Assignee<2> >, float, IntrusivePtr<marian::TensorBase>, IntrusivePtr<marian::TensorBase>)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/marian_decoder.dir/build.make:114: marian-decoder] Error 1
make[1]: *** [CMakeFiles/Makefile2:473: src/CMakeFiles/marian_decoder.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

How to reproduce

Install or run a Fedora 33 host. Install CUDA from official NVIDIA repo. Install dependencies. Clone marian, then execute 'mkdir marian/build; cd marian build; cmake ..; make -j4' .

Context

-- Checking support for CPU intrinsics -- Could not find hardware support for AVX2 on this machine. -- Could not find hardware support for AVX512 on this machine. -- SSE2 support found -- SSE3 support found -- SSE4.1 support found -- SSE4.2 support found -- AVX support found -- Found CUDA libraries: /usr/local/cuda/lib64/libcurand.so /usr/local/cuda/lib64/libcusparse.so /usr/local/cuda/lib64/libcublas.so -- Found Tcmalloc: /usr/lib64/libtcmalloc_minimal.so -- VERSION: 0.1.94 -- Found TCMalloc: /usr/lib64/libtcmalloc_minimal.so -- Configuring done -- Generating done -- Build files have been written to: /home/vlisivka/workspace/marian/build



Workaround: compile without CUDA support, for CPU only.