-
Notifications
You must be signed in to change notification settings - Fork 649
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
Can't get the cuda test working ! #240
Comments
Hi. It seems that you have written to the wrong guy. Sorry for not being Good luck with you hdf5 installation! 2015-05-13 18:42 GMT+08:00 Emie31 [email protected]:
|
Hi again, Sorry, for my unclear question ! I'm trying to use the GPU version of flann to get all the 3D points inside a sphere. The CPU version of the library is working well, but I can't get the GPU version working. for the GPU version In my code I just add : #define FLANN_USE_CUDA
#include <flann/flann.h>
std::vector<double> v_ptr(vertices.size() * 3);
for (unsigned int i = 0; i < vertices.size(); i++)
{
for (unsigned int j = 0; j < 3; j++)
{
v_ptr[i * 3 + j] = vertices[i].p()[j];
}
}
flann::Matrix<double> dataset(&v_ptr[0], vertices.size(), 3);
flann::Matrix<double> query(&v_ptr[0], vertices.size(), 3);
flann::Matrix<int> indices(new int[query.rows * 3], query.rows, 3);
flann::Matrix<double> dists(new double[query.rows * 3], query.rows, 3);
// construct an randomized kd-tree index using 4 kd-trees
flann::Index<L2_Simple<double> > index(dataset, flann::KDTreeCuda3dIndexParams());
index.buildIndex(); and I linked to libflann, libflann_cpp and libflann_cuda but I keep getting the 2 following errors: In function `flann::KDTreeCuda3dIndex<flann::L2_Simple<double> >::~KDTreeCuda3dIndex()':
tmpxft_0000492e_00000000-4_Cuda_GLS.cudafe1.cpp:(.text._ZN5flann17KDTreeCuda3dIndexINS_9L2_SimpleIdEEED2Ev[_ZN5flann17KDTreeCuda3dIndexINS_9L2_SimpleIdEEED5Ev]+0x3f): undefined reference to `flann::KDTreeCuda3dIndex<flann::L2_Simple<double> >::clearGpuBuffers()'
In function `flann::KDTreeCuda3dIndex<flann::L2_Simple<double> >::buildIndex()':
tmpxft_0000492e_00000000-4_Cuda_GLS.cudafe1.cpp:(.text._ZN5flann17KDTreeCuda3dIndexINS_9L2_SimpleIdEEE10buildIndexEv[_ZN5flann17KDTreeCuda3dIndexINS_9L2_SimpleIdEEE10buildIndexEv]+0xaf): undefined reference to `flann::KDTreeCuda3dIndex<flann::L2_Simple<double> >::uploadTreeToGpu()' So I was guessing the cuda library might not be working. To check that I compile the flann_cuda_test (and it compiles fine). However when I try to run it, the test doesn't pass: guy@chewbacca:~/builds/flann/test$ ./flann_cuda_test
[==========] Running 8 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 3 tests from Flann_3D
[ RUN ] Flann_3D.KDTreeSingleTest
Reading test data...HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 0:
#000: ../../../src/H5D.c line 334 in H5Dopen2(): not found
major: Dataset
minor: Object not found
#001: ../../../src/H5Gloc.c line 430 in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
#002: ../../../src/H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
#003: ../../../src/H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
#004: ../../../src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 'indices' doesn't exist
major: Symbol table
minor: Object not found
unknown file: Failure
C++ exception with description "Error opening dataset in file." thrown in SetUp().
[ FAILED ] Flann_3D.KDTreeSingleTest (7 ms)
[ RUN ] Flann_3D.KDTreeCudaTest
Reading test data...HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 0:
#000: ../../../src/H5D.c line 334 in H5Dopen2(): not found
major: Dataset
minor: Object not found
#001: ../../../src/H5Gloc.c line 430 in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
#002: ../../../src/H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
#003: ../../../src/H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
#004: ../../../src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 'indices' doesn't exist
major: Symbol table
minor: Object not found
unknown file: Failure
C++ exception with description "Error opening dataset in file." thrown in SetUp().
[ FAILED ] Flann_3D.KDTreeCudaTest (2 ms)
[ RUN ] Flann_3D.TestRadiusSearch
Reading test data...HDF5-DIAG: Error detected in HDF5 (1.8.11) thread 0:
#000: ../../../src/H5D.c line 334 in H5Dopen2(): not found
major: Dataset
minor: Object not found
#001: ../../../src/H5Gloc.c line 430 in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
#002: ../../../src/H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
#003: ../../../src/H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
#004: ../../../src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 'indices' doesn't exist
major: Symbol table
minor: Object not found
unknown file: Failure
C++ exception with description "Error opening dataset in file." thrown in SetUp().
[ FAILED ] Flann_3D.TestRadiusSearch (1 ms)
[----------] 3 tests from Flann_3D (10 ms total)
[----------] 5 tests from Flann_3D_Random_Cloud
[ RUN ] Flann_3D_Random_Cloud.Test1NN
creating random point cloud (10000 points)...done
Building linear index...done (1e-06 seconds)
Searching KNN...done (0.727318 seconds)
Building kd-tree index...done (0.035195 seconds)
Searching KNN...done (0.000147 seconds)
/home/guy/builds/flann/test/flann_cuda_test.cu:252: Failure
Expected: (precision) >= (0.99), actual: 0 vs 0.99
Precision: 0
[ FAILED ] Flann_3D_Random_Cloud.Test1NN (764 ms)
[ RUN ] Flann_3D_Random_Cloud.Test4NN
creating random point cloud (10000 points)...done
Building linear index...done (1e-06 seconds)
Searching KNN...done (0.727468 seconds)
Building kd-tree index...done (0.004335 seconds)
Searching KNN...done (0.000138 seconds)
/home/guy/builds/flann/test/flann_cuda_test.cu:272: Failure
Expected: (precision) >= (0.99), actual: 2.5e-05 vs 0.99
Precision: 2.5e-05
[ FAILED ] Flann_3D_Random_Cloud.Test4NN (733 ms)
[ RUN ] Flann_3D_Random_Cloud.Test4NNGpuBuffers
creating random point cloud (10000 points)...done
Building linear index...done (1e-06 seconds)
Searching KNN...done (0.725263 seconds)
Building kd-tree index...done (0.004063 seconds)
Searching KNN...Segmentation fault (core dumped) but it looks like it is a different issue.. Do you have any idea of what I'm doing wrong and on how I can get the cuda lib working ? Thanks, |
Sorry for all the messages.. I finally found my mistake in my code. flann::Index<L2_Simple<double> > index(dataset, flann::KDTreeCuda3dIndexParams()); becomes : flann::Index<L2_Simple<float> > index(dataset, flann::KDTreeCuda3dIndexParams()); and it compiles now. |
Hello,
Thanks, |
Hello, I got the same error!
There doesn't exist 'indices' |
Hello !
Thanks a lot for the nice code you provide ! I've just installed it, and I want to use the cuda version of it.. So I first use the cmake option -DBUILD_CUDA_LIB, and I add to change the CUDA_NVCC_FLAGS so that it actually compiles with my architecture (-arch=sm_20). Now I try to get the tests working, but I'm running into an issue the HDF5 lib.. and I don't know how to deal with it !
Here is the error I get:
I've tried to install HDF5 using apt-get install libhdf5-mpi-dev, and also by compiling the source (from the library github) but nothing worked!
What am I missing ? I'm really new to this lib.. so I guess I missed some stupid step somewhere...
Could you help me on how to have this test working ?
Many Thanks!
The text was updated successfully, but these errors were encountered: