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

CUDA crashes when building too small a dataset #218

Open
taiya opened this issue Nov 14, 2014 · 0 comments · May be fixed by #437
Open

CUDA crashes when building too small a dataset #218

taiya opened this issue Nov 14, 2014 · 0 comments · May be fixed by #437

Comments

@taiya
Copy link

taiya commented Nov 14, 2014

Spent two hours narrowing down the problem.... turns out the issue was simply the size of the dataset.

#define FLANN_USE_CUDA
#include <flann_cuda/flann.hpp>
#include <thrust/device_vector.h>
int main(int argc, char** argv)
{
    // int n_points = 10; ///< ERROR HERE!!!
    int n_points = 1000; ///< RUNS JUST FINE
    thrust::device_vector<float4>  points_vector( n_points );
    float* gpu_pointer = (float*)thrust::raw_pointer_cast(&points_vector[0]);
    flann::Matrix<float> matrix_gpu(gpu_pointer,n_points,3, 4);
    flann::KDTreeCuda3dIndexParams params;
    params["input_is_gpu_float4"]=true;
    flann::Index<flann::L2<float> > flannindex( matrix_gpu, params  );
    flannindex.buildIndex();
    return 0;
}

and this is the error

Starting /Users/andrea/Developer/htrack/apps/flann_gpu-build/flann_gpu...
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  invalid argument
The program has unexpectedly finished.
neka-nat pushed a commit to neka-nat/flann that referenced this issue Dec 2, 2019
@neka-nat neka-nat linked a pull request Dec 2, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant