By migrating point cloud parsing tasks to the GPU, not only can CPU computing resources be freed up, but the speed and efficiency of point cloud data parsing can also be effectively improved to a certain extent.
Using GPU for point cloud parsing requires proper installation of graphics drivers and CUDA environment.
- Enter
nvidia-smicommand in terminal to see current GPU information. If not installed, refer to: NVIDIA-DRIVERS - Enter
nvcc -Vcommand in terminal to see current CUDA version. If not installed, refer to: CUDA-DOWNLOADS
Please refer to the operations in Compile Macro Control to configure the macro FIND_CUDA to take effect, and add the cuda parameter when running.
Refer to How to Parse Lidar Data Online and How to Parse PCAP File Data Offline
In the HesaiLidar_SDK_2.0 folder, open a terminal and execute the following commands:
cd HesaiLidar_SDK_2.0
mkdir -p build
cd build
cmake .. -DFIND_CUDA=true
makeAfter successful compilation, run the generated executable file in the build folder. To use GPU parsing, please add the cuda parameter:
./sample cuda1 If multiple CUDA versions are installed, you can specify the CUDA version path in CMakeLists.txt:
# if install different cuda version, set the cuda path, like cuda-11.4
# set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-11.4/)Actually use use_gpu in DriverParam to control whether GPU parsing is enabled. In the main function of test.cc, control whether GPU parsing is enabled by assigning param.use_gpu