Hi,
I am trying to create a CUDA application that applies an processing algorithm to each video frame decoded from a video file (H264).
I downloaded the multimedia API from the Jetson Download Center (both releases 32.2.1 and 28.3.1) and compiled the sample 02 (video decoder + cuda).
The sample 02 is supposed to draw a square (32 x 32) on top of the video decoded, however, I can see no square at all. Video displays fine.
I tried in the the Nano and in the Xavier. Both behave the same way.
I tried to change the square color/size but never was able to see any square. and changed the kernel call in different ways to try to display something, always unsuccessful
However, a call to a CudaMemset applies the color to the screen fine. The problem appears to be only when kernel calls happen
from tegra_multimedia_api/samples/common/algorithm/cuda/NvCudaProc.cpp
/**
* Performs CUDA Operations on egl image.
*
* @param image : EGL image
*/
static void
Handle_EGLImage(EGLImageKHR image)
{
CUresult status;
CUeglFrame eglFrame;
CUgraphicsResource pResource = NULL;
cudaFree(0);
status = cuGraphicsEGLRegisterImage(&pResource, image,
CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE);
if (status != CUDA_SUCCESS)
{
printf("cuGraphicsEGLRegisterImage failed: %d, cuda process stop\n",
status);
return;
}
status = cuGraphicsResourceGetMappedEglFrame(&eglFrame, pResource, 0, 0);
if (status != CUDA_SUCCESS)
{
printf("cuGraphicsSubResourceGetMappedArray failed\n");
}
status = cuCtxSynchronize();
if (status != CUDA_SUCCESS)
{
printf("cuCtxSynchronize failed\n");
}
if (eglFrame.frameType == CU_EGL_FRAME_TYPE_PITCH)
{
//Rect label in plan Y, you can replace this with any cuda algorithms.
//addLabels((CUdeviceptr) eglFrame.frame.pPitch[0], eglFrame.pitch); //does not display any square or anything
<b> cudaMemset((void *)eglFrame.frame.pPitch[0], 120, eglFrame.pitch)</b> //displays a gray line
}
status = cuCtxSynchronize();
if (status != CUDA_SUCCESS)
{
printf("cuCtxSynchronize failed after memcpy\n");
}
status = cuGraphicsUnregisterResource(pResource);
if (status != CUDA_SUCCESS)
{
printf("cuGraphicsEGLUnRegisterResource failed: %d\n", status);
}
}
So, did anybody ever get kernel calls to change a buffer using this Multimedia API?