Having difficulties installing Caffe in ubuntu 16.04 - c++

OS: ubuntu 16.04
CUDA: 7.5
Cudnn: 5
I am following this tutorial for installing caffe with gpu.
In here, I wanted an installation of opencv 3.1. But the compilation of opencv is giving error when CUDA is already installed in the system.
The error I get on trying to make opencv 3.1 is :
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:266 (message):
Error generating file
/home/cortana/Downloads/opencv-3.1.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:1505: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I have tried changing CMakeLists.txt of opencv 3.1 by adding the line set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") to it. Also, I checked the suggestion for changing the /usr/include/string.h provided here. But I already have the updated version of the file.
I am unable to build opencv 3.1 and hence, Caffe.

Try with CUDA 8. It worked for me with GeForce GTX 960M on Ubuntu 16.04

Related

install opencv on ubuntu 18.04

I've been trying to install opencv, using this referance. But when I try to run make command, I get error as follows:
/opt/opencv/modules/videoio/src/cap_dc1394_v2.cpp:59:10: fatal error:
dc1394/dc1394.h: No such file or directory
#include <dc1394/dc1394.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:278: recipe for
target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o'
failed
make[2]: ***
[modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o] Error
1
CMakeFiles/Makefile2:6307: recipe for target
'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I tried so many times to install opencv, when the installation is completed, I tried to check the installation, and then I get error that there is no module named opencv.
I recommend to use this guide to download the OpenCV Libary to the linux. (ubuntu 18.04).
I did it today on my ubuntu 18.04 and it worked perfectly, but please read all the guide and don't just copy the terminal commands.

AMDGPU driver DKMS module build fails in Kubuntu 18.04

I recently bought an AMD RX590 card (XFX 8GB Fatboy),
and tried to install on my linux box. I downloaded the AMDGPU drivers from amd website,
and launched the installer ./amdgpu-install on my machine.
I got the following error during instalation:
Building for 5.6.0-16.2-liquorix-amd64
Building for architecture x86_64
Building initial module for 5.6.0-16.2-liquorix-amd64
ERROR (dkms apport): kernel package linux-headers-5.6.0-16.2-liquorix-amd64 is not supported
Error! Bad return status for module build on kernel: 5.6.0-16.2-liquorix-amd64 (x86_64)
Consult /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/make.log for more information.
Here is the output from make.log:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.c: In function 'smu_v11_0_i2c_transmit':
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.c:237:6: error: 'drm_debug' undeclared (first use in this function); did you mean '__drm_debug'?
if (drm_debug & DRM_UT_DRIVER) {
^~~~~~~~~
__drm_debug
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.c:237:6: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.c: In function 'smu_v11_0_i2c_receive':
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.c:391:6: error: 'drm_debug' undeclared (first use in this function); did you mean '__drm_debug'?
if (drm_debug & DRM_UT_DRIVER) {
^~~~~~~~~
__drm_debug
scripts/Makefile.build:267: recipe for target '/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.o' failed
make[2]: *** [/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/smu_v11_0_i2c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.build:505: recipe for target '/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu' failed
make[1]: *** [/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu] Error 2
Makefile:1708: recipe for target '/var/lib/dkms/amdgpu/5.4.7.53-1048554/build' failed
make: *** [/var/lib/dkms/amdgpu/5.4.7.53-1048554/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.6.0-16.2-liquorix-amd64'
Does anyone know how to make this work on Linux?
I tried to install amdgpu with the --no-dkms swith successfully, but the graphics card doesn't initialize with the amd drivers, and shows up as llvmpipe 9.0. Any ideas how to make this works?

Monocular Total Capture compilation make error : fatal error: glm/glm.hpp: File or directory not found

I'm trying to use this repo :
https://github.com/CMU-Perceptual-Computing-Lab/MonocularTotalCapture
These are the packages that I have installed :
ffmpeg
Python 2.7.12 (with TensorFlow 1.5.0, OpenCV, Matplotlib, packages installed with pip3)
openCV 4.2.0
cmake = 3.5.1
OpenCV 2.4.13 (compiled from source with CUDA 9.0, CUDNN 7.0)
Ceres-Solver 1.13.0 (with SuiteSparse)
OpenGL, GLUT, GLEW
libigl https://github.com/libigl/libigl
wget
OpenPose
eigen3, version 3.3.7
Boost version: 1.58.0
GNU 5.4.0
unfortunately I get an error at the end and I don't know how to fix.
mario#ziom-Z87-HD3:/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/build# make -k
/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/src/Renderer.cpp:5:23: fatal error: glm/glm.hpp: File o directory not found
....
/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/src/AdamFastCost.cpp:1225:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int ic = 0; ic < total_vertex.size(); ic++)
^
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mylib.dir/all' failed
make[1]: *** [CMakeFiles/MYLIB.dir/all] Error 2
Makefile:83: recipe for target 'CMakeFiles/mylib.dir/all' failed
make: *** [all] Error 2

Having trouble compiling 32-bit binary on 64-bit linux armv8 machine

I am trying to use a c++ ARM 32-bit library on a Jetson Tx2, which is an ARM 64-bit linux machine. When I try to compile some of the sample code provided with the library I get the following compilation error:
/usr/bin/ld: skipping incompatible /home/nvidia/libroyale/bin/libroyale.so
when searching for -lroyale
/usr/bin/ld: cannot find -lroyale
collect2: error: ld returned 1 exit status
CMakeFiles/sampleCameraInfo.dir/build.make:94: recipe for target
'sampleCameraInfo' failed
make[2]: *** [sampleCameraInfo] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I assume that this error is because the 32-bit library is somehow incompatible with a 64-bit machine.
I have been browsing other StackOverflow forums on similar issues, and in accordance with those forum recommendations added the -m32 flag to CXXFLAGS and LDFLAGS when I compile. However, I then get the following error:
g++: error: unrecognized command line option ‘-m32’
CMakeFiles/sampleCameraInfo.dir/build.make:62: recipe for target
'CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o' failed
make[2]: *** [CMakeFiles/sampleCameraInfo.dir/sampleCameraInfo.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target
'CMakeFiles/sampleCameraInfo.dir/all' failed
make[1]: *** [CMakeFiles/sampleCameraInfo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Some other StackOverflow threads said that in order to use the -m32 flag, one has to run the command:
sudo apt-get install g++-multilib
I don't think that the installation is working correctly, as I'm getting the following errors:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
g++-multilib:armhf : Depends: cpp:armhf (>= 4:5.3.1-1ubuntu1) but it is
not going to be installed
Depends: gcc-multilib:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++:armhf (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
Depends: g++-5-multilib:armhf (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Any suggestions would be very much appreciated. Thanks!
UPDATE: I realized that the -m32 flag is only supported on x86 linux machines. Does anyone know if there is some equivalent for ARM machines?
I had a look at the GCC documentation, especially on the following pages:
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/x86-Options.html
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/AArch64-Options.html
Looks like for the GNU compilers x86 is one type of CPU; you can create 16-, 32- or 64-bit code for this CPU type.
However it also looks like for the GNU compilers 32-bit ARM CPUs and 64-bit ARM CPUs are two completely different CPU types.
Therefore compiling for 32-bit ARM with a 64-bit ARM compiler is the same as compiling for x86 with an ARM compiler: It won't work.
Of course the 32-bit library will not be accepted; an ARM compiler would not accept a x86 library, either.

Error when compiling OpenCV for Qt

In order to use OpenCV in Qt, I have to compile it with MinGW by cmake.
Software are the following:
Qt 5.4.0
Opencv 2.4.11
CMake 3.2.2
MinGW version unknown, GCC 4.8.1
A fatal error occurred when I make file and I have no idea how to solve it at all.
[ 29%] Automatic moc for target opencv_highgui
Generating moc_window_QT.cpp
Exit code 0xc000007b
AUTOGEN: error: process for C:/opencvbuild/modules/highgui/moc_window_QT.cpp failed:
Exit code 0xc000007b
moc failed...
modules\highgui\CMakeFiles\opencv_highgui_automoc.dir\build.make:48: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui_automoc' failed
mingw32-make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui_automoc] Error 1
CMakeFiles\Makefile2:2066: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui_automoc.dir/all' failed
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui_automoc.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
These messages are shown in cmd.
Then I revised CMakeLists.txt, SET(CMAKE_AUTOMOC OFF)
modules\highgui\CMakeFiles\opencv_highgui_automoc.dir\build.make:64: recipe for target 'modules/highgui/qrc_window_QT.cpp' failed
Does anybody know a solution?
2 items to try.
Try running make with VERBOSE=1 to increase the output on the makefile. That should give you a better idea of what is wrong.
Try running with cmake-gui, then turn on advanced mode to check out what CMake found for the different Qt5 dependencies. On Mac, I install the latest Qt to my home directory, causing me to have to manually set variables. This is what it looks like for me.
Hopefully this provides some useful information.