[pve-devel] [PATCH pve-nvidia-vgpu-helper v2 4/4] debian: add and install nvidia-vgpu systemd template unit file
Dominik Csapak
d.csapak at proxmox.com
Tue Jan 21 11:36:21 CET 2025
mhmm not sure if it's so good to reuse the exiting name of the nvidia service
for this. also not sure how systemd likes it if there is a service 'foo.service'
and a template 'foo at .service' (though my guess would be that it's not that big of an issue)
i'd like to seee a distinct name for this (maybe even with pve prefix) like:
pve-nvidia-sriov at .service
Then it's clear where it comes from and what it's for (vgpud is an nvidia daemon
that does not really has anything to do with what this does)
Or do you have any objections to that?
also, would it make sense to add a
---
ConditionPathExists=/usr/lib/nvidia/sriov-manage
---
too?
otherwise users that enable it accidentally or too early run into an ugly error
(though that can be desired too)
On 1/21/25 11:04, Hannes Duerr wrote:
> Signed-off-by: Hannes Duerr <h.duerr at proxmox.com>
> ---
> debian/nvidia-vgpud at .service | 12 ++++++++++++
> debian/rules | 3 +++
> 2 files changed, 15 insertions(+)
> create mode 100644 debian/nvidia-vgpud at .service
>
> diff --git a/debian/nvidia-vgpud at .service b/debian/nvidia-vgpud at .service
> new file mode 100644
> index 0000000..b3c1220
> --- /dev/null
> +++ b/debian/nvidia-vgpud at .service
> @@ -0,0 +1,12 @@
> +[Unit]
> +Description=Enable NVIDIA SR-IOV for PCI ID %i
> +After=network.target nvidia-vgpud.service nvidia-vgpu-mgr.service
> +Before=pve-guests.service
> +
> +[Service]
> +Type=oneshot
> +ExecStartPre=/bin/sleep 5
> +ExecStart=/usr/lib/nvidia/sriov-manage -e %i
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/debian/rules b/debian/rules
> index 218df65..fe9a05d 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -6,3 +6,6 @@
>
> %:
> dh $@
> +
> +override_dh_installsystemd:
> + dh_installsystemd --no-start --no-enable --name nvidia-vgpud@ nvidia-vgpud at .service
More information about the pve-devel
mailing list