nongnu: nvidia-module-open: Use nvidia-module as base.

* nongnu/packages/nvidia.scm (nvidia-module-open): Use nvidia-module as base.

Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
This commit is contained in:
Hilton Chain 2022-10-01 11:24:11 +08:00 committed by Jonathan Brielmaier
parent 8a4fef778c
commit 618c7e26eb
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -416,48 +416,24 @@ simultaneous NVML calls from multiple threads.")
(format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version)))))
(define-public nvidia-module-open (define-public nvidia-module-open
(package (let ((base nvidia-module))
(package/inherit base
(name "nvidia-module-open") (name "nvidia-module-open")
(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
"1mkibm0i943ljcy921i63jzc0db6r4pm1ycmwbka9kddcviyb3gk"))))
(build-system linux-module-build-system)
(arguments (arguments
(list #:linux linux (substitute-keyword-arguments (package-arguments base)
#:source-directory "kernel-open" ;; NOTE: Kernels compiled with CONFIG_LTO_CLANG_THIN would cause an
#:tests? #f ;; error here. See also:
#:make-flags ;; <https://github.com/NVIDIA/open-gpu-kernel-modules/issues/214>
#~(list (string-append "CC=" #$(cc-for-target)) ;; <https://github.com/llvm/llvm-project/issues/55820>
(string-append "SYSSRC=" (assoc-ref %build-inputs ((#:source-directory _) "kernel-open")))
"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") (home-page "https://github.com/NVIDIA/open-gpu-kernel-modules")
(synopsis "Nvidia kernel module") (synopsis "NVIDIA kernel module")
(description (description
"This package provides Nvidia open-gpu-kernel-modules. However, "This package provides NVIDIA open-gpu-kernel-modules. However, they
they are only for the latest GPU architectures Turing and Ampere. Also they are only for the latest GPU architectures Turing and Ampere. Also they still
still require firmware file @code{gsp.bin} to be loaded as well as closed require firmware file @code{gsp.bin} to be loaded as well as closed source
source userspace tools from the corresponding driver release.") userspace tools from the corresponding driver release.")
(license license-gnu:gpl2))) (license license-gnu:gpl2))))
(define-public nvidia-settings (define-public nvidia-settings
(package (package