From 056c01b10cae62f4fdd58600016d956a6316c61c Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Wed, 8 Jun 2022 05:42:24 +0200 Subject: nongnu: Add nvidia-module. * nongnu/packages/nvidia.scm (nvidia-module, nversion): New variables. Signed-off-by: Jonathan Brielmaier --- nongnu/packages/nvidia.scm | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/nongnu/packages/nvidia.scm b/nongnu/packages/nvidia.scm index 2dd2a73..2ddb92b 100644 --- a/nongnu/packages/nvidia.scm +++ b/nongnu/packages/nvidia.scm @@ -24,6 +24,7 @@ (define-module (nongnu packages nvidia) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix utils) #:use-module ((guix licenses) #:prefix license-gnu:) @@ -57,8 +58,12 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1)) +; Used for closed-source packages (define nvidia-version "470.86") +; Used for the open-source kernel module package +(define nversion "515.48.07") + (define-public nvidia-driver (package (name "nvidia-driver") @@ -406,6 +411,50 @@ packages that have been compiled with a mesa output, take a look at the nvda package.") (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) +(define-public nvidia-module + (package + (name "nvidia-module") + (version nversion) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/NVIDIA/open-gpu-kernel-modules") + (commit nversion))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1bpyq1dn14l7g32aalxy20zsxsay2yzibq8m8chy1byglrsjnqhh")))) + (build-system linux-module-build-system) + (arguments + (list #:linux linux + #:source-directory "kernel-open" + #:tests? #f + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + (string-append "SYSSRC=" (assoc-ref %build-inputs + "linux-module-builder") + "/lib/modules/build")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fixpath + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "kernel-open/Kbuild" + (("/bin/sh") (string-append #$bash-minimal "/bin/sh"))))) + (replace 'build + (lambda* (#:key make-flags outputs #:allow-other-keys) + (apply invoke + `("make" "-j" + ,@make-flags "modules"))))))) + (inputs (list bash-minimal)) + (home-page "https://github.com/NVIDIA/open-gpu-kernel-modules") + (synopsis "Nvidia kernel module") + (description + "This package provides Nvidia open-gpu-kernel-modules. However, +they are only for the latest GPU architectures Turing and Ampere. Also they +still require firmware file @code{gsp.bin} to be loaded as well as closed +source userspace tools from the corresponding driver release.") + (license license-gnu:gpl2))) + (define-public nvidia-settings (package (name "nvidia-settings") -- cgit v1.2.3