You are not logged in.

#1 2022-05-27 12:11:28

UnequalB
Member
Registered: 2021-05-17
Posts: 21

Systemd service not working, despite reporting as successful.

I finally got intel gvt-g working on arch, but for some reason the systemd service doesn't create the gpu on startup despite being enabled. However, if i start the service manually it works fine.

The service:

[Unit]
Description=Create Intel Virtual GPU
After=graphical.target

[Service]
User=root
Type=oneshot
ExecStart=/bin/sh -c echo (UUID) > /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create
ExecStop=/bin/sh -c "echo '1' > /sys/devices/pci0000:00/0000:00:02.0/(UUID)/remove"
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

I've tried without the execstop and remainafterexit lines, as well as having the service reference a script instead of executing directly, all to the same result, service works using systemctl start, but not on startup.

Output of

systemctl status gvtgcreate.service

:

● gvtgcreate.service - Create Intel Virtual GPU
     Loaded: loaded (/usr/lib/systemd/system/gvtgcreate.service; enabled; vendor preset: disabled)
     Active: active (exited) since Fri 2022-05-27 11:45:10 GMT; 22min ago
    Process: 779 ExecStart=/bin/sh -c echo (UUID) > /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create (code(code=exited, status=0/SUCCESS)
   Main PID: 779 (code=exited, status=0/SUCCESS)
        CPU: 11ms

May 27 11:45:10 ArchBiscuit systemd[1]: Starting Create Intel Virtual GPU...
May 27 11:45:10 ArchBiscuit systemd[1]: Finished Create Intel Virtual GPU.

Last edited by UnequalB (2022-05-27 12:12:09)


CPU: Intel Core i5-8265U (Coffee Lake)
GPU: Intel UHD Graphics 620 (Whiskey Lake-U GT2) / NVIDIA MX130
Laptop model: HP ProBook 450 G6
Kernel: Zen

Offline

#2 2022-05-27 14:41:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,638

Re: Systemd service not working, despite reporting as successful.

Try https://wiki.archlinux.org/title/Kernel … _KMS_start
Also you probably want to quote the command.

After=graphical.target

WantedBy=multi-user.target

??

Online

#3 2022-05-28 22:53:59

UnequalB
Member
Registered: 2021-05-17
Posts: 21

Re: Systemd service not working, despite reporting as successful.

seth wrote:

Try https://wiki.archlinux.org/title/Kernel … _KMS_start
Also you probably want to quote the command.

After=graphical.target

WantedBy=multi-user.target

??

I had early kms set already (for plymouth).
Tried quoting the command, no dice.
I also tried:

After=graphical.target

and

WantedBy=graphical.target

without the multi-user line.


CPU: Intel Core i5-8265U (Coffee Lake)
GPU: Intel UHD Graphics 620 (Whiskey Lake-U GT2) / NVIDIA MX130
Laptop model: HP ProBook 450 G6
Kernel: Zen

Offline

#4 2022-05-29 05:48:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,638

Re: Systemd service not working, despite reporting as successful.

I guess it's because kvmgt, vfio-iommu-type1 and mdev are only loaded afterwards by system explicitly

Did you test whether the file exists?

ExecStart=/bin/sh -c "[ -e /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create ] || exit 1; echo (UUID) > /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create"

Online

Board footer

Powered by FluxBB