Drive AGX use EGL Stream problem

Hi

I have a job is use EGLStream send a rgba image file, like this https://docs.nvidia.com/drive/active/5.1.6.0L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FNvMedia%2Fnvmedia_nvm_eglstream.html%23wwpID0EUHA

In Cross-Partition Examples, I follow the sample “Cross-Partition Examples/ To run an NvMedia video producer and consumer”

the result is:

Consumer

./nvm_eglstream -consumer 0 -standalone 4 -producer 0 -d 0 -ot yuv420 -ip 12.0.0.1 -socketport 8888
Operation mode: Cross-partition Consumer
AAAAAA
args->standalone = 4
STANDALONE_CP_CONSUMER = 4
EGL Stream consumer - Mode: Mailbox
EGL Stream consumer - Latency: 16000 usec
EGL Stream consumer - Timeout: 16000 usec
Query - Display Info - Enabled:1 displayId:0 type:B306 size:1920x1080 refresh:60.000000 type:HDMI
Used output - Display Info - Enabled:1 displayId:0 type:B306 size:1920x1080 refresh:60.000000 type:HDMI

Producer

./nvm_eglstream -f ~/boyu/egldevice/1.h264 -producer 0 -standalone 3 -consumer 0 -ot yuv420 -consumervm 0 -ip 12.0.0.2 -socketport 8888
Operation mode: Cross-partition Producer
AAAAAA
args->standalone = 3
STANDALONE_CP_CONSUMER = 4
EGL Stream consumer - Mode: Mailbox
EGL Stream consumer - Latency: 0 usec
EGL Stream consumer - Timeout: 0 usec
Init: Opening file: /home/nvidia/boyu/egldevice/1.h264
Decode start
NvMediaEglStreamProducerPostSurface: Could not register buffer

How can I solve it?

Dear boyuchen,

Did you run Single-Process Examples and Cross-Process Examples without any error?
Did you set the DISPLAY_VM environment like below?
“Set the DISPLAY_VM environment variable on the consumer partition. If the EGLOutput consumer is being used, set the DISPLAY_VM environment variable on the producer partition as well before executing the producer thread.”

Hi,

I have executed Single-Process Examples and Cross-Process Examples and no errors have been generated.

My test information as follows:

Input file format:1920×1080@RGBA
Producer / Consumer type:CUDA producer / Consumer

when I run Cross-Partition Examples,

./nvm_eglstream -f ../1.rgb -fr 1920x1080 -producer 3 -standalone 3 -consumer 3 -consumervm 0 -ip 12.0.0.2 -socketport 8888
    Operation mode: Cross-partition Producer
    EGL Stream consumer - Mode: Mailbox
    EGL Stream consumer - Latency: 0 usec
    EGL Stream consumer - Timeout: 0 usec
    nvmedia: ERRORL: Cuda producer: presentFrame faild, cuStatus = 999

I not use EGLOutput consumer, so I don’t set DISPLAY_VM environment.

and the error is in drive-t186ref-linux/samples/nvmedia/eglstream/cuda_producer.c
line 405 “cuEGLStreamProducerPresentFrame” is not success, but in Single-Process Examples and Cross-Process Examples
it is success.

Thank you.

Dear boyuchen,

Could you please help to check with below command?
I could run it w/o any error. Thanks.

root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11#<b> ./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 -standlone 3 -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888</b>
Operation mode: Producer/Consumer
EGL Stream consumer - Mode: Mailbox
EGL Stream consumer - Latency: 16000 usec
EGL Stream consumer - Timeout: 16000 usec
root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11#

root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11# ll
total 16396
drwxr-xr-x 2 nvidia nvidia     4096 Jun 18  2019 ./
drwxr-xr-x 6 nvidia nvidia     4096 May 29  2019 ../
-rw-r--r-- 1 root   root   16588800 Jul  4 07:54 cuda.yuv
-rwxr-xr-x 1 nvidia nvidia   191864 May 29  2019 nvm_eglstream*
root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11#

Hi SteveNV,

Your command as below

root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11# ./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3<b> -standlone 3</b> -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888

But the correct one is “-standalone 3”, and I cannot execute normally.

root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11# ./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 <b>-standalone 3</b> -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888

Thanks for your help.
BoyuChen

Dear boyuchen,

Still happen same error after run above command with video_lane.h264 file like below?

Operation mode: Cross-partition Producer
    EGL Stream consumer - Mode: Mailbox
    EGL Stream consumer - Latency: 0 usec
    EGL Stream consumer - Timeout: 0 usec
    nvmedia: ERRORL: Cuda producer: presentFrame faild, cuStatus = 999

Hi SteveNV,

Yes, use file video_lane.h264 and use the correct command, is still have the same error message.

Operation mode: Cross-partition Producer
        EGL Stream consumer - Mode: Mailbox
        EGL Stream consumer - Latency: 0 usec
        EGL Stream consumer - Timeout: 0 usec
        nvmedia: ERRORL: Cuda producer: presentFrame faild, cuStatus = 999

Thank your help.

Dear boyuchen,

It’s weird.
I flashed my DriveAGX with DriveSW 9.0 and re-check it.
But there is no error.

This is my step.

  1. CUDA environment set up.
  2. Check CUDA version with $ nvcc --version
  3. export DISPLAY=:0
  4. Run ./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 -standlone 3 -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888
  5. Check cuda.yuv file
root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11# ./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 -standlone 3 -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888
Operation mode: Producer/Consumer
EGL Stream consumer - Mode: Mailbox
EGL Stream consumer - Latency: 16000 usec
EGL Stream consumer - Timeout: 16000 usec
root@tegra-ubuntu:~/drive-t186ref-linux/samples/nvmedia/eglstream/x11# ll
total 16396
drwxr-xr-x 2 nvidia nvidia     4096 Jul  4  2017 ./
drwxr-xr-x 6 nvidia nvidia     4096 May 30 08:09 ../
-rw-r--r-- 1 root   root   <b>16588800 Jun 19 15:40 cuda.yuv</b>
-rwxr-xr-x 1 nvidia nvidia   191864 May 30 08:09 nvm_eglstream*

Could you please help to check above step and re-try it? Thanks.

Hi SteveNV,

In your step.4 “-standlone 3” is wrong

./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 -standalone 3 -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888

Run this command as below, and you should have another Terminal to receive the cuda.yuv

./nvm_eglstream -f /home/nvidia/Downloads/video_lane.h264 -fr 1920x1080 -producer 3 -standalone 3 -consumer 3 [-ot yuv420 -pl] -consumervm 0 -ip 12.0.0.2 -socketport 8888

Thank your help.