i am using a pbo as a cudagraphicsresource
to display a 8bit grayscale image calculated by a cuda kernel.
I copy the result to the pbo with a mapped pointer.
Everything works fine, except that the mapping, and getting the mapped pointer takes 2-3ms!
i am doing it like that:
cudaGraphicsMapResources(…)
cudaGraphicsResourceGetMappedPointer(…)
launch my kernel with the mapped pointer passed to it
cudaGraphicsUnmapResources(…)
The sdk samples are much faster, total performance is around 1000fps,
so i guess somehow mapping the pbo there takes much less time.
I am using visual studio 2008, cuda toolkit 3.2, my computer: MSI fx700, geforce 425m gpu.
What can cause the slow mapping of the graphics resource?
Did you set any hint flag for the type of mapping you’re making?
cudaGraphicsMapFlagsNone //Default; Assume resource can be read/written.
cudaGraphicsMapFlagsReadOnly //CUDA will not write to this resource.
cudaGraphicsMapFlagsWriteDiscard //CUDA will only write to and will not read from this resource.