Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Runtime error] thrust::system::system_error, Two parts of codes work fine separately, but doesn't work together. #4700

Closed
TuMePJlaH opened this issue Apr 14, 2021 · 5 comments
Labels
kind: bug Type of issue status: triage Labels incomplete

Comments

@TuMePJlaH
Copy link

TuMePJlaH commented Apr 14, 2021

PCL version: 1.11.1 (build from last master branch);
OS: Ubuntu 20.04.
Compiler: GCC 9.3.0
GPU: GeForce RTX 2080Ti
CUDA Toolkit version: 11.1

Init cloud code:

pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
int y_size = 100;
int x_size = 100;
cloud->is_dense = true;
for (int y = 0; y < y_size; ++y) {
  for(int x = 0; x < x_size; ++x) {
    pcl::PointXYZ p(x, y, 0.0f);
    cloud->push_back(p);
  }
}
pcl::gpu::NormalEstimation::PointCloud cloud_device;
cloud_device.upload(cloud->points);

This code work fine:

pcl::gpu::Octree octree_device;
octree_device.setCloud(cloud_device);
octree_device.build();
int max_ans = 100;
pcl::gpu::NeighborIndices indices;
octree_device.radiusSearch(cloud_device, 10.1, max_ans, indices);

And this code work fine:

pcl::gpu::NeighborIndices indices = createNeighboursIndices(cloud, 150);
pcl::gpu::NormalEstimation ne;
pcl::gpu::NormalEstimation::Normals normals;
pcl::gpu::NormalEstimation::computeNormals(cloud_device, indices, normals);

But this code (previous two parts of codes together):

pcl::gpu::Octree octree_device;
octree_device.setCloud(cloud_device);
octree_device.build();
int max_ans = 100;
pcl::gpu::NeighborIndices indices;
octree_device.radiusSearch(cloud_device, 10.1, max_ans, indices);

pcl::gpu::NormalEstimation ne;
pcl::gpu::NormalEstimation::Normals normals;
pcl::gpu::NormalEstimation::computeNormals(cloud_device, indices, normals);

and this code too (previous two parts of codes together):

pcl::gpu::NeighborIndices indices = createNeighboursIndices(cloud, 150);
pcl::gpu::NormalEstimation ne;
pcl::gpu::NormalEstimation::Normals normals;
pcl::gpu::NormalEstimation::computeNormals(cloud_device, indices, normals);

pcl::gpu::Octree octree_device;
octree_device.setCloud(cloud_device);
octree_device.build();
int max_ans = 100;
pcl::gpu::NeighborIndices indices2;
octree_device.radiusSearch(cloud_device, 10.1, max_ans, indices2);

aborted with runtime error:
terminate called after throwing an instance of 'thrust::system::system_error'
what(): radix_sort: failed on 2nd step: cudaErrorInvalidConfiguration: invalid configuration argument
Aborted (core dumped)

@TuMePJlaH TuMePJlaH added kind: bug Type of issue status: triage Labels incomplete labels Apr 14, 2021
@TuMePJlaH TuMePJlaH changed the title [Runtime error] thrust::system::system_error, cudaErrorInvalidConfiguration: invalid configuration argument [Runtime error] thrust::system::system_error, Two parts of codes work fine separately, but doesn't work together. Apr 14, 2021
@ueqri
Copy link
Contributor

ueqri commented Apr 14, 2021

The error comes from an unresolved bug from Thrust library, when using the thrust::sort and thrust::sort_by_key.

Similar issue here: NVIDIA/thrust#936, and it seems that this error could be a result of a architecture mismatch, not very sure.

Did you provide CUDA_ARCH_BIN as the real compute capabilities of GPU for CMake command? If not, you can try to specify the arch for compile. For GeForce RTX 2080Ti , this can be -DCUDA_ARCH_BIN="7.5" exactly. I hope this could help for now.

@TuMePJlaH
Copy link
Author

Thanks for your reply!
I set CUDA_ARCH_BIN to 7.5 and re-compiled PCL.
But it did not help.

@kunaltyagi
Copy link
Member

Doesn't seem like a bug in PCL (directly), so I'm in favor of closing the issue, but letting the discussion continue. Thoughts @mvieth?

@mvieth
Copy link
Member

mvieth commented Apr 18, 2021

I agree, seems like that can only be solved in the thrust library. They are asking for a minimal reproducible example, so if someone who experiences this bug can create such an example, that would surely help fixing this bug.

@kunaltyagi
Copy link
Member

Ack. Closing the issue here.

@TuMePJlaH if you could assist Thrust in resolving this issue, that'd be great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Type of issue status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

4 participants