-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
GPU normal estimation does not work with CUDA 12 #5846
Comments
@jenadzitsiuk Are the normals okay? Is only the curvature zero? |
@mvieth oh, you are right.. I did not even check. All normals are (1, 0, 0). Looks like the above code did not work for normals computation. And the following code works fine on CPU for that point cloud:
Also, this code confirmed my points uploaded fine to GPU:
Anything I'm missing on GPU normals computation code? |
It seems to work if you use pcl::gpu::Feature::PointCloud gpu_surface;
gpu_surface.upload(input_cloud->points);
gpu_ne.setSearchSurface(gpu_surface); This might be a bug, will have to check |
if I do both To eliminate the possibility of bad input, I did this, full code:
@mvieth does the code above work fine for you? Side question: what does this max_result param mean in setRadiusSearch? |
Okay, something very weird is going on with the gpu octree. Unfortunately, I am not very familiar with it, so I will need some time for further testing. The problem might be somehow related to which GPU is used.
That is the maximum number of close points in the results for each query point. It is necessary to specify this because of the memory layout. Possibly related: #5731 |
Thanks for looking into this! Could you convert it to a bug, in order to address it? Thanks! |
@larshg Just a heads-up: Here is code to generate a sphere: for(int i = 0; i < numPoints; ++i) {
const float z = 2.0 * static_cast<float>(rand()) / RAND_MAX - 1.0; // Need z in [-1, 1]
const float theta = 2.0f * M_PI * static_cast<float>(rand()) / RAND_MAX; // Need theta in [0, 2 pi]
const float tmp = std::sqrt(1.0 - z*z);
sphere_cloud->emplace_back(radius * tmp * std::cos(theta),
radius * tmp * std::sin(theta),
radius * z);
} On Ubuntu 23.04, Quadro RTX 3000, CUDA 11.8, Thrust 1.17.2, it works fine. |
Woops, thanks for the headsup 🤣 |
Update:
Yes, might be. |
I read in some of the other threads linked to, that if they compiled for a lower architecture, ie. 60, it still worked. But not all experienced the same. |
Building for architecture 60 instead did not solve the problem for me. |
I just updated CUDA to v12.3 and I can't reproduce any errors. Neither in the PCL code nor your thrust only example. CUDA 12.3 comes with Thrust 2.2.0. So it seems your assumptions is correct 👍 |
I created an issue for the Thrust developers, and apparently this was fixed very recently on their side. The fix was not yet included in the 2.2.0 release, but I would assume that it will be included in the next release.
|
PCL 1.13
Cuda 12.2
Ubuntu 22.04
Is there a way to get normal's curvature for GPU module, similar how its done on CPU? (there its stored in
Normal::curvature
)This thread suggests to use
data[3]
fromPointXYZ
, hovewer it does not give me any results (zeros there)The text was updated successfully, but these errors were encountered: