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?
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.
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
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?
That's is not an error, your system should be running without display.
Regards
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!
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.