NVIDIA-AI-IOT / CUDA-PointPillars

A project demonstrating how to use CUDA-PointPillars to deal with cloud points data from lidar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Found two crashes caused by two defects in preprocess_kernels.cu

arnoldfychen opened this issue · comments

Hello, we saw sometime crashes happened in our application with CUDA-PointPillars integrated, after investigated and found the causes are in preprocess_kernels.cu.

  1. in generateVoxels_random_kernel():

    int voxel_idx = floorf((point.x - min_x_range)/pillar_x_size);
    int voxel_idy = floorf((point.y - min_y_range)/pillar_y_size);
    our grid_y_size is 320, when (point.y - min_y_range)/pillar_y_size == 319.999998, voxel_idy = floorf(319.999998), the value of voxel_idy is 320 not 319 ! voxel_idy == grid_y_size, this caused invalid out-of-bounding access to mask and voxels, and the memory was then corrupted, so, a crash happened accordingly.

  2. in generateBaseFeatures_kernel():
    current_pillarId = atomicAdd(pillar_num, 1);
    Hereafter no checking is done for current_pillarId, if there are points scattering in a very large range and current_pillarId is greater than MAX_VOXELS(40000), memory will be corrupted by "((float4*)voxel_features)[outIndex] = ((float4*)voxels)[inIndex];" because of invalid out-of-bounding access to voxel_features.

Did a sample fix here: arnoldfychen@2c9c4a1
then no crash was seen.