huawei-noah / bolt

Bolt is a deep learning library with high performance and heterogeneous flexibility.
https://huawei-noah.github.io/bolt/
MIT License
910 stars 158 forks source link

Mali GPU errors in install.sh script #14

Closed warpuv closed 4 years ago

warpuv commented 4 years ago

Hello, how to fix this

CANNOT LINK EXECUTABLE

errors? Not running on Kirin 980 nor 990.

1: --- Network Test (LeNet) 1: CANNOT LINK EXECUTABLE "/data/local/tmp/uldra/lenet": cannot locate symbol "Mali_G76p_bin" referenced by "/data/local/tmp/uldra/libkernelbin.so"... 1: CANNOT LINK EXECUTABLE "/data/local/tmp/uldra/lenet": cannot locate symbol "Mali_G76p_bin" referenced by "/data/local/tmp/uldra/libkernelbin.so"... 1: [ 20%] /data/local/tmp/uldra/hdr_ocl 1: [ 40%] /data/local/tmp/uldra/hdr_ocl 1: [ 60%] /data/local/tmp/uldra/hdr_ocl 1: [ 80%] /data/local/tmp/uldra/hdr_ocl 1: [100%] /data/local/tmp/uldra/hdr_ocl 1: /home/yury/source/bolt-master/tests/bin/hdr_ocl: 1 file pushed. 5.3 MB/s (324480 bytes in 0.059s) 1:
1:
1: --- GPU Network Test (HDR_OCL) 1:
1: === Input FP16 1: CANNOT LINK EXECUTABLE "/data/local/tmp/uldra/hdr_ocl": cannot locate symbol "Mali_G76p_bin" referenced by "/data/local/tmp/uldra/libkernelbin.so"... 1:
1: === Input UCHAR 1: CANNOT LINK EXECUTABLE "/data/local/tmp/uldra/hdr_ocl": cannot locate symbol "Mali_G76p_bin" referenced by "/data/local/tmp/uldra/libkernelbin.so"... 1/1 Test #1: quick_benchmark .................. Passed 7.88 sec

Bil17t commented 4 years ago

Please change Line 94 of install.sh. -DUSE_MALI=OFF

warpuv commented 4 years ago

Please change Line 94 of install.sh. -DUSE_MALI=OFF

But the only reason I’m trying to run Bolt is Mali GPU support! I need direct convolution on GPU. Does it work at all?

yunfanxiao commented 4 years ago

For now, most of the kernels have not been optimized well, it will be ready in the next version which supposed to be pulished at the end of April. However your err seems to be not compiled kernel on the target device successfully. when you compile mali, it is required to connect a mali device with adb, all the kernels will be compiled to binary on the device and packaged into libKernelbin.so. you can also try the static complile with install.sh -DUSE_DYNAMIC_LIBRARY=OFF

warpuv commented 4 years ago

For now, most of the kernels have not been optimized well, it will be ready in the next version which supposed to be pulished at the end of April. However your err seems to be not compiled kernel on the target device successfully. when you compile mali, it is required to connect a mali device with adb, all the kernels will be compiled to binary on the device and packaged into libKernelbin.so. you can also try the static complile with install.sh -DUSE_DYNAMIC_LIBRARY=OFF

Thank you for your feedback. I've tried to connect 2 phones with Kirin 980 and Kirin 990 (Mate 20 and Mate 30) before running script. If I not connect the phone I get very different error from adb that phone does not connected.

warpuv commented 4 years ago

For now, most of the kernels have not been optimized well, it will be ready in the next version which supposed to be pulished at the end of April. However your err seems to be not compiled kernel on the target device successfully. when you compile mali, it is required to connect a mali device with adb, all the kernels will be compiled to binary on the device and packaged into libKernelbin.so. you can also try the static complile with install.sh -DUSE_DYNAMIC_LIBRARY=OFF

With -DUSE_DYNAMIC_LIBRARY=OFF I've got slightly different but still similar errors about libkernelbin.a:

[ 97%] Linking CXX executable ../../tests/bin/hdr_ocl
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/hdr_ocl.dir/build.make:110: ../tests/bin/hdr_ocl] Error 1
make[1]: *** [CMakeFiles/Makefile2:1281: tests/CMakeFiles/hdr_ocl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Linking CXX executable ../../tests/bin/lenet
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/lenet.dir/build.make:110: ../tests/bin/lenet] Error 1
make[1]: *** [CMakeFiles/Makefile2:1114: tests/CMakeFiles/lenet.dir/all] Error 2
[ 98%] Linking CXX executable ../../tests/bin/tinybert
[ 98%] Linking CXX executable ../../tests/bin/bert
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/tinybert.dir/build.make:110: ../tests/bin/tinybert] Error 1
make[1]: *** [CMakeFiles/Makefile2:1336: tests/CMakeFiles/tinybert.dir/all] Error 2
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
[ 98%] Linking CXX executable ../../tests/bin/nmt
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/bert.dir/build.make:110: ../tests/bin/bert] Error 1
make[1]: *** [CMakeFiles/Makefile2:1755: tests/CMakeFiles/bert.dir/all] Error 2
[ 99%] Linking CXX executable ../../tests/bin/classification
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/nmt.dir/build.make:110: ../tests/bin/nmt] Error 1
make[1]: *** [CMakeFiles/Makefile2:1809: tests/CMakeFiles/nmt.dir/all] Error 2
../../gcl/tools/kernel_lib_compile/lib/libkernelbin.a(inline_Mali_G76p.cpp.o): In function `Mali_G76p::loadKernelBin()':
inline_Mali_G76p.cpp:(.text+0x2c): undefined reference to `Mali_G76p_bin'
inline_Mali_G76p.cpp:(.text+0x34): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x38): undefined reference to `Mali_G76p_bin_len'
inline_Mali_G76p.cpp:(.text+0x48): undefined reference to `Mali_G76p_bin'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/CMakeFiles/classification.dir/build.make:110: ../tests/bin/classification] Error 1
make[1]: *** [CMakeFiles/Makefile2:1782: tests/CMakeFiles/classification.dir/all] Error 2
make: *** [Makefile:158: all] Error 2