cuGraphicsEGLRegisterImage and NvBufferColorFormat_GRAY8

Previously GRAY8 NvBuffers were not supported. Since my Disparity pipeline produces a grayscale image, I am forced to do an extra conversion from GRAY8->ABGR32 so that I can wrap the result it in an NvBuffer again.

However I noticed that NvBufferColorFormat_GRAY8 was added as an option to nvbuf_utils.h which made me think it was now supported. However if you try to create and register a GRAY8 frame using cuGraphicsEGLRegisterImage it fails with CUDA_ERROR_NOT_SUPPORTED.

Is there any workaround to have a cuda kernel write data into a GRAY8 nvbuffer? I would love to avoid the extra conversion step if possible.


Thanks for your question.

Based on our document, there is no CUDA_ERROR_NOT_SUPPORTED return type in the cuGraphicsEGLRegisterImage.

Would you mind to share a simple reproducible source so we can check it directly?

The supported formats are listed in

GRAY8 is not supported. Suggest you convert to valid format(such as RGBA) through NvBufferTransfrom().

Thanks @DaneLLL. Is there any plan to add support for GRAY8 to avoid the extra conversion?

We don’t have plan to support GRAY8 in CUeglColorFormat. A substitute is to use CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR and fill the UV plane with 0x80.

1 Like