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

[BUG] nanovdb::tools::cuda::voxelToGrid fails to free memory when launched with a non default stream. #1945

Open
ZephirFXEC opened this issue Oct 26, 2024 · 0 comments
Labels

Comments

@ZephirFXEC
Copy link

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.

@ZephirFXEC ZephirFXEC added the bug label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant