Open
Description
Environment
Operating System: Windows 10
Version / Commit SHA: openvdb 11.0.0
Other: using Cuda 12.6
Describe the bug
When launching the function nanovdb::tools::cuda::voxelToGrid using a stream, it fails freeing memory here :
mMemPool.free(mData.d_keys, mData.pointsPerVoxel, mData.pointsPerVoxelPrefix, mData.pointsPerLeafPrefix, mData.pointsPerLeaf);
With the error message : CUDA error 1: invalid argument
the code that fails :
CudaResources<ValueOutT> resources(npoints, stream);
resources.template LoadPointData<ValueInT>(in_data, npoints, stream);
cudaStreamWaitEvent(stream, resources.beenCopied, 0);
auto handle = nanovdb::cudaVoxelsToGrid<ValueOutT>(resources.d_coords, npoints, voxelSize, stream);
nanovdb::NanoGrid<ValueOutT>* d_grid = handle.template deviceGrid<ValueOutT>();
the one that works :
CudaResources<ValueOutT> resources(npoints, stream);
resources.template LoadPointData<ValueInT>(in_data, npoints, stream);
cudaStreamWaitEvent(stream, resources.beenCopied, 0);
auto handle = nanovdb::cudaVoxelsToGrid<ValueOutT>(resources.d_coords, npoints, voxelSize);
nanovdb::NanoGrid<ValueOutT>* d_grid = handle.template deviceGrid<ValueOutT>();
Additional context
I reorganized the parameters so I can set a stream without having to set a BufferT.