Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

How to indicate device compatibility for your app in MetaInfo data

At the moment I am hard at work putting together the final bits for the AppStream 1.0 release (hopefully to be released this month). The new release comes with many new new features, an improved developer API and removal of most deprecated things (so it carefully breaks compatibility with very old data and the previous C API). One of the tasks for the upcoming 1.0 release was #481 asking about a formal way to distinguish Linux phone applications from desktop applications.

AppStream infamously does not support any “is-for-phone” label for software components, instead the decision whether something is compatible with a device is based the the device’s capabilities and the component’s requirements. This allows for truly adaptive applications to describe their requirements correctly, and does not lock us into “form factors” going into the future, as there are many and the feature range between a phone, a tablet and a tiny laptop is quite fluid.

Of course the “match to current device capabilities” check does not work if you are a website ranking phone compatibility. It also does not really work if you are a developer and want to know which devices your component / application will actually be considered compatible with. One goal for AppStream 1.0 is to have its library provide more complete building blocks to software centers. Instead of just a “here’s the data, interpret it according to the specification” API, libappstream now interprets the specification for the application and provides API to handle most common operations – like checking device compatibility. For developers, AppStream also now implements a few “virtual chassis configurations”, to roughly gauge which configurations a component may be compatible with.

To test the new code, I ran it against the large Debian and Flatpak repositories to check which applications are considered compatible with what chassis/device type already. The result was fairly disastrous, with many applications not specifying compatibility correctly (many do, but it’s by far not the norm!). Which brings me to the actual topic of this blog post: Very few seem to really know how to mark an application compatible with certain screen sizes and inputs! This is most certainly a matter of incomplete guides and good templates, so maybe this post can help with that a bit:

The ultimate cheat-sheet to mark your app “chassis-type” compatible

As a quick reminder, compatibility is indicated using AppStream’s relations system: A requires relation indicates that the system will not run at all or will run terribly if the requirement is not met. If the requirement is not met, it should not be installable on a system. A recommends relation means that it would be advantageous to have the recommended items, but it’s not essential to run the application (it may run with a degraded experience without the recommended things though). And a supports relation means a given interface/device/control/etc. is supported by this application, but the application may work completely fine without it.

I have a desktop-only application

A desktop-only application is characterized by needing a larger screen to fit the application, and requiring a physical keyboard and accurate mouse input. This type is assumed by default if no capabilities are set for an application, but it’s better to be explicit. This is the metadata you need:

<component type="desktop-application">
  <id>org.example.desktopapp</id>
  <name>DesktopApp</name>
  [...]
  <requires>
    <display_length>768</display_length>

    <control>keyboard</control>
    <control>pointing</control>
  </requires>
  [...]
</component>

With this requires relation, you require a small-desktop sized screen (at least 768 device-independent pixels (dp) on its smallest edge) and require a keyboard and mouse to be present / connectable. Of course, if your application needs more minimum space, adjust the requirement accordingly. Note that if the requirement is not met, your application may not be offered for installation.

Note: Device-independent / logical pixels

One logical pixel (= device independent pixel) roughly corresponds to the visual angle of one pixel on a device with a pixel density of 96 dpi (for historical X11 reasons) and a distance from the observer of about 52 cm, making the physical pixel about 0.26 mm in size. When using logical pixels as unit, they might not always map to exact physical lengths as their exact size is defined by the device providing the display. They do however accurately depict the maximum amount of pixels that can be drawn in the depicted direction on the device’s display space. AppStream always uses logical pixels when measuring lengths in pixels.

I have an application that works on mobile and on desktop / an adaptive app

Adaptive applications have fewer hard requirements, but a wide range of support for controls and screen sizes. For example, they support touch input, unlike desktop apps. An example MetaInfo snippet for these kind of apps may look like this:

<component type="desktop-application">
  <id>org.example.adaptive_app</id>
  <name>AdaptiveApp</name>
  [...]

  <requires>
    <display_length>360</display_length>
  </requires>

  <supports>
    <control>keyboard</control>
    <control>pointing</control>
    <control>touch</control>
  </supports>
  [...]
</component>

Unlike the pure desktop application, this adaptive application requires a much smaller lowest display edge length, and also supports touch input, in addition to keyboard and mouse/touchpad precision input.

I have a pure phone/table app

Making an application a pure phone application is tricky: We need to mark it as compatible with phones only, while not completely preventing its installation on non-phone devices (even though its UI is horrible, you may want to test the app, and software centers may allow its installation when requested explicitly even if they don’t show it by default). This is how to achieve that result:

<component type="desktop-application">
  <id>org.example.phoneapp</id>
  <name>PhoneApp</name>
  [...]

  <requires>
    <display_length>360</display_length>
  </requires>

  <recommends>
    <display_length compare="lt">1280</display_length>
    <control>touch</control>
  </recommends>
  [...]
</component>

We require a phone-sized display minimum edge size (adjust to a value that is fit for your app!), but then also recommend the screen to have a smaller edge size than a larger tablet/laptop, while also recommending touch input and not listing any support for keyboard and mouse.

Please note that this blog post is of course not a comprehensive guide, so if you want to dive deeper into what you can do with requires/recommends/suggests/supports, you may want to have a look at the relations tags described in the AppStream specification.

Validation

It is still easy to make mistakes with the system requirements metadata, which is why AppStream 1.0 will provide more commands to check MetaInfo files for system compatibility. Current pre-1.0 AppStream versions already have an is-satisfied command to check if the application is compatible with the currently running operating system:

:~$ appstreamcli is-satisfied ./org.example.adaptive_app.metainfo.xml
Relation check for: */*/*/org.example.adaptive_app/*

Requirements:
 • Unable to check display size: Can not read information without GUI toolkit access.
Recommendations:
 • No recommended items are set for this software.
Supported:
  Physical keyboard found.
  Pointing device (e.g. a mouse or touchpad) found.
 • This software supports touch input.

In addition to this command, AppStream 1.0 will introduce a new one as well: check-syscompat. This command will check the component against libappstream’s mock system configurations that define a “most common” (whatever that is at the time) configuration for a respective chassis type.

If you pass the --details flag, you can even get an explanation why the component was considered or not considered for a specific chassis type:

:~$ appstreamcli check-syscompat --details ./org.example.phoneapp.metainfo.xml
Chassis compatibility check for: */*/*/org.example.phoneapp/*

Desktop:
  Incompatible
 • recommends: This software recommends a display with its shortest edge
   being << 1280 px in size, but the display of this device has 1280 px.
 • recommends: This software recommends a touch input device.

Laptop:
  Incompatible
 • recommends: This software recommends a display with its shortest edge 
   being << 1280 px in size, but the display of this device has 1280 px.
 • recommends: This software recommends a touch input device.

Server:
  Incompatible
 • requires: This software needs a display for graphical content.
 • recommends: This software needs a display for graphical content.
 • recommends: This software recommends a touch input device.

Tablet:
  Compatible (100%)

Handset:
  Compatible (100%)

I hope this is helpful for people. Happy metadata writing! 😀

the avatar of Open Build Service

Post-mortem: Service Degradation for Pages with Comments

OBS Pages Inaccessible on 19th of September On September 19th the pages and API routes on OBS displaying comments were inaccessible (returning a 500 error) to all users for 13 minutes. Here is what caused the problem. Date: 19.09.2023 Impact: Pages and API routes on OBS displaying comments where not accessible to anyone. Root Causes: In our deployment, we first update the obs-api package (including restarting servers) and then run migrations. In the timeframe between...

the avatar of Nathan Wolf
the avatar of Nathan Wolf

DisplayLink on openSUSE Tumbleweed

My journey with DisplayLink started in 2012 with a USB 2 interface on a Dell Latitude D630. It was rough and quite fiddly to get working. When you did, it was slow but usable. I really wanted that third monitor and worked quite hard to make it happen. Thanks to the openSUSE community I was […]

a silhouette of a person's head and shoulders, used as a default avatar

openSUSE Tumbleweed – Review of the weeks 2023/39 & 40

Dear Tumbleweed users and hackers,

My punishment for taking Fridays off is having to write a weekly review that spans again over two weeks. I know, many of you rely on those reviews to know what is coming their way and doing this only bi-weekly is definitively now what I am striving for. After all, you deserve to be informed about the things happening in Tumbleweed. During the last two weeks, we have published 9 snapshots (0921, 0922, 0925, 0926, 0927, 0929, 1001, 1003, and 1005 – with the latest one being still being hot – and important in plus.

The most relevant changes in these snapshots are:

  • Linux kernel 6.5.4
  • Poppler 23.09.0
  • dbus 1.14.10
  • Node.JS 20.7.0
  • XWayland 23.2.1
  • UDisks 2.10.0
  • LibreOffice 7.6.1.2
  • Mesa 23.1.8, 23.2.0, and 23.2.1
  • GPG 2.4.0
  • Mozilla Firefox 118.0.1
  • GStreamer 1.22.6
  • openSSL 3.1.3
  • systemd 254.5
  • glibc CVE-2023-4911, aka Looney Tunables
  • Samba 4.19.0

The glibc fix is part of Snapshot 1005, but due to its importance and reach was already published in the Tumbleweed update channel yesterday evening.

The staging projects are currently testing these changes:

  • binutils 2.41
  • Linux kernel 6.5.6
  • Shadow 4.14.1
  • zypper 1.14.65 / libzypp 17.31.21: changes around transfiletrigger handlers; openQA seems not yet happy with the result
  • LibreOffice 7.6.2
a silhouette of a person's head and shoulders, used as a default avatar

Simplify GPU Application Development with HMM on Leap

Recently, NVIDIA has introduced Heterogeneous Memory Management (HMM) in its open source kernel drivers which simplifies GPU Application Development with CUDA. It unifies system memory access across CPUs and GPUs and removes the need to copy memory content between CPU and GPU memory. It extends Unified Memory to cover both system allocated memory as well as memory allocated by cudaMallocManaged().

You may ask, "how do I make this work on my Leap system?" If you are a Leap 15.5 user, the open driver is already available to you. Therefore, if you have an NVIDIA chipset with a GPU System Processor (GSP), ie. Turing or later, we have you covered. Here is how:

Installation on openSUSE Leap 15.5

The simplest way to accomplish this is to login as root and run the following commands in your shell:

zypper ar https://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/cuda-opensuse15.repo
zypper --gpg-auto-import-keys refresh
zypper -n install -y --auto-agree-with-licenses --no-recommends nvidia-open-gfxG05-kmp-default cuda

This will add the NVIDIA CUDA repository and install CUDA with the kernel modules required.
Do you require signed drivers to support secure boot or deploy in a public cloud environment? In this case, instead of the above, execute:

zypper ar https://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/cuda-opensuse15.repo
zypper ar https://download.nvidia.com/opensuse/leap/15.5/ NVIDIA-drivers
zypper --gpg-auto-import-keys refresh
zypper -n in -y --auto-agree-with-licenses --no-recommends nvidia-open-driver-G06-signed-kmp-default nvidia-drivers-minimal-G06 cuda

This makes use of the NVIDIA open driver package shipped and signed by SUSE - like the rest of your kernel. This eliminates the need to enroll a MOK as well an extra build stage when the kernel drivers are installed or updated. Thus it helps to reduce the size of the cloud image by removing the need for extra build tools.
To use these kernel drivers, it installs a set of user space driver packages which are not yet available in the CUDA software repository.

Preparations

For chipsets with a display engine (i.e. which have display outputs), the open driver support is still considered alpha. Therefore, you may have to add or uncomment the following option in /etc/modprobe.d/50-nvidia-default.conf:

options nvidia NVreg_OpenRmEnableUnsupportedGpus=1

Once these steps have been performed, you may either reboot the system or run

modprobe nvidia

as root to load all required kernel modules.

Testing the Installation

To check if HMM is available and enabled, query the 'Addressing Mode' property:

nvidia-smi -q | grep Addressing
Addressing Mode : HMM

If you see above output, HMM is available on your system.

Compile HMM Sample Code

NVIDIA discusses some code examples for HMM in its blog post. The examples can be found here on GitHub. If you would like to try out the examples, here are some hints on building and running them.
Some these need a newer gcc than the stock version shipped with Leap 15, which you can install with:

zypper in gcc12-c++

In order to compile the examples, the PATH environment variable needs to be extended to point to the CUDA binaries:

export PATH=/usr/local/cuda/bin/:${PATH}

You may now compile the examples under the path src using the following commands:

nvcc -std=c++20 -ccbin=/usr/bin/g++-12 atomic_flag.cpp -o atomic_flag
nvcc -std=c++20 -ccbin=/usr/bin/g++-12 file_after.cpp -o file_after
nvcc -std=c++20 -ccbin=/usr/bin/g++-12 file_before.cpp -o file_before
nvcc -std=c++20 -ccbin=/usr/bin/g++-12 ticket_lock.cpp -o ticket_lock

'weather_app' Example

For this example application, the system gcc compiler is sufficient. Only $PATH has to be set to

export PATH=/usr/local/cuda/bin/:${PATH}

Now, build the binary weather_app by running

make

The blog by NVIDIA describes how to obtain the data required to run the app. If you're unable to download the ~1.3 TB of data, you may also use the random data generator from this PR on GitHub. The random data app can be compiled with

g++ create_random_data.cpp -o create_random_data -O2 -Wall

The application has no command line parameters, and the start and end year for the random data has to be set in the source code itself.


NOTE If your graphic card doesn't have sufficient VRAM to run the original sample code, you may scale down the data size by reducing the input_grid_height and input_grid_width parameters in both create_random_data.cpp and weather_app.cu.


To do a sample run:

mkdir binary_1hr_all
./weather_app
./weather_app 1981 1982 binary_1hr_all/

NOTE The Makefile doesn't compile CUDA kernels for the Turing GPUs and also has a faulty error message handling. You might want check out https://github.com/NVIDIA/HMM_sample_code/pull/2 which fixes this issues.


Summary

  • The NVIDIA open driver provides HMM (Heterogeneous Memory Management) which extends the simplicity of the CUDA Unified Memory programming model even further on supported chipsets 1 by including system allocated memory.
  • HMM is available for openSUSE Leap 15.5.
  • The open driver allows for pre-built kernel drivers signed by SUSE.
    • This greatly simplifies the installation in a secure boot environment.
    • It streamlines the installation in public cloud environments by eliminating an extra build stage and reducing the size of the final image.
  • We have demonstrated how to install and test HMM on Leap 15.5.

  1. Turing and later

the avatar of danigm's Blog

One year of Tumbleweed

More than a year has passed since I switched to openSUSE Tumbleweed Linux distribution, in both, my work computer (for obvious reasons) and in my personal computer and I can say that I'm really happy with the change.

Tumbleweed is a rolling release distribution, and in this kind of distributions there are a lot of changes every week, if you want the latest software, this kind of distribution is the way to go. But with high update frequency you are exposed to some kind of instability, it's impossible to have the latest changes without some broken program here and there, because not everyone is able to follow upstream changes without some weeks or months to update.

My distro history

I've been always a Linux user, since I get my first computer at 2003. In those days I was using a debian base distribution called knoppix. Then I switched to ubuntu when it appeared around 2004. But at that time I was a computer science student and I was exploring the whole free software and Linux ecosystem, so I was changing my distribution every time that I found a new one.

Like a lot of distro-hoppers, at some point I landed at ArchLinux and there I discovered the rolling release concept. And that was my home for some time, it was nice to have the latest available software just after the release.

At some point I bough a new computer and it was too new to work correctly with the kernel distributed in ArchLinux, so I tried different distributions and at that moment Fedora was the distro that works without too much complications with that computer, so I picked that one.

In 2019 I started to work at Endless and at that time I should try the EndlessOS, so I played a bit with the dual boot, having Fedora and EndlessOS at the same time. That was the first time that I get in contact with immutable distributions, something that's getting more popular everyday, but this distributions rely a lot on containers (flatpak, podman) and, even being something that could work, as a software engineer, I don't feel comfortable enough needing a container with another distribution to do something that could be in my system.

In 2022 I started to work at SUSE and for the first time I tried the openSUSE distribution until today.

The Tumbleweed

Today I've three different computers with Tumbleweed running. One for work, Thinkpad T14s, one for personal usage, Dell inspiron 5490, and another one as a personal media server, Libre computer La-frite.

The best thing of having Tumbleweed for me is that I get the latest GNOME as soon as it's released. And another big thing for this distribution is how easy it's to fix something upstream thanks to the Open Build Service, but I work everyday with that, so I'm biased. For sure, any other community distribution has different ways to contribute, but I find this one easy enough.

Even being a rolling release distro, Tumbleweed doesn't break a lot. I can't say that it's stable, because the API of everything is broken everyday, but the distribution is tested for every release and at least some level of package compatibility check is done. That makes Tumbleweed a good distribution and I can update without fearing some weird package breakage.

I usually update my work and personal laptops once a week, and la-frite not so often, maybe every 6 months.

With the default installation, Tumbleweed uses btrfs with snapshots, and it's really easy to go back and forward using the snapper tool. So it's really easy to go back to a good state if the distribution is broken for some reason, and wait for a fix.

The problems that I found during this year

  • Some problems with the NVidia graphic card in my Dell laptop, some times the kernel and the driver were not working correctly. I had to use snapper to get the NVidia working again, but fixed a few days later.
  • Currently I'm having some random crashes because some bug with amdgpu and wayland and mutter, but it's not too annoying for me to go back, so I didn't use snapper this time and I'm facing this random crashes waiting for the fix.

Long live the Tumbleweed

So far so good. Tumbleweed is a nice distribution that I'm enjoying. It's not getting in the way and I can find almost anything that I need for work, programming, gaming, media, etc. I'm really happy with this distribution and it's the perfect distribution for people like me, that want to have the latest things.

I know that there are other openSUSE flavors that are interesting, like the immutable ones, Leap or the latest one Slowroll, but Tumbleweed is the one for me.

the avatar of openSUSE News

Tumbleweed's Graphic Updates Shine

This week’s openSUSE Tumbleweed snapshots brings clarity for graphics thanks to updates of multiple graphics and imaging packages.

Package updates for Mesa, GTK, ImageMagick, webkit2gtk3, GraphicsMagick and others arrived in openSUSE’s rolling release.

Mesa has in update in the latest snapshot to be released, 20231003. The 23.2.0 version of Mesa and Mesa-drivers has fixes for handling bindless images, limiting flag use to some color surfaces and enables the VK_EXT_mesh_shader extensions for the Vulkan graphics Application Programming Interface where supported. The update of gtk4 4.12.3 had widget enhancements, fixes a widget crash in the GIMP Toolkit library and memory leaks in the Broadway renderer. The 2.42.1 version of webkit2gtk3 addresses issues such as enabling the HTML5 database setting to properly control the IndexedDB API and switches a package to allow for flexibility in choosing different International Components for Unicode development packages. An update of GraphicsMagick 1.3.42 arrived in the snapshot that brought fixes for TIFF and for reading various BMP sub-formats. The Swiss Army knife of image processing also has new features include the ability to read and write BMP using JPEG compression and support for reading BMP files with PNG compression. An update of systemd 254.5 made some adjustments in the package spec file for better compatibility with Leap and SUSE Linux Enterprise. Several other packages were updated in the snapshot.

The versatile image manipulation software package ImageMagick updates to version 7.1.1.18 in snapshot 20231001. This beta release addresses multiple static analyzer issues, eliminates compiler warnings and has some cosmetic changes. An update of php8 and apache2-mod_php8 8.2.11 address some RISC-V compatibility issues and a couple of memory leaks. An update of suse-module-tools 16.0.36 addresses a critical security vulnerability identified as CVE-2023-1829. This exploit could lead to a privilege in escalation. A command line device management update for the storage and transfer protocol enhances performance after allocating a payload buffer within the create-ns command; the nvme-cli 2.6 package also blacklists specific modules to address security and compatibility concerns. The package also has various improvements for plugins and utilities. The above package along with the update of libnvme has the most changes in the snapshot. The libnvme 1.6 update enhances Python compatibility, introduces some functions to parse and retrieve various features and has various improvements related to fabric handling, subsystem matching algorithms, and context checks. Several other packages were updated including a 1.2.0 beta version of xdg-utils, which enhances support for LXQt Desktop Environment, provides better handling of spaces in .desktop file paths and fixes some shell scripting.

The 20230929 snapshot updates the Mozilla Firefox browser to new major version 118.0.1. The update addresses 10 Common Vulnerabilities and Exposures include a heap buffer overflow, memory leak, memory corruption and double-free problems. The browser also temporarily deactivates KDE integration while adding a patch. Another major update in the snapshot was argyllcms 3.0. This color management package has an extensive rewrite for icclib to ensure future-proofing, has new measuring features and fixes for instrument-related bugs. The update of gstreamer 1.22.6 and its several plugins fix latency regressions in the H.264, improves compatibility with various RTMP (Real-Time Messaging Protocol) and RTSP (Real-Time Streaming Protocol) servers and offers enhancements in signal printing for better clarity. The update of mpg123 1.32.2 addresses regressions from the 1.31 series and makes improvements to build logic and better handle large files. Several other packages updated in the snapshot including openssl-3 3.1.3, yast2-python-bindings major version 5.0.1 and more.

a silhouette of a person's head and shoulders, used as a default avatar

GNOME 45 Wallpapers

With the 45 release out the door, it would be a shame not to reveal some of the behind the scenes for the new wallpapers.

I’ll start off by mentioning a lovely new addition by David Lapshin, Amber, leaning into Inkscape’s mesh gradients.

The default has shown no dramatic departure from the triangles/hexagons of the previous releases. The on-brand triangle theme has been kept, but the implementation is very different. The wallpaper is a result of a generated mesh using Blender’s geometry nodes and color gradients derived from a pre-existing wallpaper texture. You can check the whole thing out in the provided blender project files in wallpaper-assets.

There have been updates to the existing set, the surprisingly popular Blobs have been tweaked, my personal favorite, Fold crops a bit better at the most common 16:9 aspect and Truchet is round yet again. Pixels have been updated to feature Circle apps.

Weirdly named Morphogenesis is one of my favorite additions this release. Based around a concept of reactive diffusion, described by none other than Allan Turing, features a little easter egg if you’re into chasing those down.

Previously, Previously, Previously, Previously

a silhouette of a person's head and shoulders, used as a default avatar

Compressing HTTP traffic in syslog-ng

Network traffic is expensive in the cloud, and even a single syslog-ng instance can easily saturate the full bandwidth of a network connection. Compressing HTTP traffic was introduced in syslog-ng Version 4.4.0 and depending on your use case, you can cut down on your expenses on your networking or send more logs using the same budget or bandwidth.

Development of this feature was done using a locally installed OpenResty web server, and later tested using Sumologic. However, according to the docs it should also work with Splunk, Elasticsearch, and many other services accessible using the http() destination.

https://www.syslog-ng.com/community/b/blog/posts/compressing-http-traffic-in-syslog-ng