[vtk-developers] vtkPistonMapper bug

David E DeMarle dave.demarle at kitware.com
Thu Aug 14 10:52:40 EDT 2014


Shinya,

Would you be please submit this patch to VTK's gerrit review to make it
easy to test and integrate your fix?

To do that (distilled from http://www.vtk.org/Wiki/VTK/Git/Develop)

$ git clone git://vtk.org/VTK.git
$ ./Utilities/SetupForDevelopment.sh
$ git checkout -b my-topic origin/master
$ edit Accelerators/Piston/vtkPistonMapper.cxx
$ compile and test locally
$ git add file1 file2 file3
$ git commit
$ git gerrit-push

Choose myself and Robert Maynard as reviewers please in the gerrit web page
for the change.

Thank you!

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, Aug 14, 2014 at 1:24 AM, Onogi Shinya <shinya.onogi at live.jp> wrote:

> Hi all:
>
> vtkPistonMapper calls vtkpiston::CudaRegisterBuffer in every gpu rendering
> (in vtkPistonMapper.cxx; L181-L186); however,
> cudaGraphicsUnregisterResource is never called. It results in a gpu
> resource issue when vtkPistonAlgorithm is updated several times.
>
> Quick solution I tested is followings:
> vtkPistonMapper.cxx
> 43   void CudaRegisterBuffer(struct cudaGraphicsResource **vboResource,
> 44                           GLuint vboBuffer);
> +    void CudaUnregisterBuffer(struct cudaGraphicsResource **vboResource);
>
> 148 if (this->Internal->BufferSize != 0)
> 149   {
> 150    // Release old buffer
> +      vtkpiston::CudaUnregisterResource(this->Internal->vboResources[0]);
> +      vtkpiston::CudaUnregisterResource(this->Internal->vboResources[1]);
> +      vtkpiston::CudaUnregisterResource(this->Internal->vboResources[2]);
> 151    vtkgl::DeleteBuffers(3, this->Internal->vboBuffers);
>
> vtkPistonMapper.cu
> void CudaUnregisterResource(struct cudaGraphicsResource *vboResource)
> {
>   cudaError_t res = cudaGraphicsUnregisterResource(vboResource);
>   if (res != cudaSuccess)
>   {
>     cerr << "Unregister buffer failed ... " << cudaGetErrorString(res) <<
> endl;
>     return;
>   }
> }
>
> But, register/unregister in every rendering wouldn't be needed according
> to samples of gl interop with cuda.
> Thnaks,
> Shinya
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20140814/03fe2199/attachment-0002.html>


More information about the vtk-developers mailing list