Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenPose Build/Compilation Error #1753

Closed
hisham246 opened this issue Nov 15, 2020 · 9 comments
Closed

OpenPose Build/Compilation Error #1753

hisham246 opened this issue Nov 15, 2020 · 9 comments
Labels
help wanted/question Extra attention is needed

Comments

@hisham246
Copy link

I have an issue building OpenPose in build directory with command: make -jnproc, even after successful configuration and generation in CMake and cloning of Caffe in 3rd party directory.

The following output appears in the terminal:

[ 12%] Performing build step for 'openpose_lib'
[ 1%] Built target caffeproto
[ 1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_accuracy_layer.cu.o
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_base_data_layer.cu.o
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_norm_layer.cu.o
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bnll_layer.cu.o
[ 4%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bias_layer.cu.o
[ 4%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_reindex_layer.cu.o
nvcc fatal : Unsupported gpu architecture 'compute_80'
nvcc fatal : Unsupported gpu architecture 'compute_80'
CMake Error at cuda_compile_1_generated_base_data_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_base_data_layer.cu.o

nvcc fatal : Unsupported gpu architecture 'compute_80'
CMake Error at cuda_compile_1_generated_absval_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_absval_layer.cu.o

CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:96: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_base_data_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_base_data_layer.cu.o] Error 1
make[5]: *** Waiting for unfinished jobs....
src/caffe/CMakeFiles/caffe.dir/build.make:82: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o] Error 1
src/caffe/CMakeFiles/caffe.dir/build.make:516: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o] Error 1
nvcc fatal : Unsupported gpu architecture 'compute_80'
nvcc fatal : Unsupported gpu architecture 'compute_80'
CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_norm_layer.cu.o

CMake Error at cuda_compile_1_generated_bias_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bias_layer.cu.o

nvcc fatal : Unsupported gpu architecture 'compute_80'
src/caffe/CMakeFiles/caffe.dir/build.make:103: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_norm_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_norm_layer.cu.o] Error 1
src/caffe/CMakeFiles/caffe.dir/build.make:117: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bias_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bias_layer.cu.o] Error 1
CMake Error at cuda_compile_1_generated_accuracy_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_accuracy_layer.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:89: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_accuracy_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_accuracy_layer.cu.o] Error 1
nvcc fatal : Unsupported gpu architecture 'compute_80'
CMake Error at cuda_compile_1_generated_bnll_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bnll_layer.cu.o

nvcc fatal : Unsupported gpu architecture 'compute_80'
src/caffe/CMakeFiles/caffe.dir/build.make:124: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bnll_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bnll_layer.cu.o] Error 1
CMake Error at cuda_compile_1_generated_batch_reindex_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/hisham246/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_reindex_layer.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:110: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_reindex_layer.cu.o' failed
make[5]: *** [src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_reindex_layer.cu.o] Error 1
CMakeFiles/Makefile2:390: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/openpose_lib.dir/build.make:129: recipe for target 'caffe/src/openpose_lib-stamp/openpose_lib-build' failed
make[2]: *** [caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/openpose_lib.dir/all' failed
make[1]: *** [CMakeFiles/openpose_lib.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2

How to fix it and compile OpenPose?

Details:
OS: Ubuntu 18.04
GPU: Nvidia Geforce MX150
CUDA 10.1
cuDNN 7.5.1
CMake 3.18.4
OpenCV 3.2

@gineshidalgo99
Copy link
Member

Could you show me the CMake configuration? (that shows CUDA version, GPU arch, etc).

@gineshidalgo99 gineshidalgo99 added the help wanted/question Extra attention is needed label Nov 15, 2020
@hisham246
Copy link
Author

Could you show me the CMake configuration? (that shows CUDA version, GPU arch, etc).

Yes, here it is
cmake

@hisham246
Copy link
Author

Could you show me the CMake configuration? (that shows CUDA version, GPU arch, etc).

@gineshidalgo99 This is the output of configuration:

GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Found cuDNN: ver. 7.5.1 found (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
Automatic GPU detection failed. Building for all known architectures.
Added CUDA NVCC flags for: sm_35 sm_37 sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86
Found cuDNN: ver. 7.5.1 found (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)

Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done

@gineshidalgo99
Copy link
Member

"Automatic GPU detection failed. Building for all known architectures." --> This is the issue, it should automatically find your GPU!

In your command-line terminal, what is the output of nvidia-smi?

@hisham246
Copy link
Author

hisham246 commented Nov 16, 2020

@gineshidalgo99 I had Ubuntu 18.04 and due to a crash in the Nvidia graphics driver, I reinstalled Ubuntu 20.04 instead of it. Now I am trying to install OpenPose again, but I don't know how to install Cuda 11.1 as it is compatible with Ubuntu 20.04. Whenever I try to install Cuda 11.1 toolkit from Nvidia website, it doesn't allow me and shows this error in var/log/cuda-installer.log

[INFO]: Driver installation detected by command: apt list --installed | grep -e nvidia-driver-[0-9][0-9][0-9] -e nvidia-[0-9][0-9][0-9]
[INFO]: Cleaning up window
[INFO]: Complete
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

[INFO]: Initializing menu
[INFO]: Setup complete
[INFO]: Components to install:
[INFO]: Driver
[INFO]: 455.32.00
[INFO]: Executing NVIDIA-Linux-x86_64-455.32.00.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd 2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed.
[ERROR]: Install of 455.32.00 failed, quitting

Which version of Cuda and cuDNN should I install?

Here is the output of nvidia-smi and nvcc --version:
nvidia

It shows I have Cuda 10.1 already but there is no cuda file in usr/local
There is usr/lib/cuda/include but it's empty.

@dosadadev
Copy link

dosadadev commented Dec 10, 2020

Just FYI:
I encountered this error when building openpose in a docker container, especially when building docker image.
It seems nvidia container toolkit (nvidia-docker) doesn't support gpu when running docker build , so I had to specify the cuda architecture manually.

What I did to solve this problem was to add the argument -DCUDA_ARCH="Turing \(CUDA >= 10\)" to the cmake command line.
If you use cmake GUI, then writing Turing (CUDA >= 10) or the architecture you want to use would solve this problem.

@wuchichung
Copy link

wuchichung commented Mar 5, 2021

I have checked with @dosadadev 's solution ,but it does not work in my case. This is my workaround within docker. I am using cuda 10 so I have to disable the support of AMPERE

RUN git clone -b v1.7.0 https://github.com/CMU-Perceptual-Computing-Lab/openpose /opt/openpose \
 && cd /opt/openpose \
 && mkdir build  \
 && cd build \
 && cmake -DOpenCV_CONFIG_FILE=/opt/opencv/build/OpenCVConfig.cmake \
          -DDOWNLOAD_BODY_25_MODEL=OFF\
          -DDOWNLOAD_FACE_MODEL=OFF\
          -DDOWNLOAD_HAND_MODEL=OFF\
          -DBUILD_EXAMPLES=OFF\
          -DBUILD_PYTHON=ON\
          .. \
 ## FIXME as v1.7.0 support AMPERE architectur, however we are using cuda 10 which is not compatible with AMPERE we comment these lines as a quick fix
 && sed -ie 's/set(AMPERE "80 86")/#&/g'  ../cmake/Cuda.cmake \
 && sed -ie 's/set(AMPERE "80 86")/#&/g'  ../3rdparty/caffe/cmake/Cuda.cmake \
 && make -j $(nproc)\
 && make install \
 && ln -s /opt/openpose/build/python/openpose /usr/local/lib/python3.7/dist-packages/openpose

@nhhviet98
Copy link

I have checked with @dosadadev 's solution ,but it does not work in my case. This is my workaround within docker. I am using cuda 10 so I have to disable the support of AMPERE

RUN git clone -b v1.7.0 https://github.com/CMU-Perceptual-Computing-Lab/openpose /opt/openpose \
 && cd /opt/openpose \
 && mkdir build  \
 && cd build \
 && cmake -DOpenCV_CONFIG_FILE=/opt/opencv/build/OpenCVConfig.cmake \
          -DDOWNLOAD_BODY_25_MODEL=OFF\
          -DDOWNLOAD_FACE_MODEL=OFF\
          -DDOWNLOAD_HAND_MODEL=OFF\
          -DBUILD_EXAMPLES=OFF\
          -DBUILD_PYTHON=ON\
          .. \
 ## FIXME as v1.7.0 support AMPERE architectur, however we are using cuda 10 which is not compatible with AMPERE we comment these lines as a quick fix
 && sed -ie 's/set(AMPERE "80 86")/#&/g'  ../cmake/Cuda.cmake \
 && sed -ie 's/set(AMPERE "80 86")/#&/g'  ../3rdparty/caffe/cmake/Cuda.cmake \
 && make -j $(nproc)\
 && make install \
 && ln -s /opt/openpose/build/python/openpose /usr/local/lib/python3.7/dist-packages/openpose

Thank you, this is my solution based on your problem.

# https://hub.docker.com/r/cwaffles/openpose
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04

#get deps
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-dev python3-pip python3-setuptools git g++ wget make libprotobuf-dev protobuf-compiler libopencv-dev \
libgoogle-glog-dev libboost-all-dev libcaffe-cuda-dev libhdf5-dev libatlas-base-dev

#for python api
#RUN pip3 install scikit-build
RUN pip3 install scikit-build numpy opencv-python==4.1.1.26

#replace cmake as old version has CUDA variable bugs
RUN wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-Linux-x86_64.tar.gz && \
tar xzf cmake-3.16.0-Linux-x86_64.tar.gz -C /opt && \
rm cmake-3.16.0-Linux-x86_64.tar.gz
ENV PATH="/opt/cmake-3.16.0-Linux-x86_64/bin:${PATH}"

#get openpose
WORKDIR /openpose
RUN git clone -q --depth 1 https://github.com/CMU-Perceptual-Computing-Lab/openpose.git .

#build it
WORKDIR /openpose/build
RUN cmake -DBUILD_PYTHON=ON \
	  -DDOWNLOAD_BODY_25_MODEL=ON \
          -DDOWNLOAD_BODY_MPI_MODEL=OFF \
          -DDOWNLOAD_HAND_MODEL=OFF \
          -DDOWNLOAD_FACE_MODEL=OFF \
	  .. 

RUN sed -ie 's/set(AMPERE "80 86")/#&/g'  ../cmake/Cuda.cmake && \
    sed -ie 's/set(AMPERE "80 86")/#&/g'  ../3rdparty/caffe/cmake/Cuda.cmake
RUN make -j`nproc`
RUN make install

WORKDIR /openpose

@whf9527
Copy link

whf9527 commented Mar 17, 2021

I have the same issue and how to reslove this problem
Should it upgrade the cuda version from 10 to 11 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted/question Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants