No momento, estou tentando construir uma versão do opencv, com o cuda, no meu computador arch linux. Para isso, eu uso opencv-cuda-git como versão base. Além disso, modifiquei o PKGBUILD e adicionei sinalizadores adicionais para me adaptar ainda mais ao meu sistema.
No entanto, toda vez que eu executo o processo de compilação (makepkg csri), ele falha com a seguinte mensagem de erro:
[ 16%] Building CXX object modules/hdf/CMakeFiles/example_hdf_create_groups.dir/samples/create_groups.cpp.o
cd /home/tobias/builds/opencv-cuda-git/src/opencv/build/modules/hdf && /usr/bin/cmake -E cmake_link_script CMakeFiles/example_hdf_create_groups.dir/link.txt --verbose=1
/bin/g++-6 -std=c++11 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-invalid-offsetof -O3 -DNDEBUG -DNDEBUG -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--gc-sections -rdynamic CMakeFiles/example_hdf_create_groups.dir/samples/create_groups.cpp.o -o ../../bin/example_hdf_create_groups -L/opt/cuda/lib64 ../../lib/libopencv_hdf.so.3.4.0 ../../lib/libopencv_highgui.so.3.4.0 ../../lib/libopencv_videoio.so.3.4.0 ../../lib/libopencv_imgcodecs.so.3.4.0 ../../lib/libopencv_imgproc.so.3.4.0 ../../lib/libopencv_core.so.3.4.0 ../../lib/libopencv_cudev.so.3.4.0
../../lib/libopencv_core.so.3.4.0: undefined reference to 'cblas_zgemm'
../../lib/libopencv_core.so.3.4.0: undefined reference to 'cblas_sgemm'
../../lib/libopencv_core.so.3.4.0: undefined reference to 'cblas_dgemm'
../../lib/libopencv_core.so.3.4.0: undefined reference to 'cblas_cgemm'
make[2]: *** [modules/hdf/CMakeFiles/example_hdf_create_groups.dir/build.make:102: bin/example_hdf_create_groups] Error 1
make[2]: Leaving directory '/home/tobias/builds/opencv-cuda-git/src/opencv/build'
make[1]: *** [CMakeFiles/Makefile2:2523: modules/hdf/CMakeFiles/example_hdf_create_groups.dir/all] Error 2
make[1]: Leaving directory '/home/tobias/builds/opencv-cuda-git/src/opencv/build'
make: *** [Makefile:163: all] Error 2
Minha pesquisa anterior sugeriu que esse erro pode ocorrer devido a um erro de vinculação com cublas. Por isso tentei adicionar -L / opt / cuda / lib64 e -lcublas a CMAKE_CXX_FLAGS . Isso não fez diferença alguma.
Sugestões de outro blog contido usando o gcc-6 em vez de g ++ - 6. Isso, no entanto, gera outro erro:
[ 16%] Linking CXX executable ../../bin/example_hdf_create_groups
cd /home/tobias/builds/opencv-cuda-git/src/opencv/build/modules/hdf && /usr/bin/cmake -E cmake_link_script CMakeFiles/example_hdf_create_groups.dir/link.txt --verbose=1
/bin/gcc-6 -std=c++11 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-invalid-offsetof -O3 -DNDEBUG -DNDEBUG -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--gc-sections -rdynamic CMakeFiles/example_hdf_create_groups.dir/samples/create_groups.cpp.o -o ../../bin/example_hdf_create_groups -L/opt/cuda/lib64 ../../lib/libopencv_hdf.so.3.4.0 ../../lib/libopencv_highgui.so.3.4.0 ../../lib/libopencv_videoio.so.3.4.0 ../../lib/libopencv_imgcodecs.so.3.4.0 ../../lib/libopencv_imgproc.so.3.4.0 ../../lib/libopencv_core.so.3.4.0 ../../lib/libopencv_cudev.so.3.4.0
ld: CMakeFiles/example_hdf_create_groups.dir/samples/create_groups.cpp.o: undefined reference to symbol '_ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4'
/usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
make[2]: *** [modules/hdf/CMakeFiles/example_hdf_create_groups.dir/build.make:102: bin/example_hdf_create_groups] Error 1
make[2]: Leaving directory '/home/tobias/builds/opencv-cuda-git/src/opencv/build'
make[1]: *** [CMakeFiles/Makefile2:2523: modules/hdf/CMakeFiles/example_hdf_create_groups.dir/all] Error 2
make[1]: Leaving directory '/home/tobias/builds/opencv-cuda-git/src/opencv/build'
make: *** [Makefile:163: all] Error 2
A saída inteira do processo de criação e o arquivo PKGBUILD personalizado podem ser encontrados aqui
Versão 9 do Cuda, saída de nvidia-smi:
Sun Jan 14 14:44:13 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 387.34 Driver Version: 387.34 | |-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 780 Ti Off | 00000000:01:00.0 N/A | N/A |
| 32% 27C P8 N/A / N/A | 624MiB / 3017MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+