I've downloaded OPENNI2 and got it work in Niviewer.exe through the libfreenct2 driver. But when I build Opencv with OPENNI2 it's wired.
My cmd line : cmake -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON -D PYTHON3_NUMPY_INCLUDE_DIRS=C:\Users\asus\anaconda3\envs\yolotag5\Lib\site-packages\numpy\core\include -D WITH_OPENNI2=ON ..
The result waspage 1 and page 2, OPENNI2 was embeded with the compile file.
But after I ran: cmake.exe --build . --config Release --target INSTALL
It returns the result like Page 1 and Page 2
OPENNI2 has just gone!
Has anyone met this problem before?
Related
I am trying to fork this docker image so that if anything changes on the original it won't affect me.
I have forked the repo corresponding to that image to my own repo.
I have cloned the repo and am trying to build it:
docker build . -t davcal/gcc-cross-x86_64-elf
I am getting this error:
+ cd /usr/local/src
+ ./build-binutils.sh 2.31.1
/bin/sh: 1: ./build-binutils.sh: not found
The command '/bin/sh -c set -x && cd /usr/local/src && ./build-binutils.sh ${BINUTILS_VERSION} && ./build-gcc.sh ${GCC_VERSION}' returned a non-zero code: 127
What makes no sense to me is that if I use the original image, it builds successfully:
FROM randomdude/gcc-cross-x86_64-elf
...
Maybe Docker Hub stores a pre-built image?
How do I fix this?
Note: I am using Windows. This shouldn't make a difference since the error originates within the container.
Edit
I tried patching the Dockerfile to chmod executable permissions to the sh files in case that was causing problems on Windows. Unfortunately, the exact same error occurs.
RUN set -x \
&& chmod +x /usr/local/src/build-binutils.sh \
&& chmod +x /usr/local/src/build-gcc.sh \
&& cd /usr/local/src \
&& ./build-binutils.sh ${BINUTILS_VERSION} \
&& ./build-gcc.sh ${GCC_VERSION}
Edit 2
Following this method, I inspected the container to see if the sh files actually exist. Here is the output.
I ran docker run --rm -it c53693f11514 bash, including the hash of the intermediate container of the previous successful step of the Dockerfile.
This is the output showing that the files do exist:
root#9b8a64ac2090:/# cd usr/local/src
root#9b8a64ac2090:/usr/local/src# ls
binutils-2.31.1 build-binutils.sh build-gcc.sh gcc-8.2.0
From the described symptoms, file exists, is a shell script, and works on other machines, the "file not found" error is most likely from Winidows linefeeds being added to the file. When the Linux kernel processes a shell script, it looks at the first line, the #!/bin/sh or similar, and then finds that interpreter to run the shell script. If that interpreter isn't found, you'll get a "file not found" error.
In this case, the file it's looking for won't be /bin/sh, but instead /bin/sh\r or /bin/sh^M depending on how you want to represent the carriage return character. You can fix that for single files with a tool like dos2unix but in general, you'll want to fix git itself since there are likely other files that have had their linefeeds corrupted. For details on adjusting the behavior of git, see this post.
I'm trying to build a docker image that uses nvidia hardware decoding in gstreamer and have encountered a strange problem with making the image.
The build process does not find the nvidia cuda related stuff while running docker build (or nvidia-docker build), but when I spin up the failed image as a container and do those very same steps from within the container everything works. I even saved the container as image which gave me a persistent image that works as intended.
Has anyone experienced similar problem and can shed some light on it?
Dockerfile:
FROM nvcr.io/nvidia/deepstream:3.0-18.11 AS base
ENV DEBIAN_FRONTEND noninteractive
#install some dependencies. NOTE - not removing apt cache for the MWE
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libdc1394-22 \
tmux \
vim \
libjpeg-dev \
libpng-dev \
libpng12-dev \
cuda-toolkit-10-0 \
python3-setuptools \
python3-pip ninja-build pkg-config gobject-introspection gnome-devel bison flex libgirepository1.0-dev liborc-0.4-dev
RUN pip3 install meson && ldconfig
FROM base
#pull and make gstreamer:
RUN cd /tmp && mkdir gstreamer
RUN git clone https://github.com/GStreamer/gst-build.git /tmp/gstreamer \
&& cd /tmp/gstreamer \
&& git checkout tags/1.16.0 \
&& ./setup.py -Dgtk_doc=disabled -Dgst-plugins-bad:nvdec=enabled -Dgst-plugins-bad:nvenc=enabled -Dgst-plugins-bad:iqa=disabled -Dgst-plugins-bad:bluez=disabled --reconfigure \
&& ninja -C build \
&& ninja install -C build
Testing:
build and run the container. Inside the container:
$ gst-inspect-1.0 nvdec
No such element or plugin 'nvdec'
$ cd /tmp/gstreamer
$ ./setup.py -Dgtk_doc=disabled -Dgst-plugins-bad:nvdec=enabled -Dgst-plugins-bad:nvenc=enabled -Dgst-plugins-bad:iqa=disabled -Dgst-plugins-bad:bluez=disabled --reconfigure
$ ninja -C build
$ ninja install -C build
$ gst-inspect-1.0 nvdec
Factory Details:
Rank primary (256)
[... all plugin parameters show up]
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstVideoDecoder
+----GstNvDec
EDIT1
The image builds with no errors, only when I try to call gstreamer it is built with no acceleration. I noticed that in the build process the major difference is
meson.build:109:2: Exception: Problem encountered: The nvdec plugin was enabled explicitly, but required CUDA dependencies were not found.
which does not happen when building from within the container.
Lack of error is related, most likely, to the ninja+meson build system which looks for compatible packages, reports the exception, but doesn't throw it and continues as if nothing wrong happened
EDIT2
Answering comment:
To build it and get the error, just build the attached docker image:
sudo docker build -t gst16:latest . > build.log
This will dump all the output into the build.log file.
I don't have a docker registry that I could use for this and the docker image gets quite big by docker standards (~8 Gigs), but to produce successfully, it's fairly simple:
sudo docker run --runtime="nvidia" -ti gst16:latest /bin/bash
or
sudo nvidia-docker run -ti gst16:latest /bin/bash
which seems to work the same for me. Notice no --rm flag! From within the container:
#check if nvidia decoder plugin is there:
gst-inspect-1.0 nvdec
#fail!
#now build it from within:
cd /opt/gstreamer
./setup.py -Dgtk_doc=disabled -Dgst-plugins-bad:nvdec=enabled -Dgst-plugins-bad:nvenc=enabled -Dgst-plugins-bad:iqa=disabled -Dgst-plugins-bad:bluez=disabled --reconfigure
ninja -C build
ninja install -C build
gst-inspect-1.0 nvdec
#success reported
Now to get the image, exit the container (ctrl+d) and in the host shell:
sudo docker container ls -a to view all containers including stopped ones
from gst16:latest get the CONTAINER_ID and copy it
sudo docker commit <CONTAINER_ID> gst16:manual and after a few seconds you should have the container saved as an image. Verify with sudo docker images
run the new image with sudo docker run --runtime=`nvidia` --rm -ti gst16:manual /bin/bash
from within the container try again the gst-inspect-1.0 nvdec to verify it's working
EDIT3
$ nvidia-docker --version
Docker version 18.09.0, build 4d60db4
I think I found the solution/reason
Writing it here in case someone finds themselves in similar situation, plus I hate finding old threads with similar problem and no answer or "nevermind, I solved it" as the only follow up
Docker build does not have any ties to nvidia runtime and gstreamer requires access to the full nvidia toolchain in order to build the plugins that need it. This is to be resolved with gstreamer 1.18 but until then, there is no way to build gstreamer with nvidia codecs in docker build.
The workaround:
Build image with all dependencies.
Run a container of said image using runtime="nvidia" but don't use --rm flag
In the container, build gstreamer and install it as normally.
Verify with gst-inspect-1.0
Commit the container as new image: docker commit <container_name> <temporary_image_name>
Tag the temporary image properly.
I'm new to Travis and getting this error in the build output:
Setting environment variables from .travis.yml
$ export DOCKER_COMPOSE_VERSION=1.23.1
0.01s$ source ~/virtualenv/python3.6/bin/activate
$ python --version
Python 3.6.3
$ pip --version
pip 9.0.1 from /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages (python 3.6)
before_install.1
0.01s$ sudo rm /usr/local/bin/docker-compose
before_install.2
0.13s$ curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-'uname -s'-'uname -m' > docker-compose
before_install.3
0.00s$ chmod +x docker-compose
before_install.4
0.01s$ sudo mv docker-compose /usr/local/bin
install
10.72s$ pip install -r requirements.txt
0.02s$ docker-compose up -d --build
/usr/local/bin/docker-compose: line 1: syntax error near unexpected token `<'
This is strange because there is < nowhere in my docker-compose files. Why am I seeing this error ?
The problem doesn't come from your docker-compose.yml project file but from from the docker-compose file itself, which has not been properly downloaded; namely it is not a binary, but a HTML file (hence the < character you got):
$ export DOCKER_COMPOSE_VERSION=1.24.1
$ curl -L https://github.com/docker/compose/releases/download\
/${DOCKER_COMPOSE_VERSION}/docker-compose-'uname -s'-'uname -m' > docker-compose
$ file docker-compose
docker-compose: HTML document, ASCII text, with CRLF line terminators
$ head docker-compose
<!DOCTYPE html><title>Malformed request</title>
<body>We didn't receive a proper request from your browser. Please contact us if the problem persists.</body>
</html>
To solve this, you should fix your script by using the command substitution $(uname -s), instead of 'uname -s':
$ curl -L https://github.com/docker/compose/releases/download\
/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) > docker-compose
$ file docker-compose
docker-compose: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (...)
I run the same Docker build on two machines:
Ubuntu 16.04
Debian 9.7
Everything works fine in Ubuntu but this is the problem I have in Debian during the Docker build:
The command '/bin/sh -c php7 /installer.php --install-dir=/usr/bin --filename=composer' returned a non-zero code: 139
This is my Dockerfile:
FROM nginx:1.14-alpine
...
...
RUN curl https://getcomposer.org/installer -o /installer.php
RUN php7 /installer.php --install-dir=/usr/bin --filename=composer
...
...
In Linux, the error code 139 indicates a segmentation fault.
I have a memory of 15437156 kB on Debian (Docker version 18.06.2-ce) and 16147116 kB on Ubuntu (Docker version 18.05.0-ce).
Note: The problem happens during the build docker build ...
Do you know how to fix this on Debian?
I was facing the issuse
The command '/bin/sh -c rpm -ivh jdk-8u172-linux-x64.rpm' returned a non-zero code: 139
then i switched to using the legacy hyper-V instead of the WSL 2 that is provided by the docker engine, then everything worked fine
I was upgrading some versions and started hitting a similar issue to you, googled and found your post here. I was getting:
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php && php -r "unlink('composer-setup.php');" && mv composer.phar /usr/local/bin/composer
---> Running in e73735530b5d
All settings correct for using Composer
Segmentation fault
After some testing I found that using FROM alpine:3.9 caused it to Seg fault every time, but downgrading my Alpine version to FROM alpine:3.8 stopped it occurring.
Not sure why though, but looks like there's something broken in the latest version of Alpine as I also didn't get this issue in Debian, Debian Slim, or Ubuntu 18:04.
I want to install opencv package in torch. I have already installed opencv and it is working fine. After using luarocks install cv for installing cv package in torch I am getting following error.
CMake Error at CMakeLists.txt:30 (FIND_PACKAGE):
Could not find a configuration file for package "OpenCV" that exactly
matches requested version "3.1".
The following configuration files were considered but not accepted:
/home/user/opencv-3.1.0/cmake/OpenCVConfig.cmake, version: unknown
/usr/local/share/OpenCV/OpenCVConfig.cmake, version: 3.3.0
-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_cv-scm-1-5467/torch-
opencv/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
Is there any way to fix this?
you may take a look at installation guide from the GitHub page
torch-opencv requires opencv-3.1.0 and is not (yet) compatible with opencv-3.3.0.
Therefore, you need to install opencv-3.1.0
git clone https://github.com/daveselinger/opencv
cd opencv
git checkout 3.1.0-with-cuda8
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local
-D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON
-D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON
-D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make
sudo make install
luarocks install cv
if your cuda version is not 8, you should change it.