I'm trying to make an embedded system which will allow people to rotate and generally view a 3D model on a touchscreen. I am using Raspberry Pi 3 for that. The OpenGL part is not a problem as I already have experience with WebGL, but I'm having a lot of trouble making some way for the app to be able to display anything on Raspberry.

I installed minimal Raspbian and after a bit of research realised that KMS with direct buffering is the best choice, but... it seems this raspbian doesn't even have DRI (or at least, /dev/dri).

How can I make such an app for Raspberry Pi? What options do Pi's hardware and drivers provide?

  • I would have thought your best bet would be to run X with a minimal desktop manger then just run any standard openGL code. Rather than trying to run directly in framebuffer.
    – rob
    Apr 20, 2018 at 10:05
  • @rob "any standard openGL code" still needs a surface and a context, which need to be initiated in some way. Also, a minimal desktop manager isn't needed as if you already have an X client you want to display, you can just startx it directly.
    – Deuxis
    Apr 20, 2018 at 20:29

1 Answer 1


I ran out of time and ended up using a kiosk-mode Chromium with a canvas as a WebGL context supplier, but here's what I gathered:

  1. Raspberry Pi 3 has the option to enable DRM. It's in options presented by running raspi-config, under Advanced Options -> Enable experimental GL Driver or something like that.
  2. If you have a program providing a context for you that is also an X client (which currently means any graphical Linux program), such as Chromium in my case, the most efficient way to run it is to use nodm to log into a special user, whose .xinitrc does exec yourprogram, and use that .xinitrc to initiate an X session.
  3. Chromium has a whole lot of command line switches that enable you to set kiosk mode, without any navigation features, and window geometry/offset, and it's actually pretty light. If you are in the same situation as me, it's actually a pretty good choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.