[systemd-devel] Start service after video drivers have been loaded

Mantas Mikulėnas grawity at gmail.com
Tue May 21 14:59:33 UTC 2019


On Tue, May 21, 2019 at 5:56 PM Mantas Mikulėnas <grawity at gmail.com> wrote:

> On Tue, May 21, 2019 at 1:39 PM Germano Massullo <
> germano.massullo at gmail.com> wrote:
>
>> Hello, Fedora / EPEL BOINC comaintainer here.
>> On BOINC client we have a problem. On some Linux distributions BOINC
>> gets loaded before the videocard drivers are loaded, so it does not
>> detect OpenCL/CUDA capabilities.
>> We cannot use graphical.target as wait condition because there can be
>> headless systems without graphic server so this condition cannot be
>> used.
>> What can be a good solution in your opinion?
>>
>
> You cannot really know when *all* devices have been detected. Although,
> since graphics cards are probably always fixed PCI devices, maybe a limited
> form of `udevadm settle` (one that doesn't block the rest of boot process)
> would work?
>
> You can know when the *first* device has been detected. This is probably
> just as poor a suggestion as above, but worth a try: Add a dependency on
> dev-dri-card0.device (and an udev rule to apply TAG+="systemd" to drm
> devices).
>
> (Even crazier would be to allow BOINC to start as normal, but then
> *restart* it as soon as the first GPU driver has been loaded.)
>
>
Actually, maybe having udev trigger BOINC startup would be a good option?
After all that's how BlueZ already works -- it doesn't go in
multi-user.target, it has WantedBy=bluetooth.target and there's an udev
rule that makes every Bluetooth device pull in bluetooth.target as a
dependency. And that's already an official systemd thing, too.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190521/4933db34/attachment-0001.html>


More information about the systemd-devel mailing list