Skip to content

CUDA crashes when building too small a dataset #218

@taiya

Description

@taiya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions