apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.51k stars 1.06k forks source link

Is the nuttx OS supported GPU or Opengl es #4679

Open celery0ne opened 2 years ago

celery0ne commented 2 years ago

Hello Sir,

May I use Opengl ES APIs to render my applications in nuttx OS? And if the "NX Graphics Subsystem" can use gpu to rendering?

patacongo commented 2 years ago

May I use Opengl ES APIs to render my applications in nuttx OS?

There is no port of OpenGL to NuttX. But that would be an interesting project (but probably rather difficult).

And if the "NX Graphics Subsystem" can use gpu to rendering?

On most tiny embedded systems, LVGL is used for graphics support. It provides very nice single, threaded 2D drawing in a single plane.

The "NX Graphics Subsystem" is better described as a Windowing system, analogous to the X window system under Linux and other systems. Through windows, it supports multiple tasks concurrently accessing the display as well as a Z-axis the allows a window to be "above" or "below" other windows

There is a C++ widget library called NxWidgets that can be with NX and there are a couple of windows managers available: A simple, immersive NxWM and a full TWM work-alike (called Twm4Nx). Also supported are textual consoles (NxTerms)

The term GPU is used primarily for the graphics subsystem of desktop CPUs. I suppose these GPUs could be supported, but no one has done that port because those desktop CPUs do not often run NuttX. But many embedded MCUs also support great graphics and are supported .. like the Beaglebone black, the i.MX RT, the SAMA5Dx family, and others. These are differ in complexity.

NX can even be used with very low level serial graphics, but the performance may not be good. I prefer to use an MCU with higher end graphics with framebuffers support.

Do you have a GPU that you are particularly interested in supporting? NX graphics is one my favorite things to work on and if you are interested in this kind of graphics, I might be interested in working with you.

References: https://cwiki.apache.org/confluence/display/NUTTX/Graphics https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629398

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/nxwidgets

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/nxwm https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629401

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/twm4nx

celery0ne commented 2 years ago

Hi Patacongo Sir,

May I use Opengl ES APIs to render my applications in nuttx OS?

There is no port of OpenGL to NuttX. But that would be an interesting project (but probably rather difficult).

And if the "NX Graphics Subsystem" can use gpu to rendering?

On most tiny embedded systems, LVGL is used for graphics support. It provides very nice single, threaded 2D drawing in a single plane.

The "NX Graphics Subsystem" is better described as a Windowing system, analogous to the X window system under Linux and other systems. Through windows, it supports multiple tasks concurrently accessing the display as well as a Z-axis the allows a window to be "above" or "below" other windows

There is a C++ widget library called NxWidgets that can be with NX and there are a couple of windows managers available: A simple, immersive NxWM and a full TWM work-alike (called Twm4Nx). Also supported are textual consoles (NxTerms)

The term GPU is used primarily for the graphics subsystem of desktop CPUs. I suppose these GPUs could be supported, but no one has done that port because those desktop CPUs do not often run NuttX. But many embedded MCUs also support great graphics and are supported .. like the Beaglebone black, the i.MX RT, the SAMA5Dx family, and others. These are differ in complexity.

NX can even be used with very low level serial graphics, but the performance may not be good. I prefer to use an MCU with higher end graphics with framebuffers support.

References: https://cwiki.apache.org/confluence/display/NUTTX/Graphics https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629398

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/nxwidgets

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/nxwm https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629401

https://github.com/apache/incubator-nuttx-apps/tree/master/graphics/twm4nx

Thank you for your reply, I am researching the possibility of supporting GPU in Nutty OS of recent days. Per your mentioned before, It is very difficult or not possible for a third-party team to make the Nutty to support opengl es/egl APIs, I think that there are only SOC providers can port the gpu driver(opengl or other graphic APIs) to a new OS such as Nuttx OS. All of the user-space gpu drivers are not the open source. So, may I know your opinions of that. how we enable opengles APIs in Nuttx OS.

BTW, I have known form the page(https://github.com/lvgl/lvgl/blob/7d9fe20a0e676f57b10128fe4c446d6173bb20cf/docs/get-started/nuttx.md) that LVGL has already suppoorted NuttX OS, and in my opinion, the feaible way to enable gpu Hardware acceleration is, LVGL ---> SDL---> GPU Driver --> GPU.

SDL: https://www.libsdl.org/index.php

Do you have a GPU that you are particularly interested in supporting? NX graphics is one my favorite things to work on and if you are interested in this kind of graphics, I might be interested in working with you.

Take Smartwatch Platform for example, Qcom snapdragon Wear 3100 Platform is a very well platform for us. But as far as known, it donot support Nuttx OS. how about this platform?

https://www.qualcomm.com/products/snapdragon-wear-3100-platform

patacongo commented 2 years ago

Per your mentioned before, It is very difficult or not possible for a third-party team to make the Nutty to support opengl es/egl APIs, I think that there are only SOC providers can port the gpu driver(opengl or other graphic APIs) to a new OS such as Nuttx OS. All of the user-space gpu drivers are not the open source. So, may I know your opinions of that. how we enable opengles APIs in Nuttx OS.

... Take Smartwatch Platform for example, Qcom snapdragon Wear 3100 Platform is a very well platform for us. But as far as known, it donot support Nuttx OS. how about this platform?

https://www.qualcomm.com/products/snapdragon-wear-3100-platform

Creating the graphics driver is normally not a huge job if you have proper specifications.  According to https://www.qualcomm.com/products/snapdragon-wear-3100-platform

GPU    GPU Name: Qualcomm® Adreno™ 304 GPU             API Support: OpenGL® ES 3.0

https://en.wikipedia.org/wiki/Adreno (Hmmm... Adreno is an anagram of Radeon).

It looks like the interface to the display is MIPI.  I don't know what that GPU internal interface is.  Creating a graphics driver would probably be a significant effort .

I don't know how much about the OpenGL details.    Providing the OpenGL interface would mostly likely be a large effort too.

The only good news I see is:

CPU    CPU Clock Speed: Up to 1.2 GHz             CPU Cores: 4x ARM Cortex A7, Quad-core CPU             CPU Architecture: 32-bit

Cortex A7 is well supported by NuttX so the basic port to the Snapdragon part might not be too difficult.

I don't see any low effort way to get NuttX on that platform. You could consider some of the other supported platforms like Beaglebone Black (AM335x, Cortex A8 signle core), i.MX6 (quad core cortex a7 but no graphics support yet), or possibly others.

ufbycd commented 2 years ago

3D rendering is an interesting topic. I don't think GPU is necessary. Similar to Mesa, we can implement a “GL” on the CPU. There is already a library named "TinyGL" that is intended to be a very small implementation of a subset of OpenGL * for embedded systems or games. It is a software only implementation.

acassis commented 2 years ago

Time flies, more than 5 years ago: https://www.youtube.com/watch?v=XOdfvi7cgLc