Argus sample cudaBayerDemosaic - cannot open display

Hey, I am trying to run the argus sample cudaBayerDemosaic.
I compiled as instructed and when running I get the following error.

Executing Argus Sample: argus_cudabayerdemosaic
Executing Argus Sample: argus_cudabayerdemosaic
Unable to init server: Could not connect: Connection refused

(argus_cudabayerdemosaic:9509): Gtk-WARNING **: 16:23:31.955: cannot open display:

Do I need to have gdm3 running or not? Do I have to export some variables (DISPLAY)? Can I run it from command line or do I need to run it from inside the gui?

Thanks for your help!

Need run with the Xserver started. And may need export DISPLAY=:0 before run the sample code.

Hey, thank you very much for your response. I could start the sample application having gdm3 running.
For one of my projects I was using Gstreamer drmvideosink to display videostream on one plane, and a Qt GUI on another plane. This is working perfetct.

Now I have a project, where I need to use libargus API in C++ instead of GStreamer.

So what I want is based on argus cudaBayerDemosaic example, but instead of egl preview consumer I’d like to use NvDrmRenderer. I am using 08_drm_video_dec example as a reference.

I transform from RAW16 to RGBA nv_buffer in my CUDA-Kernel, but when I enque that buffer to NvDrmRenderer I get

[ERROR] (NvDrmRenderer.cpp:157) Error in transforming buffer information
[ERROR] (NvDrmRenderer.cpp:687) Failed to convert to DRM params
[ERROR] (NvDrmRenderer.cpp:804) Error in rendering frame

which is because my format is not of these types:

switch (params->pixel_format) {
case NvBufferColorFormat_YUV420:
dParams->pixel_format = DRM_FORMAT_YUV420;
case NvBufferColorFormat_YVU420:
dParams->pixel_format = DRM_FORMAT_YVU420;
case NvBufferColorFormat_NV12:
dParams->pixel_format = DRM_FORMAT_NV12;
case NvBufferColorFormat_NV21:
dParams->pixel_format = DRM_FORMAT_NV21;
case NvBufferColorFormat_UYVY:
dParams->pixel_format = DRM_FORMAT_UYVY;
case NvBufferColorFormat_NV12_10LE:
dParams->pixel_format = DRM_FORMAT_TEGRA_P010;
case NvBufferColorFormat_Invalid:
goto error;

I was wondering if it is also possible to use RGBA because DRM_FORMAT_RGBA8888 is defined (can I just add it to the switch statement?) or is it not possible to use DRM Renderer with RGBA Format?

In that case, what would be the fastest way to transform my RGBA nv_buffer to YUV420 or NV12 format?

Do you think I am on the right path or is there another more clever solution to my problem?

Best regards,

I’m also interested in whether DRM supports 10 or 12 bpp RGBA format?


If this is jetson nano, then 10/12bpp RGBA format are not supported.

Even kernel side does not support this. Please refer to the software feature of below page.

Ah, sorry. I’m interested in Xavier NX. Wrong forum… But maybe you can answer here nevertheless?

Why just configure argus to output as YUV420 or NV21 to DRM.

Actually I do not want display RGB Camera output. Instead I have different formulas for parameters based on RGB input which I want to display in realtime. For the calculation I need the data best uncompressed, so I am using Outputstream settings with RAW16 color format.

Camera → Parameter calculation → display

So I have mainly 2 questions:

  1. Is it correct that I can use RAW16 Output Format from argus which is then not compressed or anything? (Because I thought in the past, argus could only output NV12)

  2. I changed NvDrmRenderer to not throw any error on RGBA color format for input buffers and it just worked. If it works why throwing error in the first place? And what do you think could be any disadvantage of this? Do you still think it would be better to first convert to another format?

Yes, argus only support NV12/YUV422 and RAW.
Sorry, I don’t have idea for this kind of use case can give any further comment.