Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.18k stars 4.15k forks source link

link to vulkan error #1773

Closed loseboy001 closed 10 months ago

loseboy001 commented 4 years ago

cmake -DCMAKE_TOOLCHAIN_FILE=/home/fangyu/ocr_mobile/android-ndk-r19c/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_PLATFORM=android-24 -DNCNN_VULKAN=ON .. 用这个命令 make-4后 报错 [ 88%] Building CXX object src/CMakeFiles/ncnn.dir/gpu.cpp.o [ 89%] Linking CXX static library libncnn.a [100%] Built target ncnn [100%] Linking CXX executable benchncnn /home/fangyu/ocr_mobile/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /home/fangyu/ocr_mobile/1.1.108.0/x86_64/lib/libvulkan.so: incompatible target /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:279: error: undefined reference to 'vkFlushMappedMemoryRanges' /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:301: error: undefined reference to 'vkInvalidateMappedMemoryRanges' /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:434: error: undefined reference to 'vkUnmapMemory' /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:436: error: undefined reference to 'vkDestroyBuffer' /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:437: error: undefined reference to 'vkFreeMemory' /home/fangyu/ocr_mobile/ncnn-master/src/allocator.cpp:324: error: undefined reference to 'vkCreateBuffer'

nihui commented 4 years ago

按照这里的步骤编译应该是没有问题的 https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-android

你看看项目中是不是额外添加了 /home/fangyu/ocr_mobile/1.1.108.0/x86_64/lib/ 的 link 路径,这是不需要的

nihui commented 10 months ago

The latest master branch supports compiling gpu functions without installing vulkan-sdk. You can give it a try. If it doesn’t work, feel free to reopen the issue and post your findings.

loseboy001 commented 10 months ago

谢谢我已经收到