services: nvidia: No longer unload ‘nvidia_uvm’ module on powering off.

Shepherd now handles kernel processes properly, no longer need to unload the
module here.

* nongnu/services/nvidia.scm (nvidia-shepherd-service)[requirement]: Remove
'user-processes.
[one-shot?]: Set to #t.
[stop]: Remove field.

Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
This commit is contained in:
Hilton Chain 2024-02-25 14:19:54 +08:00 committed by John Kehayias
parent e4e34b7da4
commit 97925d2091
No known key found for this signature in database
GPG key ID: 499097AE5EA815D9

View file

@ -28,19 +28,16 @@
(define (nvidia-shepherd-service config) (define (nvidia-shepherd-service config)
(let ((nvidia-driver (nvidia-configuration-driver config)) (let ((nvidia-driver (nvidia-configuration-driver config))
(nvidia-smi (file-append nvidia-driver "/bin/nvidia-smi")) (nvidia-smi (file-append nvidia-driver "/bin/nvidia-smi")))
(rmmod (file-append kmod "/bin/rmmod")))
(list (shepherd-service (list (shepherd-service
(documentation "Prepare system environment for NVIDIA driver.") (documentation "Prepare system environment for NVIDIA driver.")
(provision '(nvidia)) (provision '(nvidia))
(requirement '(udev user-processes)) (requirement '(udev))
(one-shot? #t)
(start (start
#~(lambda _ #~(lambda _
(when (file-exists? #$nvidia-smi) (when (file-exists? #$nvidia-smi)
(system* #$nvidia-smi)))) (system* #$nvidia-smi))))))))
(stop
#~(lambda _
(system* #$rmmod "nvidia_uvm")))))))
(define nvidia-service-type (define nvidia-service-type
(service-type (service-type