Make -j$(nproc) induces seg fault


#1

I’m building OpenCV and wondering what is the recommended -j parameter for the resin build process.

Tried -j$(nproc) and -j7, both Seg faulted. Currently building without -j and it completes build, but takes hours.


#4

Hi, which device type you are building for? Can you share the dockerfile or the project that you are using, so we can try to reproduce this?


#5

Jetson TX-2

Can do privately, its a Docker amd64 to arm64/v8 project. Builds and have been using on the amd64 side with nvidia/cuda base image. Both amd64 & arm64 builds with debian:jessie base image with buster repo still gives errors that are now occurring later in the build after got rid of the Seg faults… AMD64 build is local on my workstation.


#11

Hi, Please send us the Dockerfile as a PM, and we can investigate this further.


#16

Will provide the repo.

Debian base images are not giving me any love, moved to amd64/ubuntu:16.04 and arm64v8/ubuntu:16.04 base images. AMD64 builds locally, but I’m now getting amd64 compiler flag issues when build for arm64.

Only way to not get random stoppage of the build, with no posted errors is to use -j1 aka one thread.


#18

I do not have permission to PM you. The repo is a private Bitbucket repo that I need an email or BB account to share


#19

Hello, can you add an email address to your forum profile and then post here? We’ll use that address to contact you directly.


#20

Its there, but restricted view by default. Or do you want me to actually post it into this topic?


#24

Compiler flag errors fixed. Arm64v8 build with -j$(nproc) borks with no error on OpenCV portion of build.

When using -j4 --> make[6]: warning: jobserver unavailable: using -j1. Add ‘+’ to parent make rule.

So it seems its best to not use -j with make, but builds are many hours long.


#28

With my apologies that this took a little longer than expected you should now have an email from a private message address that is suitable for the passing of the private data associated with this request.


#29

Sent the Dockerfile as requested


#31

This is just a quick note to confirm receipt of the dockerfile.


#42

This doesn’t look to be an issue with the resin builders.
We’ve seen a number of issues around using OpenCv on the resin platform and as a result plan to release and OpenCv base image at some point in the future.


#45

I have completely rewritten the Dockerfile to remove the “SuperBuild” portion of the docker file. Each software dependency is built and installed externally. I was getting too many untraceable build errors when built as a group via cmake.

Will install and test on a TX-2. Note: in OpenCV build notes for TX-2 mentions -j4 as the maximum for OpenCV with Cuda.

With all the various build flags needed by each project, I just don’t see how a stock resionOS OpenCV image would be useful.