I’m using 15_multi_video_encode sample. I modified the sample so I can use run CUDA kernels on the buffer based on the sample 02_video_dec_cuda.
Everything seems to work. The application is running fine with several channels (running 4 at moment) and I can see the encoded packets for all channels.
From time to time I’m getting an exception in the call cuGraphicsEGLRegisterImage. It’s Segmentation Fault exception.
status = cuGraphicsEGLRegisterImage(&pResource, *image, CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE);
The parameter *image has a valid value and pResouce is supposed to be populated by the function. So I don’t really understand what the SegFault come fromes.
Here’s my system info:
Can someone how can I solve this problem?
Please share a patch to 15 sample. So that we can replicate the issue and check further.
Just in case someone has the same issue.
The documentation of the function says:
“The application will be responsible for synchronizing access to shared objects. The application must ensure that any pending operation which access the objects have completed before passing control to CUDA. This may be accomplished by issuing and waiting for glFinish command on all GLcontexts (for OpenGL and likewise for other APIs). The application will be also responsible for ensuring that any pending operation on the registered CUDA resource has completed prior to executing subsequent commands in other APIs accesing the same memory objects. This can be accomplished by calling cuCtxSynchronize or cuEventSynchronize (preferably).”
In my case I was having and encoder and a decoder both mapping to CUDA buffers.
Turns out that the call must be thread safe among all threads including decoder and encoder threads. I was only protecting the threads from one or the other.
Once I unify the call in the same function and I protected it with a mutex everything started working
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.