将 GCC 9.3.0 降级到 7 以用于 openpose 后,cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake 出现 CMa
Posted
技术标签:
【中文标题】将 GCC 9.3.0 降级到 7 以用于 openpose 后,cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake 出现 CMake 错误【英文标题】:CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake after downgrading GCC 9.3.0 to 7 for openpose 【发布时间】:2021-04-13 13:00:24 【问题描述】:您知道我该如何解决以下错误吗?它发生在我使用以下命令从 GCC 9.3.0 降级到 7 之后(使用以前版本的 GCC 我收到此错误:CMake: unsupported GNU version -- gcc versions later than 8 are not supported):
$ sudo apt remove gcc
$ sudo apt-get install gcc-7 g++-7 -y
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/g++
$ gcc --version
gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[10889:10881 0:2041] 10:13:10 Wed Jan 06 [mona@goku:pts/0 +1] ~/research/code/openpose/build
$ make -j`nproc`
[ 12%] Performing build step for 'openpose_lib'
[ 1%] Built target caffeproto
[ 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/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_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/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_batch_reindex_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_concat_layer.cu.o
[ 4%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_contrastive_loss_layer.cu.o
[ 5%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_conv_layer.cu.o
[ 5%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bnll_layer.cu.o
[ 6%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_clip_layer.cu.o
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_norm_layer.cu.o
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
CMake Error at cuda_compile_1_generated_base_data_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_base_data_layer.cu.o
CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o
/usr/bin/cc: No such file or directory
/usr/bin/cc: No such file or directory
CMake Error at cuda_compile_1_generated_contrastive_loss_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_contrastive_loss_layer.cu.o
CMake Error at cuda_compile_1_generated_bnll_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bnll_layer.cu.o
CMake Error at cuda_compile_1_generated_accuracy_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_accuracy_layer.cu.o
CMake Error at cuda_compile_1_generated_absval_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/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_batch_reindex_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_reindex_layer.cu.o
CMake Error at cuda_compile_1_generated_clip_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_clip_layer.cu.o
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:86: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_norm_layer.cu.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:79: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_base_data_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:128: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_contrastive_loss_layer.cu.o] Error 1
CMake Error at cuda_compile_1_generated_concat_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_concat_layer.cu.o
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:499: src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:107: 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_bias_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bias_layer.cu.o
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:72: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_accuracy_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:93: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_reindex_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:114: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_clip_layer.cu.o] Error 1
CMake Error at cuda_compile_1_generated_conv_layer.cu.o.Release.cmake:220 (message):
Error generating
/home/mona/research/code/openpose/build/caffe/src/openpose_lib-build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_conv_layer.cu.o
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:121: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_concat_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:100: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bias_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:65: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o] Error 1
make[5]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:135: src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_conv_layer.cu.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:371: src/caffe/CMakeFiles/caffe.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/openpose_lib.dir/build.make:112: caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/openpose_lib.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
$ nvidia-smi
Wed Jan 6 22:27:38 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38 Driver Version: 455.38 CUDA Version: 11.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 165... Off | 00000000:01:00.0 Off | N/A |
| N/A 47C P5 6W / N/A | 891MiB / 3911MiB | 8% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1232 G /usr/lib/xorg/Xorg 133MiB |
| 0 N/A N/A 1877 G /usr/lib/xorg/Xorg 434MiB |
| 0 N/A N/A 2054 G /usr/bin/gnome-shell 156MiB |
| 0 N/A N/A 2426 G ...gAAAAAAAAA --shared-files 152MiB |
+-----------------------------------------------------------------------------+
和
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
还有:
$ ls /usr/bin/cc
ls: cannot access '/usr/bin/cc': No such file or directory
22539/31772MB
[30303:30295 0:1999] 02:02:35 Thu Jan 07 [mona@goku:pts/0 +1] ~
$ gcc --version
gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21803/31772MB
[30303:30295 0:2000] 02:07:43 Thu Jan 07 [mona@goku:pts/0 +1] ~
$ g++ --version
g++ (Ubuntu 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21861/31772MB
[30303:30295 0:2001] 02:07:47 Thu Jan 07 [mona@goku:pts/0 +1] ~
$ cmake --version
cmake version 3.16.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
21851/31772MB
[30303:30295 0:2002] 02:07:51 Thu Jan 07 [mona@goku:pts/0 +1] ~
$ lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
21851/31772MB
【问题讨论】:
sudo ln -s /usr/bin/gcc-7 /usr/bin/cc
非常感谢,它适用于 gcc,对于 c++,我应该说 /bin/sh: 1: /usr/bin/c++: not found sudo ln -s /usr/bin/g++-7 /usr/bin/c++
?谢谢@RobertCrovella
@RobertCrovella 成功了。您能否将其添加为答案?真棒pastebin.com/raw/6SbX7aka
【参考方案1】:
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/cc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/c++
感谢 Robert Crovella 的回答。
【讨论】:
以上是关于将 GCC 9.3.0 降级到 7 以用于 openpose 后,cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake 出现 CMa的主要内容,如果未能解决你的问题,请参考以下文章