| 300 | [=#desktop] |
| 301 | == Hardware Accelerated Desktop UI |
| 302 | While it is not typical to use an embedded system as an Ubuntu desktop we often are asked how to do it. |
| 303 | |
| 304 | With the Ubuntu Focal (20.04) all the software is in place to give you 2D and 3D hardware acceleration with the IMX6 with a modern kernel such as the Linux 5.4 kernel we use in our pre-built images. |
| 305 | |
| 306 | Here are the steps to add a desktop UI: |
| 307 | 1. Install gnome desktop: |
| 308 | {{{#!bash |
| 309 | # add packages |
| 310 | apt install gnome-session gnome-terminal |
| 311 | # add a non-root user (required to login) |
| 312 | adduser gateworks |
| 313 | # sync the filesystem and reboot |
| 314 | sync |
| 315 | reboot |
| 316 | }}} |
| 317 | - you'll notice dragging opaque windows around is fairly smooth as it is using hardware 2D acceleration |
| 318 | 1. 3D opengl hardware acceleration: |
| 319 | {{{#!bash |
| 320 | apt install mesa-utils glmark2 |
| 321 | # from gnome-terminal running on display from above: |
| 322 | glxgears # 75fps on IMX6Q displaying HDMI 1080p60hz |
| 323 | glmark2 # another test that renders via opengl |
| 324 | }}} |
| 325 | 1. GStreamer Video display |
| 326 | {{{#!bash |
| 327 | apt-get install gstreamer1.0-x gstreamer1.0-tools libgstreamer1.0-0 \ |
| 328 | gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ |
| 329 | gstreamer1.0-libav gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio \ |
| 330 | v4l-utils alsa-utils |
| 331 | # using kmssink will render right over GUI |
| 332 | gst-launch-1.0 videotestsrc ! kmssink |
| 333 | # using fbdevsink will also render right over GUI |
| 334 | gst-launch-1.0 videotestsrc ! fbdevsink |
| 335 | # using waylandsink will render 'within' GUI |
| 336 | gst-launch-1.0 videotestsrc ! waylandsink # renders 'within' gui |
| 337 | }}} |
| 338 | - see [wiki:gstreamer gstreamer] wiki page for information on hardware accelerated encode/decode |
| 339 | |