;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Hebi Li ;;; Copyright © 2020 Malte Frank Gerdes ;;; Copyright © 2020, 2021 Jean-Baptiste Volatier ;;; Copyright © 2020-2022 Jonathan Brielmaier ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2022, 2023 Petr Hodina ;;; Copyright © 2022 Alexey Abramov ;;; Copyright © 2022-2026 Hilton Chain (define-module (nongnu packages nvidia) #:use-module (guix packages) #:use-module (guix deprecation) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix utils) #:use-module ((guix licenses) #:prefix license-gnu:) #:use-module ((nonguix licenses) #:prefix license:) #:use-module (nonguix utils) #:use-module (guix build-system linux-module) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bootstrap) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages elf) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages linux) #:use-module (gnu packages m4) #:use-module (gnu packages lsof) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages tls) #:use-module (gnu packages video) #:use-module (gnu packages vulkan) #:use-module (gnu packages web) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (nongnu packages linux) #:use-module (nongnu packages video) #:use-module (ice-9 match) #:export (replace-mesa)) (define-public %nvidia-environment-variable-regexps '("^__NV_" "^__GL_" ; NVIDIA OpenGL settings. "^__GLX_VENDOR_LIBRARY_NAME$" ; For GLVND. ;; NVIDIA PRIME Render Offload. "^__VK_LAYER_NV_optimus$" ;; NVIDIA NGX. "^__NGX_CONF_FILE$" "^PROTON_ENABLE_NGX_UPDATER$" ;; NVIDIA Smooth Motion. "^NVPRESENT_" ;; NVIDIA VDPAU settings. "^VDPAU_NVIDIA_" ;; GSYNC control for Vulkan direct-to-display applications. "^VKDirectGSYNC(Compatible)?Allowed$")) (define (add-architecture-to-filename) #~(lambda (path) (let* ((out #$output) (system #$(or (%current-target-system) (%current-system))) (dash (string-index system #\-)) (arch (string-take system dash)) (dot (string-index-right path #\.)) (base (string-take path dot)) (ext (string-drop path (+ 1 dot)))) ;; <...>/50_mesa.json -> <...>/50_mesa.x86_64.json (rename-file (string-append out path) (string-append out base "." arch "." ext))))) (define (%nvidia-install-plan-390) #~'((#$(cond ((target-x86-32?) "32") (else ".")) "lib/" #:include-regexp ("^./[^/]+\\.so")) #$@(if (target-64bit?) '(("." "bin/" #:include ("nvidia-cuda-mps-control" "nvidia-cuda-mps-server" "nvidia-smi")) ("." "share/man/man1/" #:include ("nvidia-cuda-mps-control.1.gz" "nvidia-smi.1.gz")))) ("." "lib/nvidia/wine/" #:include-regexp ("_?nvngx.*?\\.dll$")) ("." "share/nvidia/" #:include-regexp ("nvidia-application-profiles|nvoptix.bin")) ("." "share/egl/egl_external_platform.d/" #:include-regexp ("(gbm|wayland2?|xcb|xlib)\\.json")) ("10_nvidia.json" "share/glvnd/egl_vendor.d/") ("nvidia-drm-outputclass.conf" "share/X11/xorg.conf.d/") ("nvidia.icd" "etc/OpenCL/vendors/") ("nvidia_icd.json" "share/vulkan/icd.d/"))) (define (%nvidia-install-plan-470) #~`(("nvidia_layers.json" "share/vulkan/implicit_layer.d/") ,@#$(%nvidia-install-plan-390))) (define (%nvidia-install-plan-580) #~`(("nvidia-dbus.conf" "share/dbus-1/system.d/") ("sandboxutils-filelist.json" "share/nvidia/files.d/") #$@(if (target-x86-64?) '(("nvidia-pcc" "bin/")) '()) #$@(if (target-x86?) '(("nvidia_icd_vksc.json" "etc/vulkansc/icd.d/")) '()) ,@#$(%nvidia-install-plan-470))) (define %nvidia-icd-configurations-390 #~'("/etc/OpenCL/vendors/nvidia.icd" "/share/egl/egl_external_platform.d/10_nvidia_wayland.json" "/share/glvnd/egl_vendor.d/10_nvidia.json" "/share/vulkan/icd.d/nvidia_icd.json")) (define %nvidia-icd-configurations-470 #~`("/share/vulkan/implicit_layer.d/nvidia_layers.json" ,@#$%nvidia-icd-configurations-390)) (define %nvidia-icd-configurations-580 #~`("/share/egl/egl_external_platform.d/15_nvidia_gbm.json" "/share/egl/egl_external_platform.d/20_nvidia_xcb.json" "/share/egl/egl_external_platform.d/20_nvidia_xlib.json" ,@#$%nvidia-icd-configurations-470)) (define %nvidia-icd-configurations-590 #~`("/share/egl/egl_external_platform.d/99_nvidia_wayland2.json" ,@#$%nvidia-icd-configurations-580)) (define %nvidia-icd-configurations-beta #~`("/share/egl/egl_external_platform.d/09_nvidia_wayland2.json" ,@#$%nvidia-icd-configurations-580)) ;;; ;;; NVIDIA driver checkouts ;;; (define* (make-nvidia-source version installer #:key (patches '()) snippet) (origin (method (@@ (guix packages) computed-origin-method)) (file-name (string-append "nvidia-driver-source-" version "-checkout")) (sha256 #f) (patches patches) (modules '((guix build utils))) (snippet snippet) (uri (delay (with-imported-modules '((guix build utils)) #~(begin (use-modules (ice-9 ftw) (srfi srfi-1) (guix build utils)) (set-path-environment-variable "PATH" '("bin") '#+(list bash-minimal coreutils-minimal gawk grep tar which xz zstd)) (invoke "sh" #+installer "--extract-only" "--target" "extractdir") (when (file-exists? "extractdir/kernel-open") (delete-file-recursively "extractdir/kernel-open")) (for-each delete-file (find-files "extractdir" (string-join '(;; egl-gbm "libnvidia-egl-gbm\\.so\\." ;; egl-wayland "libnvidia-egl-wayland\\.so\\." ;; egl-wayland2 "libnvidia-egl-wayland2\\.so\\." ;; egl-x11 "libnvidia-egl-xcb\\.so\\." "libnvidia-egl-xlib\\.so\\." ;; libglvnd "libEGL\\.so\\." "libGL\\.so\\." "libGLESv1_CM\\.so\\." "libGLESv2\\.so\\." "libGLX\\.so\\." "libGLdispatch\\.so\\." "libOpenGL\\.so\\." ;; nvidia-settings "libnvidia-gtk[23]\\.so\\." ;; opencl-icd-loader "libOpenCL\\.so\\.") "|"))) (copy-recursively "extractdir" #$output))))))) (define %nvidia-patches-390 (let ((commit "caed47174d2c835921d9f23ea08c630ef5cdea06")) (origin (method git-fetch) (uri (git-reference (url "https://aur.archlinux.org/nvidia-390xx-utils.git/") (commit commit))) (file-name (string-append "nvidia-patches." (string-take commit 7))) (sha256 (base32 "0bsdb8lhycpiqf32lnxm7nnivh4hyfikwd2lii357pv12ix6z6v7"))))) (define %nvidia-patches-470 (let ((commit "23ccd6e8d9b27256d4f491666b2779c663ab9f39")) (origin (method git-fetch) (uri (git-reference (url "https://github.com/joanbm/nvidia-470xx-linux-mainline") (commit commit))) (file-name (string-append "nvidia-patches." (string-take commit 7))) (sha256 (base32 "09l7qmlgi27ydjzb6w6pksc36qs2c6g8aai5kf8y97bw5m83viww")) (modules '((guix build utils))) (snippet '(substitute* (find-files "." "\\.patch$") (("^--- a/" all) (string-append all "kernel/")) (("^\\+\\+\\+ b/" all) (string-append all "kernel/"))))))) ;;; ;;; NVIDIA drivers ;;; (define-public nvidia-driver-580 (package (name "nvidia-driver") (version "580.142") (source (make-nvidia-source version (origin (method url-fetch) (uri (string-append "https://download.nvidia.com/XFree86/Linux-x86_64/" version "/NVIDIA-Linux-x86_64-" version ".run")) (sha256 (base32 "0qvm8hh3d90i3674dqlj1lam6m189ah60fzr1iaw72gy7z7mz490"))))) (build-system gnu-build-system) (arguments (list #:imported-modules `((guix build copy-build-system) ,@%default-gnu-imported-modules) #:modules `((ice-9 popen) (ice-9 rdelim) (ice-9 regex) (srfi srfi-26) ((guix build copy-build-system) #:prefix copy:) ,@%default-gnu-modules) #:phases #~(modify-phases %standard-phases (delete 'configure) (delete 'build) (delete 'check) (delete 'strip) (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan #$(%nvidia-install-plan-580) args))) (add-after 'unpack 'create-misc-files (lambda* (#:key inputs #:allow-other-keys) ;; EGL external platform configuraiton (substitute* (find-files "." "(gbm|wayland2?|xcb|xlib)\\.json") (("libnvidia-egl-.*\\.so\\.." all) (search-input-file inputs (string-append "lib/" all)))) ;; EGL vendor ICD configuration (substitute* "10_nvidia.json" (("libEGL_nvidia\\.so\\.." all) (string-append #$output "/lib/" all))) ;; OpenCL vendor ICD configuration (substitute* "nvidia.icd" (("libnvidia-opencl\\.so\\.." all) (string-append #$output "/lib/" all))) ;; Vulkan ICD & layer configuraiton (substitute* (find-files "." "nvidia_(icd|layers)\\.json") ;; 390 driver (("__NV_VK_ICD__") "libGLX_nvidia.so.0") ;; Others (("libGLX(_nvidia\\.so\\..)" _ suffix) (string-append #$output "/lib/libEGL" suffix)) (("libnvidia-present\\.so\\.[0-9.]*" all) (string-append #$output "/lib/" all))) ;; VulkanSC ICD configuration (substitute* (find-files "." "nvidia_icd_vksc\\.json") (("libnvidia-vksc-core\\.so\\.." all) (string-append #$output "/lib/" all))))) (add-after 'install 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) #$%nvidia-icd-configurations-580))) (add-after 'install 'patch-elf (lambda* (#:key inputs #:allow-other-keys) (let* ((ld.so (search-input-file inputs #$(glibc-dynamic-linker))) (rpath (string-join (cons* (dirname ld.so) (string-append #$output "/lib") (map (lambda (name) (dirname (search-input-file inputs (string-append "lib/" name)))) '("libGL.so.1" "libX11.so.6" "libXext.so.6" "libcrypto.so.1.1" "libcrypto.so.3" "libdrm.so.2" "libgbm.so.1" "libgcc_s.so.1" "libnvidia-egl-wayland.so.1" "libwayland-client.so.0" "libxcb.so.1"))) ":"))) (define (patch-elf file) (format #t "Patching ~a ..." file) (unless (string-contains file ".so") (invoke "patchelf" "--set-interpreter" ld.so file)) (invoke "patchelf" "--set-rpath" rpath file) (display " done\n")) (for-each (lambda (file) (when (elf-file? file) (patch-elf file))) (find-files #$output))))) (add-before 'patch-elf 'relocate-libraries (lambda _ (let* ((version #$(package-version this-package)) (libdir (string-append #$output "/lib")) (gbmdir (string-append libdir "/gbm")) (vdpaudir (string-append libdir "/vdpau")) (xorgmoddir (string-append libdir "/xorg/modules")) (xorgdrvdir (string-append xorgmoddir "/drivers")) (xorgextdir (string-append xorgmoddir "/extensions")) (move-to-dir (lambda (file dir) (install-file file dir) (delete-file file)))) (for-each (lambda (file) (mkdir-p gbmdir) (with-directory-excursion gbmdir (symlink file "nvidia-drm_gbm.so"))) (find-files libdir "libnvidia-allocator\\.so\\.")) (for-each (cut move-to-dir <> vdpaudir) (find-files libdir "libvdpau_nvidia\\.so\\.")) (for-each (cut move-to-dir <> xorgdrvdir) (find-files libdir "nvidia_drv\\.so$")) (for-each (lambda (file) (move-to-dir file xorgextdir) (with-directory-excursion xorgextdir (symlink (basename file) "libglxserver_nvidia.so"))) (find-files libdir "libglxserver_nvidia\\.so\\."))))) (add-after 'patch-elf 'create-short-name-symlinks (lambda _ (define (get-soname file) (when (elf-file? file) (let* ((cmd (string-append "patchelf --print-soname " file)) (port (open-input-pipe cmd)) (soname (read-line port))) (close-pipe port) soname))) (for-each (lambda (lib) (let ((lib-soname (get-soname lib))) (when (string? lib-soname) (let* ((soname (string-append (dirname lib) "/" lib-soname)) (base (string-append (regexp-substitute #f (string-match "(.*)\\.so.*" soname) 1) ".so")) (source (basename lib))) (for-each (lambda (target) (unless (file-exists? target) (format #t "Symlinking ~a -> ~a..." target source) (symlink source target) (display " done\n"))) (list soname base)))))) (find-files #$output "\\.so\\."))))))) (supported-systems '("x86_64-linux" "i686-linux")) (native-inputs (list patchelf-0.16)) (inputs (list egl-gbm egl-wayland egl-wayland2 egl-x11 `(,gcc "lib") glibc mesa-for-nvda openssl openssl-1.1 wayland)) (home-page "https://www.nvidia.com") (synopsis "Proprietary NVIDIA driver (libraries)") (description "This package provides libraries of the proprietary NVIDIA driver. It's mainly used as a dependency of other packages. For user-facing purpose, use @code{nvda} instead.") (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) (define-public nvidia-driver-390 (package (inherit nvidia-driver-580) (name "nvidia-driver") (version "390.157") (source (make-nvidia-source version (origin (method url-fetch) (uri (string-append "https://download.nvidia.com/XFree86/Linux-x86_64/" version "/NVIDIA-Linux-x86_64-" version ".run")) (sha256 (base32 "12ijkc5zvs3ivk5m69cm6k2ys60z6nggnw0hv2wxdmgyx2kbrssv"))) #:patches (map (lambda (name) (file-append %nvidia-patches-390 "/" name)) '("kernel-4.16+-memory-encryption.patch" "kernel-6.2.patch" "kernel-6.3.patch" "kernel-6.4.patch" "kernel-6.5.patch" "kernel-6.6.patch" "kernel-6.8.patch" "gcc-14.patch" "kernel-6.10.patch" "kernel-6.12.patch" "kernel-6.13.patch" "kernel-6.14.patch" "gcc-15.patch" "kernel-6.15.patch" "kernel-6.17.patch" "kernel-6.19.patch" "kernel-6.18-nv_workqueue_flush.patch")) #:snippet #~(rename-file "nvidia_icd.json.template" "nvidia_icd.json"))) (arguments (substitute-keyword-arguments arguments ((#:phases phases) #~(modify-phases #$phases (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan #$(%nvidia-install-plan-390) args))) (replace 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) #$%nvidia-icd-configurations-390))))))) (supported-systems '("x86_64-linux" "i686-linux")))) (define-public nvidia-driver-470 (package (inherit nvidia-driver-580) (name "nvidia-driver") (version "470.256.02") (source (make-nvidia-source version (origin (method url-fetch) (uri (string-append "https://download.nvidia.com/XFree86/Linux-x86_64/" version "/NVIDIA-Linux-x86_64-" version ".run")) (sha256 (base32 "1pmi949s0gzzjw2w3qhhihb82gppd1icvdzk8w2bp5dnvri1hifn"))) #:patches (map (lambda (name) (file-append %nvidia-patches-470 "/" name)) '("0001-Fix-conftest-to-ignore-implicit-function-declaration.patch" "0002-Fix-conftest-to-use-a-short-wchar_t.patch" "0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch" "nvidia-470xx-fix-gcc-15.patch" "kernel-6.10.patch" "kernel-6.12.patch" "nvidia-470xx-fix-linux-6.13.patch" "nvidia-470xx-fix-linux-6.14.patch" "nvidia-470xx-fix-linux-6.15.patch" "nvidia-470xx-fix-linux-6.17.patch" "nvidia-470xx-fix-linux-6.19-part1.patch" "nvidia-470xx-fix-linux-6.19-part2.patch")))) (arguments (substitute-keyword-arguments arguments ((#:phases phases) #~(modify-phases #$phases (replace 'install (lambda args (apply (assoc-ref copy:%standard-phases 'install) #:install-plan #$(%nvidia-install-plan-470) args))) (replace 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) #$%nvidia-icd-configurations-470))))))))) (define-public nvidia-driver-590 (package (inherit nvidia-driver-580) (name "nvidia-driver") (version "590.48.01") (source (make-nvidia-source version (origin (method url-fetch) (uri (string-append "https://download.nvidia.com/XFree86/Linux-x86_64/" version "/NVIDIA-Linux-x86_64-" version ".run")) (sha256 (base32 "12fnddljvgxksil6n3d5a35wwg8kkq82kkglhz63253qjc3giqmr"))))) (arguments (substitute-keyword-arguments arguments ((#:phases phases) #~(modify-phases #$phases (replace 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) #$%nvidia-icd-configurations-590))))))))) (define-public nvidia-driver-beta (package (inherit nvidia-driver-590) (name "nvidia-driver-beta") (version "595.45.04") (source (make-nvidia-source version (origin (method url-fetch) (uri (string-append "https://download.nvidia.com/XFree86/Linux-x86_64/" version "/NVIDIA-Linux-x86_64-" version ".run")) (sha256 (base32 "0plg9vsim8252c7k3slxblvrspy4xqa6q719flxjmfkc4i4najfd"))))) (arguments (substitute-keyword-arguments arguments ((#:phases phases) #~(modify-phases #$phases (replace 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) #$%nvidia-icd-configurations-beta))))))))) (define-public nvidia-driver nvidia-driver-580) (define-public nvidia-libs (deprecated-package "nvidia-libs" nvidia-driver)) ;;; ;;; NVIDIA firmware ;;; (define-public nvidia-firmware-580 (package (inherit nvidia-driver) (name "nvidia-firmware") (build-system copy-build-system) (arguments (list #:install-plan #~'(("firmware" #$(string-append "lib/firmware/nvidia/" (package-version this-package)))) #:phases #~(modify-phases %standard-phases (delete 'strip)))) (propagated-inputs '()) (inputs '()) (native-inputs '()) (synopsis "Proprietary NVIDIA driver (GPU System Processor firmware)") (description "This package provides @acronym{GSP, GPU System Processor} firmware of the proprietary NVIDIA driver. For free driver (@code{nouveau}) support, use @code{linux-firmware} instead."))) (define-public nvidia-firmware-470 (package (inherit nvidia-firmware-580) (version (package-version nvidia-driver-470)) (source (package-source nvidia-driver-470)))) (define-public nvidia-firmware-590 (package (inherit nvidia-firmware-580) (version (package-version nvidia-driver-590)) (source (package-source nvidia-driver-590)))) (define-public nvidia-firmware-beta (package (inherit nvidia-firmware-580) (name "nvidia-firmware-beta") (version (package-version nvidia-driver-beta)) (source (package-source nvidia-driver-beta)))) (define-public nvidia-firmware nvidia-firmware-580) ;;; ;;; NVIDIA kernel modules ;;; (define-public nvidia-module-580 (package (name "nvidia-module") (version (package-version nvidia-driver-580)) (source (package-source nvidia-driver-580)) (build-system linux-module-build-system) (arguments (list #:linux linux-lts #:source-directory "kernel" #:tests? #f #:make-flags #~(list (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (delete 'strip) (add-before 'configure 'fixpath (lambda* (#:key (source-directory ".") #:allow-other-keys) (substitute* (string-append source-directory "/Kbuild") (("/bin/sh") (which "sh"))))) (replace 'build (lambda* (#:key (make-flags '()) (parallel-build? #t) (source-directory ".") inputs #:allow-other-keys) (apply invoke "make" "-C" (canonicalize-path source-directory) (string-append "SYSSRC=" (search-input-directory inputs "/lib/modules/build")) `(,@(if parallel-build? `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags))))))) (supported-systems '("x86_64-linux")) (home-page "https://www.nvidia.com") (synopsis "Proprietary NVIDIA driver (proprietary kernel modules)") (description "This package provides proprietary kernel modules of the proprietary NVIDIA driver.") (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) (define-public nvidia-module-390 (package (inherit nvidia-module-580) (version (package-version nvidia-driver-390)) (source (package-source nvidia-driver-390)) (supported-systems '("x86_64-linux")))) (define-public nvidia-module-590 (package (inherit nvidia-module-580) (version (package-version nvidia-driver-590)) (source (package-source nvidia-driver-590)))) (define-public nvidia-module-beta (package (inherit nvidia-module-580) (name "nvidia-module-beta") (version (package-version nvidia-driver-beta)) (source (package-source nvidia-driver-beta)))) (define-public nvidia-module nvidia-module-580) ;;; ;;; NVIDIA open source kernel modules. ;;; (define-public nvidia-module-open-580 (package (name "nvidia-module-open") (version "580.142") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/open-gpu-kernel-modules") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "01nq1hmb0kcd7wx38z5a1ivc6r1z3vbwp1zcyz0wijvanhnvrpmz")))) (build-system linux-module-build-system) (arguments (list #:source-directory "kernel-open" #:tests? #f #:make-flags #~(list (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (add-before 'configure 'fix-reference (lambda* (#:key source-directory #:allow-other-keys) (substitute* (string-append source-directory "/Kbuild") (("/bin/sh") (which "sh"))))) (replace 'build (lambda* (#:key inputs make-flags (parallel-build? #t) #:allow-other-keys) (apply invoke "make" (string-append "SYSSRC=" (search-input-directory inputs "/lib/modules/build")) `(,@(if parallel-build? `("-j" ,(number->string (parallel-job-count))) '()) ,@make-flags "modules"))))))) (home-page "https://github.com/NVIDIA/open-gpu-kernel-modules") (synopsis "Proprietary NVIDIA driver (open source kernel modules)") (description "This package provides open source kernel modules of the proprietary NVIDIA driver.") (license license-gnu:gpl2))) (define-public nvidia-module-open-590 (package (inherit nvidia-module-open-580) (name "nvidia-module-open") (version "590.48.01") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/open-gpu-kernel-modules") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "13izbl0npxc6mxaq7123sj7cqksqwcha8fgsgj2dphdk1dz8fh44")))))) (define-public nvidia-module-open-beta (package (inherit nvidia-module-open-580) (name "nvidia-module-open-beta") (version "595.45.04") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/open-gpu-kernel-modules") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "108faqi446ck42gc9q10dbl0779yagyp853phay14ahkdhi5z8xs")))))) (define-public nvidia-module-open nvidia-module-open-580) ;;; ;;; nvidia-modprobe ;;; (define-public nvidia-modprobe-580 (package (name "nvidia-modprobe") (version "580.142") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-modprobe") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1rbl52d40q86y9dbj5qlm5k3rindg5fqh121wxfzrc68fl3gjila")))) (build-system gnu-build-system) (arguments (list #:tests? #f ;No test suite #:make-flags #~(list (string-append "PREFIX=" #$output) (string-append "CC=" #$(cc-for-target)) (string-append "STRIP_CMD=" #$(strip-for-target)) "HOST_CC=gcc") #:phases #~(modify-phases %standard-phases ;; No configure script. (delete 'configure)))) (native-inputs (list m4 pkg-config)) (home-page "https://github.com/NVIDIA/nvidia-modprobe") (synopsis "Load the NVIDIA kernel module and create NVIDIA character device files") (description "The @command{nvidia-modprobe} utility is used by user-space NVIDIA driver components to make sure the NVIDIA kernel module is loaded, the NVIDIA character device files are present and configure certain runtime settings in the kernel.") (license license-gnu:gpl2))) (define-public nvidia-modprobe-390 (package (inherit nvidia-modprobe-580) (name "nvidia-modprobe") (version "390.157") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-modprobe") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0mny1vv81f00w71cp8ffnyx0sv20p339dravrs3gxwawac5m64a7")))))) (define-public nvidia-modprobe-590 (package (inherit nvidia-modprobe-580) (name "nvidia-modprobe") (version "590.48.01") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-modprobe") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1y6kqhvjfpq0zssjsbkwkav2khsb7x63nxgd1lnvrkg660a7knjn")))))) (define-public nvidia-modprobe-beta (package (inherit nvidia-modprobe-580) (name "nvidia-modprobe-beta") (version "595.45.04") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-modprobe") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0s1p89js7f65pzss7fqglddz052lq357xjxyqwpca9kmljxr4dqc")))))) (define-public nvidia-modprobe nvidia-modprobe-580) ;;; ;;; ‘nvidia-settings’ packages ;;; (define %nvidia-settings-patches-390 (let ((commit "6104269b087751509b904d9282be28440e514c9e")) (origin (method git-fetch) (uri (git-reference (url "https://aur.archlinux.org/nvidia-390xx-settings.git") (commit commit))) (file-name (string-append "nvidia-settings-patches." (string-take commit 7))) (sha256 (base32 "0y8zalpymrzxlmh25bqh4x29a4qix3a50qvvykg4hv07mmn0gckx"))))) (define-public nvidia-settings-580 (package (name "nvidia-settings") (version "580.142") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-settings") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "00sdrka3mslqgyhpnxyr6165nbrrfqdp1shgmbgp9ga07sbchyh6")) (modules '((guix build utils))) (snippet '(delete-file-recursively "src/jansson")))) (build-system gnu-build-system) (arguments (list #:tests? #f ;no test suite #:make-flags #~(list "NV_USE_BUNDLED_LIBJANSSON=0" (string-append "PREFIX=" #$output) (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (delete 'configure) (add-after 'unpack 'fix-application-profile-path (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/gtk+-2.x/ctkappprofile.c" (("/usr") "/run/booted-system/profile")))) (add-after 'install 'install-desktop-file (lambda _ (substitute* "doc/nvidia-settings.desktop" (("^Exec=.*") "Exec=nvidia-settings\n") (("__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__") "Settings")) (install-file "doc/nvidia-settings.desktop" (string-append #$output "/share/applications")) (install-file "doc/nvidia-settings.png" (string-append #$output "/share/icons/hicolor/128x128/apps")))) (add-after 'install 'wrap-program (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (wrap-program (string-append out "/bin/nvidia-settings") `("LD_LIBRARY_PATH" ":" prefix (,(string-append out "/lib/")))))))))) (native-inputs (list m4 pkg-config)) (inputs (list bash-minimal dbus glu gtk+ gtk+-2 jansson libvdpau libx11 libxext libxrandr libxv libxxf86vm vulkan-headers)) (synopsis "NVIDIA driver control panel") (description "This package provides NVIDIA driver control panel for monitor configuration, application profiles, GPU monitoring and more.") (home-page "https://github.com/NVIDIA/nvidia-settings") (license license-gnu:gpl2))) (define-public nvidia-settings-390 (package (inherit nvidia-settings-580) (name "nvidia-settings") (version "390.157") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-settings") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "170nx61spd6psly55ghyp46139c9a9r7al0g9nggrhrzm7hlx5mq")) (patches (map (lambda (name) (file-append %nvidia-settings-patches-390 "/" name)) '("0001-nvidia-settings-Make-VDPAUDeviceFunctions-static-to-.patch"))) (modules '((guix build utils))) (snippet '(delete-file-recursively "src/jansson")))))) (define-public nvidia-settings-590 (package (inherit nvidia-settings-580) (name "nvidia-settings") (version "590.48.01") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-settings") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0h9059gkibyiidg5s9cakbg369y9nwfd17vycpsqfswgr18jlsrm")) (modules '((guix build utils))) (snippet '(delete-file-recursively "src/jansson")))))) (define-public nvidia-settings-beta (package (inherit nvidia-settings-580) (name "nvidia-settings-beta") (version "595.45.04") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/nvidia-settings") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0w7ndc2p2131h1wh3rj1dhhs59ihrdfl8ni44x9sdywc5jpnk3k3")) (modules '((guix build utils))) (snippet '(delete-file-recursively "src/jansson")))))) (define-public nvidia-settings nvidia-settings-580) ;;; ;;; ‘nvda’ packages ;;; (define-public libglvnd-for-nvda (hidden-package (package (inherit libglvnd) (arguments (substitute-keyword-arguments arguments ((#:configure-flags flags #~'()) #~(cons* "-Dc_link_args=-Wl,-rpath=$ORIGIN" #$flags)) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases (delete 'shrink-runpath)))))))) (define-public mesa-for-nvda (hidden-package (package (inherit mesa) (propagated-inputs (modify-inputs propagated-inputs (prepend libglvnd-for-nvda))) (arguments (substitute-keyword-arguments arguments ((#:configure-flags flags #~'()) #~(cons* "-Dglvnd=true" #$flags)) ((#:phases phases #~%standard-phases) #~(modify-phases #$phases (add-after 'install 'fix-egl-vendor-icd (lambda _ (substitute* (string-append #$output "/share/glvnd/egl_vendor.d/50_mesa.json") (("libEGL_mesa\\.so\\.." all) (string-append #$output "/lib/" all))))) (add-after 'set-layer-path-in-manifests 'add-architecture-to-filename (lambda _ (for-each #$(add-architecture-to-filename) '("/share/glvnd/egl_vendor.d/50_mesa.json" "/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json" "/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json"))))))))))) ;; nvda is used as a name because it has the same length as mesa which is ;; required for grafting (define-public nvda (package (name "nvda") (version (string-pad-right (package-version nvidia-driver) (string-length (package-version mesa-for-nvda)) #\0)) (source #f) (build-system trivial-build-system) (arguments (list #:modules '((guix build union)) #:builder #~(begin (use-modules (guix build union)) (union-build #$output '#$(list (this-package-input "libglvnd") (this-package-input "mesa") (this-package-input "nvidia-driver") (this-package-input "nvidia-vaapi-driver")))))) (native-search-paths (list ;; https://github.com/NVIDIA/egl-wayland/issues/39 (search-path-specification (variable "__EGL_EXTERNAL_PLATFORM_CONFIG_DIRS") (files '("share/egl/egl_external_platform.d"))) ;; https://gitlab.freedesktop.org/glvnd/libglvnd/-/blob/master/src/EGL/icd_enumeration.md (search-path-specification (variable "__EGL_VENDOR_LIBRARY_DIRS") (files '("share/glvnd/egl_vendor.d"))) ;; See also: ‘src/gbm/main/backend.c’ in mesa source. (search-path-specification (variable "GBM_BACKENDS_PATH") (files '("lib/gbm"))) ;; XXX Because of , we need to add ;; this to all VA-API back ends instead of once to libva. (search-path-specification (variable "LIBVA_DRIVERS_PATH") (files '("lib/dri"))) (search-path-specification (variable "VDPAU_DRIVER_PATH") (files '("lib/vdpau")) (separator #f)) ;; https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderLayerInterface.md (search-path-specification (variable "XDG_DATA_DIRS") (files '("share"))))) (synopsis "Nonguix's user-facing NVIDIA driver package") (description "This package provides a @code{mesa} variant with NVIDIA proprietary driver support. For dependency of other packages, use @code{nvidia-driver} instead.") (native-inputs '()) (propagated-inputs (append (package-propagated-inputs mesa-for-nvda) (package-propagated-inputs nvidia-driver))) (inputs (list mesa-for-nvda nvidia-driver nvidia-vaapi-driver)) (outputs '("out")) (license (package-license nvidia-driver)) (home-page (package-home-page nvidia-driver)))) (define-public nvda-390 ((package-input-rewriting `((,nvidia-driver . ,nvidia-driver-390))) (package (inherit nvda) (version (string-pad-right (package-version nvidia-driver-390) (string-length (package-version mesa-for-nvda)) #\0))))) (define-public nvda-590 ((package-input-rewriting `((,nvidia-driver . ,nvidia-driver-590))) (package (inherit nvda) (version (string-pad-right (package-version nvidia-driver-590) (string-length (package-version mesa-for-nvda)) #\0))))) (define-public nvdb ((package-input-rewriting `((,nvidia-driver . ,nvidia-driver-beta))) (package (inherit nvda) (name "nvdb") (version (string-pad-right (package-version nvidia-driver-beta) (string-length (package-version mesa-for-nvda)) #\0))))) (define* (replace-mesa obj #:key (driver nvda)) (with-transformation (package-input-grafting `((,mesa . ,driver) (,nvidia-driver . ,driver) (,ffmpeg . ,ffmpeg/nvidia) (,ffmpeg-6 . ,ffmpeg-6/nvidia))) obj)) ;;; ;;; Other packages ;;; (define-public egl-gbm (package (name "egl-gbm") (version "1.1.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/egl-gbm") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1p9w7xc7zdrwxxiwmmhmsqf0jlzcgnrkgci2j5da4xzjasyf109s")))) (build-system meson-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'install 'patch-library-reference (lambda* (#:key outputs #:allow-other-keys) (let ((dir "share/egl/egl_external_platform.d")) (with-directory-excursion (in-vicinity #$output dir) (substitute* "15_nvidia_gbm.json" (("libnvidia-egl-.*\\.so\\.." lib) (search-input-file outputs (in-vicinity "lib" lib))))))))))) (native-inputs (list pkg-config)) (inputs (list eglexternalplatform mesa-for-nvda)) (synopsis "GBM EGL external platform library") (description "This package provides an EGL External Platform library implementation for GBM EGL support.") (home-page "https://github.com/NVIDIA/egl-gbm") (license license-gnu:expat))) (define-public egl-wayland2 (package (inherit egl-wayland) (name "egl-wayland2") (version "1.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/egl-wayland2") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "15n6jf8kxkha0bxhjj9x720i88nqar8k6wkirav2izbi52vgxnji")))) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'install 'patch-library-reference (lambda* (#:key outputs #:allow-other-keys) (let ((dir "share/egl/egl_external_platform.d")) (with-directory-excursion (in-vicinity #$output dir) (substitute* "09_nvidia_wayland2.json" (("libnvidia-egl-.*\\.so\\.." lib) (search-input-file outputs (in-vicinity "lib" lib))))))))))) (synopsis "Dma-buf-based Wayland external platform library") (description "This is a new implementation of the EGL External Platform Library for Wayland (@code{EGL_KHR_platform_wayland}), using the NVIDIA driver's new platform surface interface, which simplifies a lot of the library and improves window resizing.") (home-page "https://github.com/NVIDIA/egl-wayland2") (license license-gnu:asl2.0))) (define-public egl-x11 (package (name "egl-x11") (version "1.0.5") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/NVIDIA/egl-x11") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "07d72z4dm2w9ys01li2v770j51zciahn0m5yn4bxrns7gxrylpsa")))) (build-system meson-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'install 'patch-library-reference (lambda* (#:key outputs #:allow-other-keys) (let ((dir "share/egl/egl_external_platform.d")) (with-directory-excursion (in-vicinity #$output dir) (substitute* '("20_nvidia_xcb.json" "20_nvidia_xlib.json") (("libnvidia-egl-.*\\.so\\.." lib) (search-input-file outputs (in-vicinity "lib" lib))))))))))) (native-inputs (list pkg-config)) (inputs (list eglexternalplatform mesa-for-nvda)) (synopsis "X11 and XCB EGL external platform library") (description "This package provides an EGL platform library for the NVIDIA driver to support XWayland via xlib (using @code{EGL_KHR_platform_x11}) or xcb (using @code{EGL_EXT_platform_xcb}).") (home-page "https://github.com/NVIDIA/egl-x11") (license license-gnu:expat))) (define-public nvidia-prime (package (name "nvidia-prime") (version "1.0-5") (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.archlinux.org/archlinux/packaging/packages/nvidia-prime.git") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "017xjk4lp25ib6jn3lpf80x7bfybj6lfam7xd1byyjj5rd60jp7f")))) (build-system gnu-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (delete 'configure) (delete 'build) (delete 'check) (replace 'install (lambda _ (chmod "prime-run" #o555) (install-file "prime-run" (in-vicinity #$output "bin"))))))) (inputs (list bash-minimal)) (home-page "https://www.archlinux.org/packages/extra/any/nvidia-prime/") (synopsis "NVIDIA PRIME render offload configuration and utilities") (description "This package provides @command{prime-run} to run a program on the NVIDIA GPU in switchable graphics setup.") (license license-gnu:gpl3+))) (define-public gpustat (package (name "gpustat") (version "1.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/wookayin/gpustat") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0d1ln9wrb4ij0yl3fz03vyby598y5hwlxbvcjw33pnndg8hvwi2v")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'set-version (lambda _ (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$(package-version this-package))))))) (propagated-inputs (list python-blessed python-nvidia-ml-py python-psutil)) (native-inputs (list python-mockito python-pytest python-setuptools python-setuptools-scm)) (home-page "https://github.com/wookayin/gpustat") (synopsis "Utility to monitor NVIDIA GPU status and usage") (description "This package provides an utility to monitor NVIDIA GPU status and usage.") (license license-gnu:expat))) (define-public nvidia-exec (package (name "nvidia-exec") (version "0.1.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/pedro00dk/nvidia-exec") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "079alqgz3drv5mvx059fzhj3f20rnljl7r4yihfd5qq7djgmvv0v")))) (build-system copy-build-system) (arguments (list #:install-plan #~`(("nvx" "bin/")) #:modules #~((guix build copy-build-system) (guix build utils) (srfi srfi-1)) #:phases #~(modify-phases %standard-phases (add-after 'install 'wrap-nvx (lambda* (#:key inputs outputs #:allow-other-keys) (wrap-program (string-append #$output "/bin/nvx") `("PATH" ":" prefix ,(fold (lambda (input paths) (let* ((in (assoc-ref inputs input)) (bin (string-append in "/bin"))) (append (filter file-exists? (list bin)) paths))) '() '("jq" "lshw" "lsof"))))))))) (inputs (list bash-minimal jq lshw lsof)) (home-page "https://github.com/pedro00dk/nvidia-exec") (synopsis "GPU switching without login out for Nvidia Optimus laptops") (description "This package provides GPU switching without login out for Nvidia Optimus laptops.") (license license-gnu:gpl3+))) (define-public nvidia-htop (package (name "nvidia-htop") (version "1.2.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/peci1/nvidia-htop") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1d5cd4cp7swq5np8b9ryibhg2zpfwzh2dzbsvsrp0gx33krxjvyj")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (replace 'check (lambda args (with-directory-excursion "test" (apply (assoc-ref %standard-phases 'check) args)))) (add-after 'unpack 'fix-libnvidia (lambda* (#:key inputs #:allow-other-keys) (substitute* "nvidia-htop.py" (("nvidia-smi" file) (search-input-file inputs (in-vicinity "bin" file))))))))) (native-inputs (list python-pytest python-setuptools)) (inputs (list nvidia-driver)) (propagated-inputs (list python-termcolor)) (home-page "https://github.com/peci1/nvidia-htop") (synopsis "Enriched nvidia-smi output") (description "This package provides a tool for enriching the output of @command{nvidia-smi}.") (license license-gnu:bsd-3))) (define-public nvidia-nvml (package (name "nvidia-nvml") (version "352.79") (source (origin (method url-fetch) (uri (string-append "https://developer.download.nvidia.com/compute/cuda/7.5/Prod/gdk/" (format #f "gdk_linux_amd64_~a_release.run" (string-replace-substring version "." "_")))) (sha256 (base32 "1r2cwm0j9svaasky3qw46cpg2q6rrazwzrc880nxh6bismyd3a9z")) (file-name (string-append "nvidia-nvml-" version "-checkout")))) (build-system copy-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (replace 'unpack (lambda* (#:key source #:allow-other-keys) (invoke "sh" source "--tar" "xvf")))) #:install-plan ''(("payload/nvml/lib" "lib") ("payload/nvml/include" "include/nvidia/gdk") ("payload/nvml/example" "src/gdk/nvml/examples") ("payload/nvml/doc/man" "share/man") ("payload/nvml/README.txt" "README.txt") ("payload/nvml/COPYRIGHT.txt" "COPYRIGHT.txt")))) (home-page "https://www.nvidia.com") (synopsis "The NVIDIA Management Library (NVML)") (description "C-based programmatic interface for monitoring and managing various states within NVIDIA Tesla GPUs. It is intended to be a platform for building 3rd party applications, and is also the underlying library for the NVIDIA-supported nvidia-smi tool. NVML is thread-safe so it is safe to make simultaneous NVML calls from multiple threads.") ;; Doesn't have any specific LICENSE file, but see COPYRIGHT.txt for details. (license (license:nonfree "file://COPYRIGHT.txt")))) (define-public nvidia-system-monitor (package (name "nvidia-system-monitor") (version "1.5") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/congard/nvidia-system-monitor-qt") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0aghdqljvjmc02g9jpc7sb3yhha738ywny51riska56hkxd3jg2l")))) (build-system cmake-build-system) (arguments (list #:tests? #f #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-nvidia-smi (lambda _ (let ((nvidia-smi (string-append #$(this-package-input "nvidia-driver") "/bin/nvidia-smi"))) (substitute* "src/core/InfoProvider.cpp" (("nvidia-smi") nvidia-smi)) (substitute* "src/main.cpp" (("which nvidia-smi") (string-append "which " nvidia-smi)) (("exec..nvidia-smi") (string-append "exec(\"" nvidia-smi)))))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((bin (string-append #$output "/bin"))) (mkdir-p bin) (install-file "qnvsm" bin))))))) (inputs (list qtbase-5 qtdeclarative-5 nvidia-driver)) (home-page "https://github.com/congard/nvidia-system-monitor-qt") (synopsis "Task manager for Nvidia graphics cards") (description "This package provides a task manager for Nvidia graphics cards.") (license license-gnu:expat))) (define-public python-nvidia-ml-py (package (name "python-nvidia-ml-py") (version "11.495.46") (source (origin (method url-fetch) (uri (pypi-uri "nvidia-ml-py" version)) (sha256 (base32 "09cnb7xasd7brby52j70y7fqsfm9n6gvgqf769v0cmj74ypy2s4g")))) (build-system pyproject-build-system) (arguments (list #:tests? #f ;No tests in PyPi archive. #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-libnvidia (lambda* (#:key inputs #:allow-other-keys) (substitute* "pynvml.py" (("libnvidia-ml.so.1" file) (search-input-file inputs (in-vicinity "lib" file))))))))) (native-inputs (list python-setuptools)) (inputs (list nvidia-driver)) (home-page "https://forums.developer.nvidia.com") (synopsis "Python bindings to NVIDIA Management Library") (description "This package is a wrapper around @acronym{NVML, NVIDIA Management Library}. It provides a Python interface to GPU management and monitoring functions.") (license license-gnu:bsd-3))) (define-public python-py3nvml (package (name "python-py3nvml") (version "0.2.7") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/fbcotter/py3nvml") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "012j13jg8qbl5lvr4gww0jvl9i8yk42za4fxvdg2h1sy866yk49m")))) (build-system pyproject-build-system) (arguments (list #:test-flags ;; These tests require the NVIDIA driver to be loaded. #~(list "-k" (string-join (list "not test_readme1" "test_grabgpus2" "test_grabgpus3") " and not ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-libnvidia (lambda* (#:key inputs #:allow-other-keys) (substitute* "py3nvml/py3nvml.py" (("libnvidia-ml.so.1" file) (search-input-file inputs (in-vicinity "lib" file))))))))) (native-inputs (list python-numpy python-pytest python-setuptools)) (propagated-inputs (list nvidia-driver python-xmltodict)) (home-page "https://github.com/fbcotter/py3nvml") (synopsis "Python bindings to NVIDIA Management Library") (description "This package provides unofficial Python bindings to @acronym{NVML, NVIDIA Management Library}. See @code{python-nvidia-ml-py} package for the official bindings provided by NVIDIA.") (license license-gnu:bsd-3)))