Platform: Jetson
DS: 4.0.2
Jetpack: 4.3
TensorRT: 6.0
I’m encountering an odd issue with the data size for the frame. The exact same code works perfectly fine on a dGPU, but on Jetson it gives slight off values.
For example, if I print out the dataSize of the surface object
dst_surface->surfaceList[0].dataSize
Using: nvbufsurface_create_params.colorFormat = NVBUF_COLOR_FORMAT_RGB
dGPU: 6220800 bytes (1920x1080x3)
Jetson: 6422528 byte (can’t figure out what this resolves to with resolution x channels)
Additionally, I get the following error on Jetson, but not on a dGPU:
NvBufSurfTransform failed with error -2 while converting buffer
nvbufsurface: Wrong buffer index (0)
If I use: nvbufsurface_create_params.colorFormat = NVBUF_COLOR_FORMAT_RGBA
dGPU: 8294400 bytes (1920x1080x4)
Jetson: 8388608 bytes (this also doesn’t align with any combination of resolution x channels)
With NVBUF_COLOR_FORMAT_RGBA I do not get any errors regarding nvbufsurface, but I can’t seem to resolve the colour space to get a proper image. I can get a garbled one though.
Here’s the section for setting the NvBufSurfaceCreateParams:
NvBufSurfaceCreateParams nvbufsurface_create_params;
/* An intermediate buffer for NV12/RGBA to BGR conversion will be
** required. Can be skipped if custom algorithm can work directly on NV12/RGBA. */
nvbufsurface_create_params.gpuId = surface->gpuId;
nvbufsurface_create_params.width = (gint) surface->surfaceList[0].width;
nvbufsurface_create_params.height = (gint) surface->surfaceList[0].height;
nvbufsurface_create_params.height);
nvbufsurface_create_params.size = 0;
nvbufsurface_create_params.colorFormat = NVBUF_COLOR_FORMAT_RGBA;
nvbufsurface_create_params.layout = NVBUF_LAYOUT_PITCH;ifdef IS_TEGRA
nvbufsurface_create_params.memType = NVBUF_MEM_DEFAULT;
else
nvbufsurface_create_params.memType = NVBUF_MEM_CUDA_UNIFIED;
endif