{"action":"closed","issue":{"url":"https://api.github.com/repos/CMU-Perceptual-Computing-Lab/openpose/issues/478","repository_url":"https://api.github.com/repos/CMU-Perceptual-Computing-Lab/openpose","labels_url":"https://api.github.com/repos/CMU-Perceptual-Computing-Lab/openpose/issues/478/labels{/name}","comments_url":"https://api.github.com/repos/CMU-Perceptual-Computing-Lab/openpose/issues/478/comments","events_url":"https://api.github.com/repos/CMU-Perceptual-Computing-Lab/openpose/issues/478/events","html_url":"https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/478","id":304086903,"number":478,"title":"Unable to (cross-/)compile OpenPose for TK1","user":{"login":"alvaroga91","id":4558489,"avatar_url":"https://avatars0.githubusercontent.com/u/4558489?v=4","gravatar_id":"","url":"https://api.github.com/users/alvaroga91","html_url":"https://github.com/alvaroga91","followers_url":"https://api.github.com/users/alvaroga91/followers","following_url":"https://api.github.com/users/alvaroga91/following{/other_user}","gists_url":"https://api.github.com/users/alvaroga91/gists{/gist_id}","starred_url":"https://api.github.com/users/alvaroga91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvaroga91/subscriptions","organizations_url":"https://api.github.com/users/alvaroga91/orgs","repos_url":"https://api.github.com/users/alvaroga91/repos","events_url":"https://api.github.com/users/alvaroga91/events{/privacy}","received_events_url":"https://api.github.com/users/alvaroga91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-10T17:14:11Z","updated_at":"2018-03-28T06:35:20Z","closed_at":"2018-03-28T06:35:20Z","author_association":"NONE","body":"### Issue Summary\r\nHi there, \r\nI've been trying to have OpenPose working in the TK1, CUDA 6.5, but after several attemps I've been able to isolate the main issue and I come here seeking for some help. Needless to say, I've already read _several times_ all the issues regarding the TK1 (mainly [this](https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/44) and [this](https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/58)).\r\n\r\nIn both of the following situations, I've managed to reproduce the error by trying to compile a single .cu (openpose/src/openpose/core/resizeAndMergeBase.cu, but tested with others with same outcome) from OpenPose through command line (with a nvcc command and its corresponding flags/paths). This is what I'll be posting, but take into account that the same error appears when I launch \"make all\" in my OpenPose build, but this is much more readable imho\r\n\r\nAlso, I've been able to compile natively in both a VM Ubuntu 14.04_x86 and \"Real machine\" 16.04_x64, so I have some knowledge of the OpenPose environment. In both scenarios, compilation went flawlessly but in the VM it never launched since VMs do not offer CUDA support. \r\n\r\nFor this process of trying to compile  I've followed 2 ways with different errors: Native compilation and cross-compilation.\r\n\r\n### Native complation testing\r\n\r\nNative compilation in the TK1. I could install all the dependencies with apt-get and got Caffe compiled as well. But when nvcc in OpenPose comes to play... error. \r\n\r\nThis was the command tested\r\n\r\n$ /usr/local/cuda-6.5/bin/nvcc -I/home/ubuntu/OpenPose/openpose/include -std=c++11 -G -g -O0 --compile --relocatable-device-code=false -gencode arch=compute_20,code=compute_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -x cu -o  Test.o resizeAndMergeBase.cu \r\n\r\nAnd the error was: \r\nresizeAndMergeBase.cu(80): internal error: assertion failed at: \"/dvs/p4/build/sw/rel/gpu_drv/r343/r343_00/drivers/compiler/edg/EDG_4.8/src/decl_inits.c\", line 3135\r\n\r\nUnluckily, I was not only the one with these error overall in the internet with pretty much no solution:\r\n[Post 1](https://devtalk.nvidia.com/default/topic/988913/jetson-tk1/a-catastrophic-error-detected-in-the-compilation-of-cuckoohash-/)\r\n[Post 2](http://blog.csdn.net/shenck1992/article/details/59113298)\r\n[Post 3](https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/44)\r\n[Post 4 ](https://github.com/tensorflow/tensorflow/issues/3786)\r\n\r\nThis is what I got with **-DCUDA_VERBOSE_BUILD=ON.**\r\n\r\nubuntu@tegra-ubuntu:~/OpenPose/openpose/build$ make all\r\n/usr/bin/cmake -H/home/ubuntu/OpenPose/openpose -B/home/ubuntu/OpenPose/openpose/build --check-build-system CMakeFiles/Makefile.cmake 0\r\n/usr/bin/cmake -E cmake_progress_start /home/ubuntu/OpenPose/openpose/build/CMakeFiles /home/ubuntu/OpenPose/openpose/build/CMakeFiles/progress.marks\r\nmake -f CMakeFiles/Makefile2 all\r\nmake[1]: Entering directory `/home/ubuntu/OpenPose/openpose/build'\r\nmake -f src/openpose/CMakeFiles/openpose.dir/build.make src/openpose/CMakeFiles/openpose.dir/depend\r\nmake[2]: Entering directory `/home/ubuntu/OpenPose/openpose/build'\r\n/usr/bin/cmake -E cmake_progress_report /home/ubuntu/OpenPose/openpose/build/CMakeFiles 8\r\n[  1%] Building NVCC (Device) object src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\ncd /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand && /usr/bin/cmake -E make_directory /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/.\r\ncd /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand && /usr/bin/cmake -D verbose:BOOL=ON -D build_configuration:STRING= -D generated_file:STRING=/home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o -D generated_cubin_file:STRING=/home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o.cubin.txt -P /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.cmake\r\n-- Removing /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\n/usr/bin/cmake -E remove /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\n-- Generating dependency file: /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.NVCC-depend\r\n/usr/local/cuda-6.5/bin/nvcc -M -D__CUDACC__ /home/ubuntu/OpenPose/openpose/src/openpose/hand/renderHand.cu -o /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.NVCC-depend -ccbin /usr/bin/cc -m32 -DUSE_CAFFE -DUSE_CUDA -Dopenpose_EXPORTS -Xcompiler ,\\\"-fPIC\\\",\\\"-g\\\" -gencode arch=compute_32,code=sm_32 -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used -std=c++11 -DNVCC -I/usr/local/cuda-6.5/include -I/usr/include/opencv -I/usr/include -I/home/ubuntu/OpenPose/openpose/include -I/home/ubuntu/OpenPose/openpose/”/home/ubuntu/OpenPose/openpose/3rdparty/caffe/include” -I/home/ubuntu/OpenPose/openpose/PUBLIC -I/usr/local/cuda-6.5/include\r\n-- Generating temporary cmake readable file: /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp\r\n/usr/bin/cmake -D input_file:FILEPATH=/home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.NVCC-depend -D output_file:FILEPATH=/home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp -P /usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake\r\n-- Copy if different /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp to /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend\r\n/usr/bin/cmake -E copy_if_different /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend\r\n-- Removing /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp and /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.NVCC-depend\r\n/usr/bin/cmake -E remove /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.depend.tmp /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/openpose_generated_renderHand.cu.o.NVCC-depend\r\n-- Generating /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\n/usr/local/cuda-6.5/bin/nvcc /home/ubuntu/OpenPose/openpose/src/openpose/hand/renderHand.cu -c -o /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o -ccbin /usr/bin/cc -m32 -DUSE_CAFFE -DUSE_CUDA -Dopenpose_EXPORTS -Xcompiler ,\\\"-fPIC\\\",\\\"-g\\\" -gencode arch=compute_32,code=sm_32 -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used -std=c++11 -DNVCC -I/usr/local/cuda-6.5/include -I/usr/include/opencv -I/usr/include -I/home/ubuntu/OpenPose/openpose/include -I/home/ubuntu/OpenPose/openpose/”/home/ubuntu/OpenPose/openpose/3rdparty/caffe/include” -I/home/ubuntu/OpenPose/openpose/PUBLIC -I/usr/local/cuda-6.5/include\r\n/home/ubuntu/OpenPose/openpose/include/openpose/hand/handParameters.hpp(15): internal error: assertion failed at: \"/dvs/p4/build/sw/rel/gpu_drv/r343/r343_00/drivers/compiler/edg/EDG_4.8/src/decl_inits.c\", line 3135\r\n\r\n\r\n1 catastrophic error detected in the compilation of \"/tmp/tmpxft_00001206_00000000-6_renderHand.cpp1.ii\".\r\nCompilation aborted.\r\nAborted\r\n-- Removing /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\n/usr/bin/cmake -E remove /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\nCMake Error at openpose_generated_renderHand.cu.o.cmake:264 (message):\r\n  Error generating file\r\n  /home/ubuntu/OpenPose/openpose/build/src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o\r\n\r\n\r\nmake[2]: *** [src/openpose/CMakeFiles/openpose.dir/hand/./openpose_generated_renderHand.cu.o] Error 1\r\nmake[2]: Leaving directory `/home/ubuntu/OpenPose/openpose/build'\r\nmake[1]: *** [src/openpose/CMakeFiles/openpose.dir/all] Error 2\r\nmake[1]: Leaving directory `/home/ubuntu/OpenPose/openpose/build'\r\nmake: *** [all] Error 2\r\n\r\n**-------OUTPUT ENDS HERE**\r\n\r\nEven though there were some comments from users [airobots](https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/44#issuecomment-329639845) and [cortinas](https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/58#issuecomment-307590244) (what a troll, arch 53 does not even work with CUDA 6.5, and the higher version of CUDNN you can install in TK1 is v2, which does not work with OpenPose), I was unable to have it working.\r\n\r\nNevertheless, I decided to take the harder and longer route: Cross-compilation. \r\n\r\n### Cross compilation testing\r\n\r\nI must say that crosscompiling all the requisites for Caffe have been a pain in the *** which involved lots of git cloning, library de-referencing and referencing, makefiles editing, scp'ing the libraries and headers from the TK1 to take the shorter way... At the end?The dependencies were slowly but steady solved, but at the end I got a bit fed up and never got Caffe compiled there, just compiled it in the TK1, tar'd the Caffe folder and brought it back. \r\n\r\nBack to CMake, lots of edition in order to change the binaries and libraries used from the native x86 to ARM cross-compiling (gcc-linaro 4.8.5). I finally managed no complains from CMake, and could generate the Makefile. But.. another error appeared. I managed to reproduce it again, but with this command: \r\n\r\n/usr/local/cuda-6.5/bin/nvcc -ccbin /home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -I/home/metal/OpenPose/arm/libs/include -I/home/metal/OpenPose/openpose/include  -G -g -O0 --compile --relocatable-device-code=false -std=c++11 -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=sm_20 -x cu -o Test.o resizeAndMergeBase.cu\r\n\r\nAnd the outcome was: \r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(91): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(93): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(99): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(101): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(109): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/Downloads/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.8.5/new(111): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/OpenPose/arm/libs/include/common_functions.h(91): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/OpenPose/arm/libs/include/common_functions.h(92): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/OpenPose/arm/libs/include/common_functions.h(145): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n/home/metal/OpenPose/arm/libs/include/common_functions.h(146): error: first parameter of allocation function must be of type \"size_t\"\r\n\r\n10 errors detected in the compilation of \"/tmp/tmpxft_00008b7a_00000000-6_resizeAndMergeBase.cpp1.ii\".\r\n\r\n**HOWEVER** I relaunched the command with no --ccbin (native gcc 4.8.4)\r\n\r\n/usr/local/cuda-6.5/bin/nvcc -I/home/metal/OpenPose/arm/libs/include -I/home/metal/OpenPose/openpose/include  -G -g -O0 --compile --relocatable-device-code=false -std=c++11 -gencode arch=compute_20,code=compute_20 -gencode arch=compute_20,code=sm_20 -x cu -o Test.o resizeAndMergeBase.cu\r\n(I left the arm headers on purpose)\r\n\r\n**AND IT WORKED**. Just some warnings (warning: integer conversion resulted in a change of sign) but compilation worked fine and my Test.o was created. \r\n\r\nI even tested with a more recent gcc-linaro 4.9.4 (which led me to hack the CUDA host_config header file to remove the error), which gave me quite a few errors more apart from the ones found in the 4.8.5:\r\n\r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/bits/alloc_traits.h(248): error: expected a \">\"\r\n          detected during instantiation of type \"std::allocator_traits<_Alloc>::__has_construct<_Tp, _Args...>\" \r\n(251): here\r\n\r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/type_traits(130): error: not a class or struct name\r\n          detected during:\r\n            instantiation of class \"std::__and_<_B1> [with _B1=<error-type>]\" \r\n(1957): here\r\n            instantiation of type \"std::_Require<<error-type>>\" \r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/bits/alloc_traits.h(251): here\r\n\r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/type_traits(1957): error: class \"std::__and_<<error-type>>\" has no member \"value\"\r\n          detected during instantiation of type \"std::_Require<<error-type>>\" \r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/bits/alloc_traits.h(251): here\r\n\r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/type_traits(1957): error: class \"std::enable_if<<error-constant>, void>\" has no member \"type\"\r\n          detected during instantiation of type \"std::_Require<<error-type>>\" \r\n/home/metal/Downloads/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/bits/alloc_traits.h(251): here\r\n\r\n14 errors detected in the compilation of \"/tmp/tmpxft_00008d23_00000000-6_resizeAndMergeBase.cpp1.ii\".\r\n\r\n\r\n\r\nIt has been a very long week sorting and solving many walls (you know, another day in the office), but I feel that the solution is right there, and it is the difference between having OpenPose working in the TK1 or not :') \r\n\r\nThanks\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"alvaroga91"}}