spencer-project / spencer_people_tracking

Multi-modal ROS-based people detection and tracking framework for mobile robots developed within the context of the EU FP7 project SPENCER.
http://www.spencer.eu/
667 stars 327 forks source link

1 catastrophic error detected in the compilation of "../../libcudaHOG/cudaHOG/blocks.cu". #100

Open frequiem11 opened 3 years ago

frequiem11 commented 3 years ago

I'm using Ubuntu 18.04, ROS Melodic. I have GTX 960M. I have successfully followed the instructions on how to build spencer-project from source. I can run roslaunch spencer_people_tracking_launch tracking_single_rgbd_sensor.launch height_above_ground:=1.6 command and see the results with my RGB-D camera. Then I try to install libcudaHOG package to include cudaHOG for advanced detection.

My CUDA drivers are given below.

nvidia-smi Fri Aug 20 11:27:59 2021
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 | |-------------------------------+----------------------+----------------------+ | 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 NVIDIA GeForce ... On | 00000000:01:00.0 Off | N/A | | N/A 54C P8 N/A / N/A | 517MiB / 2004MiB | 4% Default | | | | N/A | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 1266 G /usr/lib/xorg/Xorg 194MiB | | 0 N/A N/A 1547 G /usr/bin/gnome-shell 118MiB | | 0 N/A N/A 24168 G /usr/lib/firefox/firefox 139MiB | | 0 N/A N/A 24422 G /usr/lib/firefox/firefox 1MiB | | 0 N/A N/A 24637 G .../debug.log --shared-files 20MiB | | 0 N/A N/A 25081 G /usr/lib/firefox/firefox 1MiB | | 0 N/A N/A 25154 G /usr/lib/firefox/firefox 1MiB | | 0 N/A N/A 25474 G ...AAAAAAAAA= --shared-files 30MiB | +-----------------------------------------------------------------------------+

I was following the instructions on given here. Then I have faced with gpu-architecture problem. It gave me "nvcc fatal : Value 'sm_30' is not defined for option 'gpu-architecture'" error. Then I run nvcc --help|grep "Allowed values for this option" -n to see available architectures.

161: Allowed values for this option: 'none','shared','static'. 167: Allowed values for this option: 'none','static'. 205: Allowed values for this option: 'inline'. 243: Allowed values for this option: 'c','c++','cu'. 248: Allowed values for this option: 'c++03','c++11','c++14','c++17'. 271: Allowed values for this option: 32,64. 444: Allowed values for this option: 'compute_35','compute_37','compute_50', 470: Allowed values for this option: 'compute_35','compute_37','compute_50', 562: Allowed values for this option: 'legacy','null','per-thread'. 616: Allowed values for this option: 'all-warnings','cross-execution-space-call',

So I opened detection>monocular_detectors > 3rd_party > build > libcudaHOG > src > libcudaHOG-build > cudaHOG > MakeFile and I changed all nvcc -arch=sm_30 to nvcc -arch=compute_35

So at the end it looks like this :

compiler_cu_make_all: gradients.o padding.o conversions.o blocks.o hog.o descriptor.o svm.o timer.o detections.o nms.o compiler_cu_clean: -$(DEL_FILE) gradients.o padding.o conversions.o blocks.o hog.o descriptor.o svm.o timer.o detections.o nms.o gradients.o: ../../libcudaHOG/cudaHOG/gradients.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o gradients.o ../../libcudaHOG/cudaHOG/gradients.cu

padding.o: ../../libcudaHOG/cudaHOG/padding.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o padding.o ../../libcudaHOG/cudaHOG/padding.cu

conversions.o: ../../libcudaHOG/cudaHOG/conversions.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o conversions.o ../../libcudaHOG/cudaHOG/conversions.cu

blocks.o: ../../libcudaHOG/cudaHOG/blocks.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o blocks.o ../../libcudaHOG/cudaHOG/blocks.cu

hog.o: ../../libcudaHOG/cudaHOG/hog.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o hog.o ../../libcudaHOG/cudaHOG/hog.cu

descriptor.o: ../../libcudaHOG/cudaHOG/descriptor.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o descriptor.o ../../libcudaHOG/cudaHOG/descriptor.cu

svm.o: ../../libcudaHOG/cudaHOG/svm.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o svm.o ../../libcudaHOG/cudaHOG/svm.cu

timer.o: ../../libcudaHOG/cudaHOG/timer.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o timer.o ../../libcudaHOG/cudaHOG/timer.cu

detections.o: ../../libcudaHOG/cudaHOG/detections.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o detections.o ../../libcudaHOG/cudaHOG/detections.cu

nms.o: ../../libcudaHOG/cudaHOG/nms.cu nvcc -arch=compute_35 -Xcompiler -fPIC -Xcompiler -pipe $(DEFINES) $(INCPATH) -Dcplusplus=201402L -DGNUC=7 -DGNUC_MINOR=5 -DGNUC_PATCHLEVEL__=0 -c -o nms.o ../../libcudaHOG/cudaHOG/nms.cu

When I try to install after these changes, it gave me another error. The terminal looks like this:

[ 12%] Performing build step for libcudaHOG

nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). ../../libcudaHOG/cudaHOG/blocks.cu(201): warning: function "tex2D(texture<T, 2, cudaReadModeElementType>, float, float) [with T=float]" /usr/local/cuda-11.4/bin/../targets/x86_64-linux/include/texture_fetch_functions.h(198): here was declared deprecated

../../libcudaHOG/cudaHOG/blocks.cu(219): warning: function "tex2D(texture<T, 2, cudaReadModeElementType>, float, float) [with T=float4]" /usr/local/cuda-11.4/bin/../targets/x86_64-linux/include/texture_fetch_functions.h(198): here was declared deprecated

start of expression operator: ?, result type: float operator: >, result type: bool operator: [], result type: float operator: array-decay, result type: ptr to volatile float [lvalue] operator: [], result type: array [9] of volatile float operator: array-decay, result type: ptr to array [9] of volatile float [lvalue] operator: [], result type: array [4] of array [9] of volatile float operator: array-decay, result type: ptr to array [4] of array [9] of volatile float [lvalue] variable: name = s_block, node type: array [32] of array [4] of array [9] of volatile float constant: value = 0 operator: ., result type: unsigned int [lvalue] variable: name = threadIdx, node type: const typeref "uint3" struct uint3 field uint3::x variable: name = j, node type: int constant: value = (0.2F) variable: name = clipThreshold, node type: float [lvalue] variable: name = clipThreshold, node type: const float [lvalue] operator: [], result type: volatile float operator: array-decay, result type: ptr to volatile float [lvalue] operator: [], result type: array [9] of volatile float operator: array-decay, result type: ptr to array [9] of volatile float [lvalue] operator: [], result type: array [4] of array [9] of volatile float operator: array-decay, result type: ptr to array [4] of array [9] of volatile float [lvalue] variable: name = s_block, node type: array [32] of array [4] of array [9] of volatile float constant: value = 0 operator: ., result type: unsigned int [lvalue] variable: name = threadIdx, node type: const typeref "uint3" struct uint3 field uint3::x variable: name = j, node type: int end of expression ../../libcudaHOG/cudaHOG/blocks.cu(271): internal error: is_lvalue incorrectly set

1 catastrophic error detected in the compilation of "../../libcudaHOG/cudaHOG/blocks.cu". Compilation aborted. Aborted (core dumped) Makefile:428: recipe for target 'blocks.o' failed make[4]: [blocks.o] Error 134 Makefile:46: recipe for target 'sub-cudaHOG-make_first' failed make[3]: [sub-cudaHOG-make_first] Error 2 CMakeFiles/libcudaHOG.dir/build.make:116: recipe for target 'libcudaHOG/src/libcudaHOG-stamp/libcudaHOG-build' failed make[2]: [libcudaHOG/src/libcudaHOG-stamp/libcudaHOG-build] Error 2 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/libcudaHOG.dir/all' failed make[1]: [CMakeFiles/libcudaHOG.dir/all] Error 2 Makefile:129: recipe for target 'all' failed

There is not problem to compile gradients.o, padding.o, conversions.o but when it comes to compile blocks.o, it gives me the error given above. I couldn't see any error like this on the web. What should I do?

frequiem11 commented 3 years ago

I figured it out I guess. You may encounter with this error if you are using CUDA 11 or later versions. You have to change line 271 in blocks.cu to if (s_block[0][threadIdx.x][j] > clipThreshold) { s_block[0][threadIdx.x][j] = clipThreshold; }

then you can command make and build the package.