[LDM] Linux Driver Management gets manjarofied

#1

Linux Driver Management provides a core library and some tooling to enable the quick and easy enumeration of system devices, and functionality to match devices to packages/drivers. This is designed to be as agnostic as feasible whilst supporting a wide range of device classes, to provide a building block for driver management and discovery in Linux distributions.

Through this library we aim to centralise driver management solutions for Linux, and allow all distributions a chance to improve the UX around driver/device installation through device/driver discovery, with hotplug capabilities. Users should be able to plug in that new device and have the corresponding drivers offered to them dynamically, without having to hunt through software centers and menus for driver tools. Additionally - users might not realise they need to install extra support, and will rightfully believe that it’s “broken”.

So we are far from having this working on Manjaro yet. The base system however I already added to our repos. So this works, however doesn’t do anything yet.

phil@development ~/dev/git/manjaro/repositories/stable-repos/extra/linux-driver-management $ linux-driver-management status
Failed to find any system modalias plugins
 ╒ Hardware Platform
 ╞ Platform Vendor : MSI
 ╘ Platform Model  : B350M MORTAR (MS-7A37)

Simple GPU configuration

 ╒ Primary GPU
 ╞ Device Name   : GK107 [GeForce GTX 650]
 ╞ Manufacturer  : NVIDIA Corporation
 ╞ Product ID    : 0x0fc6
 ╞ Vendor ID     : 0x10de
 ╞ X.Org PCI ID  : PCI:28:0:0
 ╘ Boot VGA      : yes

With this thread I’ll keep our community updated on my progress integrating this one properly.

30 Likes

[mhwd] merge opensource graphicsdriver scripts?
#2

So one step further…

Driver Matching

The core form of driver matching is to use *.modaliases files. These are identical in syntax to the older Ubuntu Jockey style modalias files, and can be used in a drop in fashion. Notably these files provide matching currently for the following subsystems:

  • hid
  • usb
  • pci
  • dmi
  • bluetooth

Example modalias files can be found in the tests/data/*.modaliases set. Essentially they provide a fnmatch(3) style string to match each device node modalias, the name of the kernel driver, and the name of the package or bundle that the user would need to install to enable it. It is then up to the consumer of the APIs to do something with those providers.

These modaliases can be generated at package build time and split into subpackages, allowing the main driver tool/software center to depend on all -modaliases subpackages to provide drop-in hardware detection. The exact interpretation of the kernel driver and package/bundle name are left to the discretion of the library consumer in order to allow LDM to remain agnostic.

For open source kernel drivers with well defined modaliases, you can use the mkmodaliases(1) tool provided by LDM to automatically generate these files during your package build. Note however that for the NVIDIA Proprietary drivers this will lead to poor matching, a problem well understood by many distributions already. It is also recommended to use a custom modalias for the broadcom drivers due to a poor built-in loose match:

alias pci:v000014E4d*sv*sd*bc02sc80i* wl broadcom-sta

Whilst .modaliases files typically refer to kernel modules, they can be (ab)used in software centers and such to match devices to userspace packages that add capabilities, as more of a recommendation system. For example, matching hid: lines for a mouse and providing a custom userspace USB driver (usbfs).

With the default meson configuration, modaliases will be found in /usr/share/linux-driver-management/modaliases.

After creating the needed modaliases, we see more on the detection.

phil@development ~/ $ ls /usr/share/linux-driver-management/modaliases/*.modaliases
/usr/share/linux-driver-management/modaliases/linux316-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux318-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux414-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux414-rt-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux415-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux416-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux41-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux44-nvidia.modaliases
/usr/share/linux-driver-management/modaliases/linux49-nvidia.modaliases

LDM provides now some options:

$ linux-driver-management status
 ╒ Hardware Platform
 ╞ Platform Vendor : MSI
 ╘ Platform Model  : B350M MORTAR (MS-7A37)

Simple GPU configuration

 ╒ Primary GPU
 ╞ Device Name   : GK107 [GeForce GTX 650]
 ╞ Manufacturer  : NVIDIA Corporation
 ╞ Product ID    : 0x0fc6
 ╞ Vendor ID     : 0x10de
 ╞ X.Org PCI ID  : PCI:28:0:0
 ╘ Boot VGA      : yes

LDM Providers for GK107 [GeForce GTX 650]: 9
 -  linux49-nvidia
 -  linux44-nvidia
 -  linux416-nvidia
 -  linux415-nvidia
 -  linux414-rt-nvidia
 -  linux414-nvidia
 -  linux41-nvidia
 -  linux318-nvidia
 -  linux316-nvidia

Now I’ve to find a concept, on how we deal with it, as we have several kernels on our end to choose from …

7 Likes

#3

This sounds very promising.

One question though. How does Linux Driver Management handle hybrid setups, like Intel/AMD or Intel/Nvidia? Will it setup PRIME or bumblebee?

0 Likes

#4

LDM is now in our stable repos. You may install it on your machine and test the output of your system, if you have a hybrid gfx card setup. It can’t install any drivers, but configures it. It takes a while and some discussion with Solus on how we may integrate it properly to Manjaro.

0 Likes

#5

hmm:

Packages (1) ldm-sddm-integration-1.0.3-0

Total Download Size:   0,01 MiB
Total Installed Size:  0,02 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 ldm-sddm-integration-1.0.3-0-any                    9,5 KiB  1184K/s 00:00 [##########################################] 100%
(1/1) checking keys in keyring                                              [##########################################] 100%
(1/1) checking package integrity                                            [##########################################] 100%
(1/1) loading package files                                                 [##########################################] 100%
(1/1) checking for file conflicts                                           [##########################################] 100%
error: failed to commit transaction (conflicting files)
ldm-sddm-integration: /usr/share/sddm/scripts/Xsetup exists in filesystem
Errors occurred, no packages were upgraded.
[fademind@manjaro ~]$ pacman -Qo /usr/share/sddm/scripts/Xsetup
/usr/share/sddm/scripts/Xsetup is owned by sddm 0.17.0-5
[fademind@manjaro ~]$ 

Results

[fademind@manjaro ~]$ linux-driver-management status
Failed to find any system modalias plugins
 ╒ Hardware Platform
 ╞ Platform Vendor : ASUSTeK COMPUTER INC.
 ╘ Platform Model  : K55VM

NVIDIA Optimus

 ╒ Primary GPU (iGPU)
 ╞ Device Name   : 3rd Gen Core processor Graphics Controller
 ╞ Manufacturer  : Intel Corporation
 ╞ Product ID    : 0x0166
 ╞ Vendor ID     : 0x8086
 ╞ X.Org PCI ID  : PCI:0:2:0
 ╘ Boot VGA      : yes

 ╒ Secondary GPU (dGPU)
 ╞ Device Name   : GF108M [GeForce GT 620M/630M/635M/640M LE]
 ╞ Manufacturer  : NVIDIA Corporation
 ╞ Product ID    : 0x0de9
 ╞ Vendor ID     : 0x10de
 ╞ X.Org PCI ID  : PCI:1:0:0
 ╘ Boot VGA      : no
[fademind@manjaro ~]$
0 Likes

#6

pkg tries to create/replace a file from sddm, which you cant. need some pre_install() shenanigans

0 Likes

#7

@vetzki: this is Solus technology and will need some adoption. It is not yet ment to function in Manjaro. We have to see the content of ‘/usr/share/sddm/scripts/Xsetup’ and see on how we implement it, so it works. Mostly needed for Optimus setups.

0 Likes

#8

I know, content of default Xsetup is

#!/bin/sh
# 
(empty)

I fiddled a lot with sddm and other optimus related stuff because of strong dislike of bumblebee (and needed a way to be able to switch beetwen intel as and nvidia as used gpu).
pre nvidia 360 something it was nasty
between 360 and libglvnd change is was even nastier (had to use linux driver form nvidia driver site couldn’t use packagemanager)
since libglvnd change its fortunately pretty easy

once I even tought wayland may fix all this fiddling…how naive was I back then…

0 Likes