imx8mp OpenGL without display

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mp OpenGL without display

1,161 Views
KobusGvid
Contributor III

Is there a way to get OpenGL to work while running in headless mode (without connecting a display)?
I'm running a imx8mp with an fsl-xwayland based image. I know PGU et-al are configured correctly in my devicetree as I can get a display working when connected. If I try to run a simple gstreamer pipeline like this:

gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12,width=1920,height=1080 ! queue ! glupload ! glcolorconvert ! gldownload ! video/x-raw,format=RGB ! queue ! fakesink

I get the following error: 

Got context from element 'gldownloadelement0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayWayland\)\ gldisplaywayland0";
ERROR: from element /GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0: Failed to perform a wayland roundtrip

 

My system is set up to use remote-x server via SSH, but even then I get nothing.

Is there some XDG variable to set? or is there a way to get a fake framebuffer or something?

0 Kudos
Reply
7 Replies

186 Views
KobusGvid
Contributor III

So to answer my own question for anyone else coming here: 

I could get the GPU working and perform gstreamer glupload/glshader etc commands by: 
- Loading VKMS kernel module for a virtual display

- setting renderer=gl and disabling "g2d" in westom.ini. 

 

With these chnages weston starts up, and I have opngl commands. 

Interestingly, I was able to verify that OpenCL works fine even when weston is offline. Unfortunately the performance of anything in OpenCV using UMat's and the T-API didn't improve vs a normal matrix. It does seem to be much faster than a simple element wise multiplication for example in C, so that's probably down to the ARM-Neon acceleration in OpenCV.  

0 Kudos
Reply

1,148 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Please try this again:

$ DISPLAY=:0 gst-launch-1.0 videotestsrc ! video/x-raw(memory:NVMM),width=1920,height=1080, 'video/x-raw,width=1920, height=1080 ! xvimagesink sync=0

 

Regards

0 Kudos
Reply

1,144 Views
KobusGvid
Contributor III

I get the following:

WARNING: erroneous pipeline: could not link videotestsrc0 to xvimagesink0, neither element can handle caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080

Am I missing a kernel config?

0 Kudos
Reply

1,140 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

That's is not an error, your system should be running without display.

Regards

0 Kudos
Reply

1,104 Views
KobusGvid
Contributor III

so does they teach us anything? Do you have any other ideas what could be causing the issue?

Tags (1)
0 Kudos
Reply

970 Views
ugurkurt
Contributor I

 

Hi there, I encountered the same issue on my i.MX8M board. What worked for me was adding the weston, weston-init, and weston-xwayland packages to my Yocto image, which completely resolved the display errors. Additionally, I set the XDG_RUNTIME_DIR environment variable using the following command: 
export XDG_RUNTIME_DIR=/run/user/$(id -u)

I hope this helps you resolve your issue as well!

0 Kudos
Reply

958 Views
KobusGvid
Contributor III

thanks ugurkur, but that doesn't seem to help. 

If I check `echo $XDG_RUNTIME_DIR` I get "/run/user/0", so that seems fine. 

And according to my manifest I have all the packages you mentioned. Still I cant get OpenGL to work.

 

0 Kudos
Reply