CUDA EGL returned frame empty

Hi,

I’m having some trouble with a frame posted by a CUDA producer to an EGL consumer (CUDA, NvMedia etc.) in an EGL stream in “Mailbox” mode (with EGL_SUPPORT_REUSE_NV set to EGL_FALSE). Whenever the image size of the frame exceeds a limit of 1048576 bytes, the buffer modified by the EGL consumer will be empty after returning to CUDA only and only if the buffer address has been posted to the stream before, e.g. inside a loop. Problem occurs across different EGL consumers and color formats.

Jetson AGX Xavier (16GB)
Jetpack 4.4 (L4T 32.4.3)
CUDA 10.2.89

Update
It does not seem to depend on the size. A device pointer that has been freed once (but allocated once again and got same address) cannot be used in the EGL stream anymore. Here is a minimal working example: EGL consumer sets whole buffer to 0xff in each iteration. First iteration with address 0x2037ca000 works, producer reads 0xff, seconds iteration with address 0x2037ca000 fails, producer reads 0x00, third iteration with address 0x2038ca000 works again.

Output:
i = 0, address @ 0x2037ca000: Pixel: 0xff
i = 1, address @ 0x2037ca000: Pixel: 0x0
i = 2, address @ 0x2038ca000: Pixel: 0xff

Expected output:
i = 0, address @ 0x2037ca000: Pixel: 0xff
i = 1, address @ 0x2037ca000: Pixel: 0xff
i = 2, address @ 0x2038ca000: Pixel: 0xff

egl_fail.zip (2.2 KB)

Hi,
Looks like you modify the buffer in consumer and would like to have the modification also applied in producer. However, this looks different from EGL_SUPPORT_REUSE_NV defined in
https://www.khronos.org/registry/EGL/extensions/NV/EGL_NV_stream_reset.txt

    3.10.4.x+1 EGL_SUPPORT_REUSE_NV Attribute

    The EGL_SUPPORT_REUSE_NV attribute may only be set when the stream
    is created. By default, it is EGL_TRUE. If EGL_TRUE, then when the
    consumer acquires the last available image frame from the stream, it
    will be held for reuse until a new frame is inserted to replace it.
    If EGL_FALSE, no frames will be available to the consumer until the
    producer inserts a new one.

Probably these is misunderstanding in using the attribute?