mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
Merge staging-next into staging
This commit is contained in:
@@ -63,6 +63,35 @@ using:
|
||||
Once the connection is established, you can enter commands in the socat terminal
|
||||
where socat is running.
|
||||
|
||||
## SSH Access for test machines {#sec-nixos-test-ssh-access}
|
||||
|
||||
An SSH-based backdoor to log into machines can be enabled with
|
||||
|
||||
```nix
|
||||
{
|
||||
name = "…";
|
||||
nodes.machines = { /* … */ };
|
||||
sshBackdoor.enable = true;
|
||||
}
|
||||
```
|
||||
|
||||
This creates a [vsock socket](https://man7.org/linux/man-pages/man7/vsock.7.html)
|
||||
for each VM to log in with SSH. This configures root login with an empty password.
|
||||
|
||||
When the VMs get started interactively with the test-driver, it's possible to
|
||||
connect to `machine` with
|
||||
|
||||
```
|
||||
$ ssh vsock/3 -o User=root
|
||||
```
|
||||
|
||||
The socket numbers correspond to the node number of the test VM, but start
|
||||
at three instead of one because that's the lowest possible
|
||||
vsock number.
|
||||
|
||||
On non-NixOS systems you'll probably need to enable
|
||||
the SSH config from {manpage}`systemd-ssh-proxy(1)` yourself.
|
||||
|
||||
## Port forwarding to NixOS test VMs {#sec-nixos-test-port-forwarding}
|
||||
|
||||
If your test has only a single VM, you may use e.g.
|
||||
|
||||
@@ -1823,6 +1823,9 @@
|
||||
"sec-test-options-reference": [
|
||||
"index.html#sec-test-options-reference"
|
||||
],
|
||||
"test-opt-sshBackdoor.enable": [
|
||||
"index.html#test-opt-sshBackdoor.enable"
|
||||
],
|
||||
"test-opt-defaults": [
|
||||
"index.html#test-opt-defaults"
|
||||
],
|
||||
@@ -1910,6 +1913,9 @@
|
||||
"sec-nixos-test-shell-access": [
|
||||
"index.html#sec-nixos-test-shell-access"
|
||||
],
|
||||
"sec-nixos-test-ssh-access": [
|
||||
"index.html#sec-nixos-test-ssh-access"
|
||||
],
|
||||
"sec-nixos-test-port-forwarding": [
|
||||
"index.html#sec-nixos-test-port-forwarding"
|
||||
],
|
||||
|
||||
@@ -109,6 +109,11 @@ def main() -> None:
|
||||
help="the test script to run",
|
||||
type=Path,
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--dump-vsocks",
|
||||
help="indicates that the interactive SSH backdoor is active and dumps information about it on start",
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
@@ -136,6 +141,8 @@ def main() -> None:
|
||||
if args.interactive:
|
||||
history_dir = os.getcwd()
|
||||
history_path = os.path.join(history_dir, ".nixos-test-history")
|
||||
if args.dump_vsocks:
|
||||
driver.dump_machine_ssh()
|
||||
ptpython.ipython.embed(
|
||||
user_ns=driver.test_symbols(),
|
||||
history_filename=history_path,
|
||||
|
||||
@@ -11,6 +11,8 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
from unittest import TestCase
|
||||
|
||||
from colorama import Style
|
||||
|
||||
from test_driver.errors import MachineError, RequestedAssertionFailed
|
||||
from test_driver.logger import AbstractLogger
|
||||
from test_driver.machine import Machine, NixStartScript, retry
|
||||
@@ -176,6 +178,19 @@ class Driver:
|
||||
)
|
||||
return {**general_symbols, **machine_symbols, **vlan_symbols}
|
||||
|
||||
def dump_machine_ssh(self) -> None:
|
||||
print("SSH backdoor enabled, the machines can be accessed like this:")
|
||||
print(
|
||||
f"{Style.BRIGHT}Note:{Style.RESET_ALL} this requires {Style.BRIGHT}systemd-ssh-proxy(1){Style.RESET_ALL} to be enabled (default on NixOS 25.05 and newer)."
|
||||
)
|
||||
names = [machine.name for machine in self.machines]
|
||||
longest_name = len(max(names, key=len))
|
||||
for num, name in enumerate(names, start=3):
|
||||
spaces = " " * (longest_name - len(name) + 2)
|
||||
print(
|
||||
f" {name}:{spaces}{Style.BRIGHT}ssh -o User=root vsock/{num}{Style.RESET_ALL}"
|
||||
)
|
||||
|
||||
def test_script(self) -> None:
|
||||
"""Run the test script"""
|
||||
with self.logger.nested("run the VM test script"):
|
||||
|
||||
@@ -75,6 +75,7 @@ pkgs.lib.throwIf (args ? specialArgs)
|
||||
),
|
||||
extraPythonPackages ? (_: [ ]),
|
||||
interactive ? { },
|
||||
sshBackdoor ? { },
|
||||
}@t:
|
||||
let
|
||||
testConfig =
|
||||
|
||||
@@ -13,6 +13,7 @@ let
|
||||
mapAttrs
|
||||
mkDefault
|
||||
mkIf
|
||||
mkMerge
|
||||
mkOption
|
||||
mkForce
|
||||
optional
|
||||
@@ -77,6 +78,14 @@ in
|
||||
{
|
||||
|
||||
options = {
|
||||
sshBackdoor = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "Whether to turn on the VSOCK-based access to all VMs. This provides an unauthenticated access intended for debugging.";
|
||||
};
|
||||
};
|
||||
|
||||
node.type = mkOption {
|
||||
type = types.raw;
|
||||
default = baseOS.type;
|
||||
@@ -172,10 +181,19 @@ in
|
||||
|
||||
passthru.nodes = config.nodesCompat;
|
||||
|
||||
defaults = mkIf config.node.pkgsReadOnly {
|
||||
nixpkgs.pkgs = config.node.pkgs;
|
||||
imports = [ ../../modules/misc/nixpkgs/read-only.nix ];
|
||||
};
|
||||
extraDriverArgs = mkIf config.sshBackdoor.enable [
|
||||
"--dump-vsocks"
|
||||
];
|
||||
|
||||
defaults = mkMerge [
|
||||
(mkIf config.node.pkgsReadOnly {
|
||||
nixpkgs.pkgs = config.node.pkgs;
|
||||
imports = [ ../../modules/misc/nixpkgs/read-only.nix ];
|
||||
})
|
||||
(mkIf config.sshBackdoor.enable {
|
||||
testing.sshBackdoor.enable = true;
|
||||
})
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ let
|
||||
defaults = {
|
||||
# without UseDefaultInterface, sometimes wlan0 simply goes AWOL with NetworkManager
|
||||
# https://iwd.wiki.kernel.org/interface_lifecycle#interface_management_in_iwd
|
||||
General.UseDefaultInterface =
|
||||
DriverQuirks.UseDefaultInterface =
|
||||
with config.networking.networkmanager;
|
||||
(enable && (wifi.backend == "iwd"));
|
||||
};
|
||||
@@ -61,6 +61,12 @@ in
|
||||
Only one wireless daemon is allowed at the time: networking.wireless.enable and networking.wireless.iwd.enable are mutually exclusive.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = !(cfg.settings ? General && cfg.settings.General ? UseDefaultInterface);
|
||||
message = ''
|
||||
`networking.wireless.iwd.settings.General.UseDefaultInterface` has been deprecated. Use `networking.wireless.iwd.settings.DriverQuirks.UseDefaultInterface` instead.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
environment.etc."iwd/${configFile.name}".source = configFile;
|
||||
|
||||
@@ -75,6 +75,7 @@ in
|
||||
|
||||
"usbtouchscreen"
|
||||
"evdev"
|
||||
"psmouse"
|
||||
]
|
||||
++ lib.optionals cfg.allowVendorDrivers [
|
||||
"intel_lpss_pci"
|
||||
|
||||
@@ -87,6 +87,10 @@ in
|
||||
machine.switch_root() to leave stage 1 and proceed to stage 2
|
||||
'';
|
||||
|
||||
sshBackdoor = {
|
||||
enable = mkEnableOption "vsock-based ssh backdoor for the VM";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
@@ -100,6 +104,18 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
services.openssh = mkIf config.testing.sshBackdoor.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "yes";
|
||||
PermitEmptyPasswords = "yes";
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services.sshd = mkIf config.testing.sshBackdoor.enable {
|
||||
allowNullPassword = true;
|
||||
};
|
||||
|
||||
systemd.services.backdoor = lib.mkMerge [
|
||||
backdoorService
|
||||
{
|
||||
@@ -175,6 +191,10 @@ in
|
||||
# we avoid defining attributes if not possible.
|
||||
# TODO: refactor such that test-instrumentation can import qemu-vm
|
||||
package = lib.mkDefault pkgs.qemu_test;
|
||||
|
||||
options = mkIf config.testing.sshBackdoor.enable [
|
||||
"-device vhost-vsock-pci,guest-cid=${toString (config.virtualisation.test.nodeNumber + 2)}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ stdenvNoCC.mkDerivation (
|
||||
|
||||
# If set, prefer the content-addressable mirrors
|
||||
# (http://tarballs.nixos.org) over the original URLs.
|
||||
preferHashedMirrors = true;
|
||||
preferHashedMirrors = false;
|
||||
|
||||
# New-style output content requirements.
|
||||
inherit (hash_) outputHashAlgo outputHash;
|
||||
|
||||
4
pkgs/by-name/_1/_1password-gui-beta/package.nix
Normal file
4
pkgs/by-name/_1/_1password-gui-beta/package.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ _1password-gui }:
|
||||
_1password-gui.override {
|
||||
channel = "beta";
|
||||
}
|
||||
@@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
bzip2
|
||||
lz4
|
||||
c-blosc2
|
||||
hdf5-mpi
|
||||
(hdf5-mpi.override { inherit mpi; })
|
||||
libfabric
|
||||
libpng
|
||||
libsodium
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
diff --git a/build.py b/build.py
|
||||
index 48bc757d..88b9ed9b 100644
|
||||
--- a/build.py
|
||||
+++ b/build.py
|
||||
@@ -1,6 +1,5 @@
|
||||
from scripts import configs
|
||||
from scripts.configs import path_define
|
||||
-from scripts.services import publish_service, info_service, template_service, image_service
|
||||
from scripts.services.font_service import DesignContext, FontContext
|
||||
from scripts.utils import fs_util
|
||||
|
||||
@@ -21,21 +20,6 @@ def main():
|
||||
font_context.make_pcf()
|
||||
font_context.make_otc()
|
||||
font_context.make_ttc()
|
||||
- publish_service.make_release_zips(font_config, width_mode)
|
||||
- info_service.make_info_file(design_context, width_mode)
|
||||
- info_service.make_alphabet_txt_file(design_context, width_mode)
|
||||
- template_service.make_alphabet_html_file(design_context, width_mode)
|
||||
- template_service.make_demo_html_file(design_context)
|
||||
- image_service.make_preview_image_file(font_config)
|
||||
- template_service.make_index_html_file()
|
||||
- template_service.make_playground_html_file()
|
||||
- image_service.make_readme_banner()
|
||||
- image_service.make_github_banner()
|
||||
- image_service.make_itch_io_banner()
|
||||
- image_service.make_itch_io_background()
|
||||
- image_service.make_itch_io_cover()
|
||||
- image_service.make_afdian_cover()
|
||||
-
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -3,52 +3,37 @@
|
||||
python312Packages,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
fetchPypi,
|
||||
}:
|
||||
|
||||
let
|
||||
pixel-font-builder-compat = python312Packages.pixel-font-builder.overrideAttrs rec {
|
||||
version = "0.0.26";
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "pixel_font_builder";
|
||||
hash = "sha256-bgs2FbOA5tcUXe5+KuVztWGAv5yFxQNBaiZMeZ+ic+8=";
|
||||
};
|
||||
};
|
||||
in
|
||||
python312Packages.buildPythonPackage rec {
|
||||
pname = "ark-pixel-font";
|
||||
version = "2024.05.12";
|
||||
version = "2025.03.14";
|
||||
pyproject = false;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "TakWolf";
|
||||
repo = "ark-pixel-font";
|
||||
tag = version;
|
||||
hash = "sha256-PGhhKWHDpvOqa3vaI40wuIsAEdWGb62cN7QJeHQqiss=";
|
||||
hash = "sha256-B/XsZEpSxY4k8uj3Vy31c9+GcO7d3NFcADLtPU6p/CI=";
|
||||
};
|
||||
|
||||
format = "other";
|
||||
|
||||
nativeBuildInputs = with python312Packages; [
|
||||
pixel-font-builder-compat
|
||||
dependencies = with python312Packages; [
|
||||
pixel-font-builder
|
||||
pixel-font-knife
|
||||
unidata-blocks
|
||||
character-encoding-utils
|
||||
pypng
|
||||
pyyaml
|
||||
pillow
|
||||
beautifulsoup4
|
||||
jinja2
|
||||
gitpython
|
||||
loguru
|
||||
cyclopts
|
||||
];
|
||||
|
||||
# By default build.py builds a LOT of extraneous artifacts we don't need.
|
||||
patches = [ ./limit-builds.patch ];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# Too much debug output would break Hydra, so this jankness has to be here for it to build at all.
|
||||
# I wish there's a builtin way to set the log level without modifying the script itself...
|
||||
python3 build.py 2>&1 >/dev/null | grep -E '^(INFO|WARN|ERROR)'
|
||||
python -m tools.cli --cleanup
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
@@ -121,8 +121,6 @@ python.pkgs.buildPythonApplication rec {
|
||||
"test_get_keys_dir"
|
||||
"test_get_security_dir"
|
||||
"test_get_config_dir"
|
||||
# https://github.com/borgbackup/borg/issues/6573
|
||||
"test_basic_functionality"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
|
||||
@@ -11,27 +11,32 @@
|
||||
pkg-config,
|
||||
scdoc,
|
||||
stdenv,
|
||||
unstableGitUpdater,
|
||||
gitUpdater,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "buffybox";
|
||||
version = "3.2.0-unstable-2025-03-16";
|
||||
version = "3.3.0";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
domain = "gitlab.postmarketos.org";
|
||||
owner = "postmarketOS";
|
||||
repo = "buffybox";
|
||||
fetchSubmodules = true; # to use its vendored lvgl
|
||||
rev = "56a9867e90ece88596e330774da64cf277069b59";
|
||||
hash = "sha256-4lSgswcvvV6W1KN6QhsjeHY8MMXXC4fRYBmPE/hb0vA=";
|
||||
rev = "dce41a6f07a2b63c3136409b7bcd0078299fadf9";
|
||||
hash = "sha256-n5RQg7kGS+lg7sRe5Defl3nDEha0vhc/FbwywD5wBsg=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch2 {
|
||||
# https://gitlab.postmarketos.org/postmarketOS/buffybox/-/merge_requests/42
|
||||
url = "https://gitlab.postmarketos.org/postmarketOS/buffybox/-/commit/1f0c30e88dc61b8b508696cd890393c3b7911b58.patch?full_index=1";
|
||||
hash = "sha256-hQ6Hjfyj059j2cRfrFz9Se6xRowIGW1HVHULLYtHcS8=";
|
||||
# This fixes a bug that might annoy you if you use something like PKCS#11
|
||||
url = "https://gitlab.postmarketos.org/postmarketOS/buffybox/-/commit/d8214b522a3cc72cd4639a1dd114103a02e9218c.patch";
|
||||
hash = "sha256-WxKuioJ1Fo5ARRYF/R4yULDVB4pq11phljzVGdWTV6s=";
|
||||
})
|
||||
(fetchpatch2 {
|
||||
# Fixes up UB
|
||||
url = "https://gitlab.postmarketos.org/postmarketOS/buffybox/-/commit/4e13c312241420cbb3e5cc7d4f0dd3e5d17449be.patch";
|
||||
hash = "sha256-7yX6gGsptwijx+ZedSJWJKhwaoBVpxIbGK+ZiMLsIhc=";
|
||||
})
|
||||
];
|
||||
|
||||
@@ -57,7 +62,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
passthru.updateScript = unstableGitUpdater { };
|
||||
passthru.updateScript = gitUpdater { };
|
||||
|
||||
meta = with lib; {
|
||||
description = "A suite of graphical applications for the terminal";
|
||||
|
||||
114
pkgs/by-name/do/dolfinx/package.nix
Normal file
114
pkgs/by-name/do/dolfinx/package.nix
Normal file
@@ -0,0 +1,114 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
spdlog,
|
||||
pugixml,
|
||||
boost,
|
||||
petsc,
|
||||
slepc,
|
||||
kahip,
|
||||
adios2,
|
||||
python3Packages,
|
||||
catch2_3,
|
||||
withParmetis ? false,
|
||||
}:
|
||||
let
|
||||
dolfinxPackages = petsc.petscPackages.overrideScope (
|
||||
final: prev: {
|
||||
slepc = final.callPackage slepc.override { };
|
||||
adios2 = final.callPackage adios2.override { };
|
||||
kahip = final.callPackage kahip.override { };
|
||||
}
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
version = "0.9.0.post1";
|
||||
pname = "dolfinx";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fenics";
|
||||
repo = "dolfinx";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-4IIx7vUZeDwOGVdyC2PBvfhVjrmGZeVQKAwgDYScbY0=";
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
cd cpp
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dolfinxPackages.kahip
|
||||
dolfinxPackages.scotch
|
||||
] ++ lib.optional withParmetis dolfinxPackages.parmetis;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
spdlog
|
||||
pugixml
|
||||
boost
|
||||
petsc
|
||||
dolfinxPackages.hdf5
|
||||
dolfinxPackages.slepc
|
||||
dolfinxPackages.adios2
|
||||
python3Packages.fenics-basix
|
||||
python3Packages.fenics-ffcx
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "DOLFINX_ENABLE_ADIOS2" true)
|
||||
(lib.cmakeBool "DOLFINX_ENABLE_PETSC" true)
|
||||
(lib.cmakeBool "DOLFIN_ENABLE_PARMETIS" withParmetis)
|
||||
(lib.cmakeBool "DOLFINX_ENABLE_SCOTCH" true)
|
||||
(lib.cmakeBool "DOLFINX_ENABLE_SLEPC" true)
|
||||
(lib.cmakeBool "DOLFINX_ENABLE_KAHIP" true)
|
||||
(lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin")
|
||||
(lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
|
||||
(lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include")
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
unittests = stdenv.mkDerivation {
|
||||
pname = "${finalAttrs.pname}-unittests";
|
||||
inherit (finalAttrs) version src;
|
||||
|
||||
preConfigure = ''
|
||||
cd cpp/test
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [ finalAttrs.finalPackage ];
|
||||
|
||||
nativeCheckInputs = [ catch2_3 ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://fenicsproject.org";
|
||||
downloadPage = "https://github.com/fenics/dolfinx";
|
||||
description = "Computational environment of FEniCSx and implements the FEniCS Problem Solving Environment in C++ and Python";
|
||||
changelog = "https://github.com/fenics/dolfinx/releases/tag/${finalAttrs.src.tag}";
|
||||
license = with lib.licenses; [
|
||||
bsd2
|
||||
lgpl3Plus
|
||||
];
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ qbisi ];
|
||||
};
|
||||
})
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
gcc14Stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprlang";
|
||||
version = "0.6.1";
|
||||
version = "0.6.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprlang";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-9HySx+EtsbbKlZDlY+naqqOV679VdxP6x6fP3wxDXJk=";
|
||||
hash = "sha256-kVQ0bHVtX6baYxRWWIh4u3LNJZb9Zcm2xBeDPOGz5BY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprutils";
|
||||
version = "0.7.0";
|
||||
version = "0.7.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hyprwm";
|
||||
repo = "hyprutils";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-s3GzsRxBL/N/xYgUXZhQh4t62uR1BN4zxXgWBtJ3lWM=";
|
||||
hash = "sha256-W9G9bb0zRYDBRseHbVez0J8qVpD5QbizX67H/vsudhM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "jawiki-all-titles-in-ns0";
|
||||
version = "0-unstable-2025-04-01";
|
||||
version = "0-unstable-2025-05-01";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "musjj";
|
||||
repo = "jawiki-archive";
|
||||
rev = "7c9ce3d1e3000a56222011566a9d8cb9b910416d";
|
||||
hash = "sha256-Yw/Iv7osjhL1kZwTOc2iiOJIf96GPcEDTCNO67gwbYU=";
|
||||
rev = "11011d2a5a27251a75a0ce822ed05fa9be7bf878";
|
||||
hash = "sha256-ZTCW14kHfewzCJuT6afGgSi3ZwC4cGiqecEma8Fj2mk=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "kubergrunt";
|
||||
version = "0.17.2";
|
||||
version = "0.17.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gruntwork-io";
|
||||
repo = "kubergrunt";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-ros126t4QEhWnItScaY1ntcGI/YMpeC2f2yQrzSZ7w4=";
|
||||
sha256 = "sha256-9ZF2O4/5n5uL+FA50Rfiq9gStQwNDWIhtz2GvJVu+u4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-6dFIW2wwu6HHvoMo0+MhvKOtAJNVhg7JyVlBPqLQerw=";
|
||||
|
||||
@@ -18,14 +18,14 @@ let
|
||||
in
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "matrix-synapse";
|
||||
version = "1.128.0";
|
||||
version = "1.129.0";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "element-hq";
|
||||
repo = "synapse";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-QgVx/9mZ3Do+42YwO8OtI2dcuckMX/xIaiBUi4HrK4Q=";
|
||||
hash = "sha256-JDaTFbRb2eNtzxZBLn8wOBEN5uJcInNrhFnGFZjI8is=";
|
||||
};
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
|
||||
@@ -78,6 +78,8 @@ let
|
||||
petscPackages = lib.makeScope newScope (self: {
|
||||
inherit
|
||||
mpi
|
||||
python3
|
||||
python3Packages
|
||||
# global override options
|
||||
mpiSupport
|
||||
fortranSupport
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tile38";
|
||||
version = "1.34.3";
|
||||
version = "1.34.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tidwall";
|
||||
repo = "tile38";
|
||||
tag = version;
|
||||
hash = "sha256-0kBSMoHo6RD6NIP4fGXe3K5B+FLEN5BuphViwa6KLSg=";
|
||||
hash = "sha256-TLVFFgT5lxOLhv1RBS09DCcZAozkcHzIBlJSWt1ztB4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-SJ80FSoG8RhsReDmSX120bxzcgZ3cD3vNvWt/HiV3/w=";
|
||||
vendorHash = "sha256-geXYLeJf/u+8RD7Slr2x+J6zABkWSIfhxKLxZVF/icU=";
|
||||
|
||||
subPackages = [
|
||||
"cmd/tile38-cli"
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wit-bindgen";
|
||||
version = "0.41.0";
|
||||
version = "0.42.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bytecodealliance";
|
||||
repo = "wit-bindgen";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ePrtWOCta9UtoEtSJ1NZb6iJricfsc2YtRF8hi///3c=";
|
||||
hash = "sha256-zj+O8Rp/KXvDYCew0k5veBUokR91CGEIan398/mPY8w=";
|
||||
};
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-vhhonclq6UGkygHoNIRkB4BIjMAdkSbu2qPXNb2y8pI=";
|
||||
cargoHash = "sha256-epvE6qSKVUudqHXPJG5mP2X7xlR5XSm3UWDzZK0gHyA=";
|
||||
|
||||
# Some tests fail because they need network access to install the `wasm32-unknown-unknown` target.
|
||||
# However, GitHub Actions ensures a proper build.
|
||||
|
||||
@@ -27,6 +27,12 @@ scope. These are typically required for the creation of the finalized
|
||||
to `cudaPackages` scope.
|
||||
- `cudnn`: NVIDIA cuDNN library.
|
||||
- `cutensor`: NVIDIA cuTENSOR library.
|
||||
- `fixups`: Each file or directory (excluding `default.nix`) should contain a
|
||||
`callPackage`-able expression to be provided to the `overrideAttrs` attribute
|
||||
of a package produced by the generic manifest builder.
|
||||
These fixups are applied by `pname`, so packages with multiple versions
|
||||
(e.g., `cudnn`, `cudnn_8_9`, etc.) all share a single fixup function
|
||||
(i.e., `fixups/cudnn.nix`).
|
||||
- `generic-builders`:
|
||||
- Contains a builder `manifest.nix` which operates on the `Manifest` type
|
||||
defined in `modules/generic/manifests`. Most packages are built using this
|
||||
|
||||
@@ -1,36 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
backendStdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
addDriverRunpath,
|
||||
autoAddDriverRunpath,
|
||||
cudatoolkit,
|
||||
cutensor,
|
||||
cusparselt,
|
||||
cudaPackages,
|
||||
setupCudaHook,
|
||||
autoPatchelfHook,
|
||||
backendStdenv,
|
||||
cmake,
|
||||
cuda_cccl ? null,
|
||||
cuda_cudart ? null,
|
||||
cuda_nvcc ? null,
|
||||
cudaAtLeast,
|
||||
cudaOlder,
|
||||
cudatoolkit,
|
||||
cusparselt ? null,
|
||||
cutensor ? null,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
libcusparse ? null,
|
||||
setupCudaHook,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (cudaPackages)
|
||||
cuda_cccl
|
||||
cuda_cudart
|
||||
cuda_nvcc
|
||||
libcusparse
|
||||
cudaAtLeast
|
||||
cudaOlder
|
||||
;
|
||||
rev = "e57b9c483c5384b7b97b7d129457e5a9bdcdb5e1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "NVIDIA";
|
||||
repo = "CUDALibrarySamples";
|
||||
inherit rev;
|
||||
sha256 = "0g17afsmb8am0darxchqgjz1lmkaihmnn7k1x4ahg5gllcmw8k3l";
|
||||
};
|
||||
commonAttrs = {
|
||||
version = lib.strings.substring 0 7 rev + "-" + lib.versions.majorMinor cudatoolkit.version;
|
||||
base = backendStdenv.mkDerivation (finalAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "NVIDIA";
|
||||
repo = "CUDALibrarySamples";
|
||||
rev = "e57b9c483c5384b7b97b7d129457e5a9bdcdb5e1";
|
||||
sha256 = "0g17afsmb8am0darxchqgjz1lmkaihmnn7k1x4ahg5gllcmw8k3l";
|
||||
};
|
||||
version =
|
||||
lib.strings.substring 0 7 finalAttrs.src.rev + "-" + lib.versions.majorMinor cudatoolkit.version;
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
addDriverRunpath
|
||||
@@ -53,64 +50,63 @@ let
|
||||
maintainers = with lib.maintainers; [ obsidian-systems-maintenance ];
|
||||
teams = [ lib.teams.cuda ];
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
|
||||
{
|
||||
cublas = backendStdenv.mkDerivation (
|
||||
commonAttrs
|
||||
// {
|
||||
cublas = base.overrideAttrs (
|
||||
finalAttrs: _: {
|
||||
pname = "cuda-library-samples-cublas";
|
||||
|
||||
src = "${src}/cuBLASLt";
|
||||
sourceRoot = "${finalAttrs.src.name}/cuBLASLt";
|
||||
}
|
||||
);
|
||||
|
||||
cusolver = backendStdenv.mkDerivation (
|
||||
commonAttrs
|
||||
// {
|
||||
cusolver = base.overrideAttrs (
|
||||
finalAttrs: _: {
|
||||
pname = "cuda-library-samples-cusolver";
|
||||
|
||||
src = "${src}/cuSOLVER";
|
||||
|
||||
sourceRoot = "cuSOLVER/gesv";
|
||||
sourceRoot = "${finalAttrs.src.name}/cuSOLVER/gesv";
|
||||
}
|
||||
);
|
||||
|
||||
cutensor = backendStdenv.mkDerivation (
|
||||
commonAttrs
|
||||
// {
|
||||
cutensor = base.overrideAttrs (
|
||||
finalAttrs: prevAttrs: {
|
||||
pname = "cuda-library-samples-cutensor";
|
||||
|
||||
src = "${src}/cuTENSOR";
|
||||
sourceRoot = "${finalAttrs.src.name}/cuTENSOR";
|
||||
|
||||
buildInputs = [ cutensor ];
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [ cutensor ];
|
||||
|
||||
cmakeFlags = [ "-DCUTENSOR_EXAMPLE_BINARY_INSTALL_DIR=${builtins.placeholder "out"}/bin" ];
|
||||
cmakeFlags = prevAttrs.cmakeFlags or [ ] ++ [
|
||||
"-DCUTENSOR_EXAMPLE_BINARY_INSTALL_DIR=${builtins.placeholder "out"}/bin"
|
||||
];
|
||||
|
||||
# CUTENSOR_ROOT is double escaped
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "\''${CUTENSOR_ROOT}/include" "${cutensor.dev}/include"
|
||||
'';
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "\''${CUTENSOR_ROOT}/include" "${lib.getDev cutensor}/include"
|
||||
'';
|
||||
|
||||
CUTENSOR_ROOT = cutensor;
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
broken = cutensor == null;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
cusparselt = backendStdenv.mkDerivation (
|
||||
commonAttrs
|
||||
// {
|
||||
cusparselt = base.overrideAttrs (
|
||||
finalAttrs: prevAttrs: {
|
||||
pname = "cuda-library-samples-cusparselt";
|
||||
|
||||
src = "${src}/cuSPARSELt";
|
||||
sourceRoot = "${finalAttrs.src.name}/cuSPARSELt/matmul";
|
||||
|
||||
sourceRoot = "cuSPARSELt/matmul";
|
||||
|
||||
buildInputs = lib.optionals (cudaOlder "11.4") [ cudatoolkit ];
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ];
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
prevAttrs.nativeBuildInputs or [ ]
|
||||
++ [
|
||||
cmake
|
||||
addDriverRunpath
|
||||
(lib.getDev cusparselt)
|
||||
@@ -125,22 +121,34 @@ in
|
||||
cuda_cccl # <nv/target>
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt.so" "${lib.getLib cusparselt}/lib/libcusparseLt.so" \
|
||||
--replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt_static.a" "${lib.getStatic cusparselt}/lib/libcusparseLt_static.a"
|
||||
'';
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt.so" "${lib.getLib cusparselt}/lib/libcusparseLt.so" \
|
||||
--replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt_static.a" "${lib.getStatic cusparselt}/lib/libcusparseLt_static.a"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp matmul_example $out/bin/
|
||||
cp matmul_example_static $out/bin/
|
||||
runHook postInstall
|
||||
'';
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
+ ''
|
||||
mkdir -p $out/bin
|
||||
cp matmul_example $out/bin/
|
||||
cp matmul_example_static $out/bin/
|
||||
'';
|
||||
|
||||
CUDA_TOOLKIT_PATH = lib.getLib cudatoolkit;
|
||||
CUSPARSELT_PATH = lib.getLib cusparselt;
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
broken =
|
||||
# Base dependencies
|
||||
(cusparselt == null || libcusparse == null)
|
||||
# CUDA 11.4+ dependencies
|
||||
|| (cudaAtLeast "11.4" && (cuda_nvcc == null || cuda_cudart == null))
|
||||
# CUDA 12.0+ dependencies
|
||||
|| (cudaAtLeast "12.0" && cuda_cccl == null);
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -53,42 +53,13 @@ let
|
||||
# buildRedistPackage : callPackage -> PackageName -> Derivation
|
||||
buildRedistPackage =
|
||||
callPackage: pname:
|
||||
let
|
||||
callPackage ../generic-builders/manifest.nix {
|
||||
inherit pname redistName;
|
||||
# We pass the whole release to the builder because it has logic to handle
|
||||
# the case we're trying to build on an unsupported platform.
|
||||
redistribRelease = redistribManifest.${pname};
|
||||
featureRelease = featureManifest.${pname};
|
||||
drv =
|
||||
let
|
||||
# get `autoAddDriverRunpath` from pkgs instead of cudaPackages' alias to avoid warning
|
||||
inherit (callPackage ({ pkgs }: pkgs) { }) autoAddDriverRunpath;
|
||||
in
|
||||
(callPackage ../generic-builders/manifest.nix {
|
||||
# We pass the whole release to the builder because it has logic to handle
|
||||
# the case we're trying to build on an unsupported platform.
|
||||
inherit
|
||||
pname
|
||||
redistName
|
||||
redistribRelease
|
||||
featureRelease
|
||||
autoAddDriverRunpath
|
||||
;
|
||||
}).overrideAttrs
|
||||
(prevAttrs: {
|
||||
# Add the package-specific license.
|
||||
meta = prevAttrs.meta // {
|
||||
license =
|
||||
let
|
||||
licensePath =
|
||||
if redistribRelease.license_path != null then
|
||||
redistribRelease.license_path
|
||||
else
|
||||
"${pname}/LICENSE.txt";
|
||||
url = "https://developer.download.nvidia.com/compute/cuda/redist/${licensePath}";
|
||||
in
|
||||
lib.licenses.nvidiaCudaRedist // { inherit url; };
|
||||
};
|
||||
});
|
||||
in
|
||||
drv;
|
||||
};
|
||||
|
||||
# Build all the redist packages given final and prev.
|
||||
redistPackages =
|
||||
|
||||
@@ -1,490 +0,0 @@
|
||||
let
|
||||
filterAndCreateOverrides =
|
||||
createOverrideAttrs: final: prev:
|
||||
let
|
||||
# It is imperative that we use `final.callPackage` to perform overrides,
|
||||
# so the final package set is available to the override functions.
|
||||
inherit (final) callPackage;
|
||||
|
||||
# NOTE(@connorbaker): We MUST use `lib` from `prev` because the attribute
|
||||
# names CAN NOT depend on `final`.
|
||||
inherit (prev.lib.attrsets) filterAttrs mapAttrs;
|
||||
inherit (prev.lib.trivial) pipe;
|
||||
|
||||
# NOTE: Filter out attributes that are not present in the previous version of
|
||||
# the package set. This is necessary to prevent the appearance of attributes
|
||||
# like `cuda_nvcc` in `cudaPackages_10_0, which predates redistributables.
|
||||
filterOutNewAttrs = filterAttrs (name: _: prev ? ${name});
|
||||
|
||||
# Apply callPackage to each attribute value, yielding a value to be passed
|
||||
# to overrideAttrs.
|
||||
callPackageThenOverrideAttrs = mapAttrs (
|
||||
name: value: prev.${name}.overrideAttrs (callPackage value { })
|
||||
);
|
||||
in
|
||||
pipe createOverrideAttrs [
|
||||
filterOutNewAttrs
|
||||
callPackageThenOverrideAttrs
|
||||
];
|
||||
in
|
||||
# Each attribute name is the name of an existing package in the previous version
|
||||
# of the package set.
|
||||
# The value is a function (to be provided to callPackage), which yields a value
|
||||
# to be provided to overrideAttrs. This allows us to override the attributes of
|
||||
# a package without losing access to the fixed point of the package set --
|
||||
# especially useful given that some packages may depend on each other!
|
||||
filterAndCreateOverrides {
|
||||
libcufile =
|
||||
{
|
||||
cudaOlder,
|
||||
lib,
|
||||
libcublas,
|
||||
numactl,
|
||||
rdma-core,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
libcublas
|
||||
numactl
|
||||
rdma-core
|
||||
];
|
||||
# Before 11.7 libcufile depends on itself for some reason.
|
||||
autoPatchelfIgnoreMissingDeps =
|
||||
prevAttrs.autoPatchelfIgnoreMissingDeps
|
||||
++ lib.lists.optionals (cudaOlder "11.7") [ "libcufile.so.0" ];
|
||||
};
|
||||
|
||||
libcusolver =
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libcublas,
|
||||
libcusparse ? null,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
# Always depends on this
|
||||
++ [ libcublas ]
|
||||
# Dependency from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ libnvjitlink ]
|
||||
# Dependency from 12.1 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.1") [ libcusparse ];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" =
|
||||
!(cudaAtLeast "12.0" -> (libnvjitlink != null && libnvjitlink != null));
|
||||
"libcusparse missing (CUDA >= 12.1)" =
|
||||
!(cudaAtLeast "12.1" -> (libcusparse != null && libcusparse != null));
|
||||
};
|
||||
};
|
||||
|
||||
libcusparse =
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
# Dependency from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ libnvjitlink ];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" =
|
||||
!(cudaAtLeast "12.0" -> (libnvjitlink != null && libnvjitlink != null));
|
||||
};
|
||||
};
|
||||
|
||||
# TODO(@connorbaker): cuda_cudart.dev depends on crt/host_config.h, which is from
|
||||
# (getDev cuda_nvcc). It would be nice to be able to encode that.
|
||||
cuda_cudart =
|
||||
{ addDriverRunpath, lib }:
|
||||
prevAttrs: {
|
||||
# Remove once cuda-find-redist-features has a special case for libcuda
|
||||
outputs =
|
||||
prevAttrs.outputs
|
||||
++ lib.lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ];
|
||||
|
||||
allowFHSReferences = false;
|
||||
|
||||
# The libcuda stub's pkg-config doesn't follow the general pattern:
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
sed -i \
|
||||
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputLib}/lib/stubs|" \
|
||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||
"$path"
|
||||
done < <(find -iname 'cuda-*.pc' -print0)
|
||||
''
|
||||
# Namelink may not be enough, add a soname.
|
||||
# Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/25536
|
||||
+ ''
|
||||
if [[ -f lib/stubs/libcuda.so && ! -f lib/stubs/libcuda.so.1 ]]; then
|
||||
ln -s libcuda.so lib/stubs/libcuda.so.1
|
||||
fi
|
||||
'';
|
||||
|
||||
postFixup =
|
||||
prevAttrs.postFixup or ""
|
||||
+ ''
|
||||
moveToOutput lib/stubs "$stubs"
|
||||
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
|
||||
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
|
||||
'';
|
||||
};
|
||||
|
||||
cuda_compat =
|
||||
{ flags, lib }:
|
||||
prevAttrs: {
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||
"libnvrm_gpu.so"
|
||||
"libnvrm_mem.so"
|
||||
"libnvdla_runtime.so"
|
||||
];
|
||||
# `cuda_compat` only works on aarch64-linux, and only when building for Jetson devices.
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions // {
|
||||
"Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" = !flags.isJetsonBuild;
|
||||
};
|
||||
};
|
||||
|
||||
cuda_gdb =
|
||||
{
|
||||
cudaAtLeast,
|
||||
gmp,
|
||||
expat,
|
||||
libxcrypt-legacy,
|
||||
ncurses6,
|
||||
python310,
|
||||
python311,
|
||||
python312,
|
||||
stdenv,
|
||||
lib,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
# x86_64 only needs gmp from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ gmp ]
|
||||
# Additional dependencies for CUDA 12.5 and later, which
|
||||
# support multiple Python versions.
|
||||
++ lib.lists.optionals (cudaAtLeast "12.5") [
|
||||
libxcrypt-legacy
|
||||
ncurses6
|
||||
python310
|
||||
python311
|
||||
python312
|
||||
]
|
||||
# aarch64,sbsa needs expat
|
||||
++ lib.lists.optionals (stdenv.hostPlatform.isAarch64) [ expat ];
|
||||
|
||||
installPhase =
|
||||
prevAttrs.installPhase
|
||||
# Python 3.8 is not in nixpkgs anymore, delete Python 3.8 cuda-gdb support
|
||||
# to avoid autopatchelf failing to find libpython3.8.so.
|
||||
+ lib.optionalString (cudaAtLeast "12.5") ''
|
||||
find $bin -name '*python3.8*' -delete
|
||||
find $bin -name '*python3.9*' -delete
|
||||
'';
|
||||
};
|
||||
|
||||
cuda_nvcc =
|
||||
{
|
||||
lib,
|
||||
backendStdenv,
|
||||
cudaOlder,
|
||||
setupCudaHook,
|
||||
}:
|
||||
prevAttrs: {
|
||||
# Merge "bin" and "dev" into "out" to avoid circular references
|
||||
outputs = builtins.filter (
|
||||
x:
|
||||
!(builtins.elem x [
|
||||
"dev"
|
||||
"bin"
|
||||
])
|
||||
) prevAttrs.outputs;
|
||||
|
||||
# Patch the nvcc.profile.
|
||||
# Syntax:
|
||||
# - `=` for assignment,
|
||||
# - `?=` for conditional assignment,
|
||||
# - `+=` to "prepend",
|
||||
# - `=+` to "append".
|
||||
|
||||
# Cf. https://web.archive.org/web/20230308044351/https://arcb.csc.ncsu.edu/~mueller/cluster/nvidia/2.0/nvcc_2.0.pdf
|
||||
|
||||
# We set all variables with the lowest priority (=+), but we do force
|
||||
# nvcc to use the fixed backend toolchain. Cf. comments in
|
||||
# backend-stdenv.nix
|
||||
|
||||
postPatch =
|
||||
let
|
||||
nvvmReplace = lib.optionalString (cudaOlder "12.5") ''
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_NVVM_BRANCH_)' \
|
||||
"''${!outputBin}/nvvm" \
|
||||
'';
|
||||
in
|
||||
(prevAttrs.postPatch or "")
|
||||
+ ''
|
||||
substituteInPlace bin/nvcc.profile \
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_TARGET_DIR_)/include' \
|
||||
"''${!outputDev}/include" \
|
||||
${nvvmReplace}
|
||||
|
||||
cat << EOF >> bin/nvcc.profile
|
||||
|
||||
# Fix a compatible backend compiler
|
||||
PATH += "${backendStdenv.cc}/bin":
|
||||
|
||||
# Expose the split-out nvvm
|
||||
LIBRARIES =+ "-L''${!outputBin}/nvvm/lib"
|
||||
INCLUDES =+ "-I''${!outputBin}/nvvm/include"
|
||||
EOF
|
||||
'';
|
||||
|
||||
# NOTE(@connorbaker):
|
||||
# Though it might seem odd or counter-intuitive to add the setup hook to `propagatedBuildInputs` instead of
|
||||
# `propagatedNativeBuildInputs`, it is necessary! If you move the setup hook from `propagatedBuildInputs` to
|
||||
# `propagatedNativeBuildInputs`, it stops being propagated to downstream packages during their build because
|
||||
# setup hooks in `propagatedNativeBuildInputs` are not designed to affect the runtime or build environment of
|
||||
# dependencies; they are only meant to affect the build environment of the package that directly includes them.
|
||||
propagatedBuildInputs = (prevAttrs.propagatedBuildInputs or [ ]) ++ [ setupCudaHook ];
|
||||
|
||||
postInstall =
|
||||
(prevAttrs.postInstall or "")
|
||||
+ ''
|
||||
moveToOutput "nvvm" "''${!outputBin}"
|
||||
'';
|
||||
|
||||
# The nvcc and cicc binaries contain hard-coded references to /usr
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = (prevAttrs.meta or { }) // {
|
||||
mainProgram = "nvcc";
|
||||
};
|
||||
};
|
||||
|
||||
cuda_nvprof = { cuda_cupti }: prevAttrs: { buildInputs = prevAttrs.buildInputs ++ [ cuda_cupti ]; };
|
||||
|
||||
cuda_demo_suite =
|
||||
{
|
||||
libglut,
|
||||
libcufft,
|
||||
libcurand,
|
||||
libGLU,
|
||||
libglvnd,
|
||||
libgbm,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
libglut
|
||||
libcufft
|
||||
libcurand
|
||||
libGLU
|
||||
libglvnd
|
||||
libgbm
|
||||
];
|
||||
};
|
||||
|
||||
cuda_sanitizer_api = _: _: { outputs = [ "out" ]; };
|
||||
|
||||
fabricmanager = { zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs ++ [ zlib ]; };
|
||||
|
||||
imex = { zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs ++ [ zlib ]; };
|
||||
|
||||
nsight_compute =
|
||||
{
|
||||
lib,
|
||||
qt5 ? null,
|
||||
qt6 ? null,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
inherit (lib.strings) versionOlder versionAtLeast;
|
||||
inherit (prevAttrs) version;
|
||||
qt = if versionOlder version "2022.2.0" then qt5 else qt6;
|
||||
qtwayland =
|
||||
if lib.versions.major qt.qtbase.version == "5" then
|
||||
lib.getBin qt.qtwayland
|
||||
else
|
||||
lib.getLib qt.qtwayland;
|
||||
inherit (qt) wrapQtAppsHook qtwebview;
|
||||
archDir =
|
||||
{
|
||||
aarch64-linux = "linux-desktop-t210-a64";
|
||||
x86_64-linux = "linux-desktop-glibc_2_11_3-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
in
|
||||
{
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ wrapQtAppsHook ];
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
qtwayland
|
||||
qtwebview
|
||||
(qt.qtwebengine or qt.full)
|
||||
rdma-core
|
||||
];
|
||||
dontWrapQtApps = true;
|
||||
preInstall = ''
|
||||
rm -rf host/${archDir}/Mesa/
|
||||
'';
|
||||
postInstall = ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/${archDir}' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/${archDir}' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin"
|
||||
'';
|
||||
preFixup = ''
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so"
|
||||
'';
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"Qt 5 missing (<2022.2.0)" = !(versionOlder version "2022.2.0" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.2.0)" = !(versionAtLeast version "2022.2.0" -> qt6 != null);
|
||||
};
|
||||
};
|
||||
|
||||
nsight_systems =
|
||||
{
|
||||
boost178,
|
||||
cuda_cudart,
|
||||
cudaOlder,
|
||||
gst_all_1,
|
||||
lib,
|
||||
nss,
|
||||
numactl,
|
||||
pulseaudio,
|
||||
qt5 ? null,
|
||||
qt6 ? null,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
ucx,
|
||||
wayland,
|
||||
xorg,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
inherit (lib.strings) versionOlder versionAtLeast;
|
||||
inherit (prevAttrs) version;
|
||||
qt = if lib.strings.versionOlder prevAttrs.version "2022.4.2.1" then qt5 else qt6;
|
||||
qtwayland =
|
||||
if lib.versions.major qt.qtbase.version == "5" then
|
||||
lib.getBin qt.qtwayland
|
||||
else
|
||||
lib.getLib qt.qtwayland;
|
||||
qtWaylandPlugins = "${qtwayland}/${qt.qtbase.qtPluginPrefix}";
|
||||
hostDir =
|
||||
{
|
||||
aarch64-linux = "host-linux-armv8";
|
||||
x86_64-linux = "host-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
targetDir =
|
||||
{
|
||||
aarch64-linux = "target-linux-sbsa-armv8";
|
||||
x86_64-linux = "target-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
versionString = with lib.versions; "${majorMinor version}.${patch version}";
|
||||
in
|
||||
{
|
||||
# An ad hoc replacement for
|
||||
# https://github.com/ConnorBaker/cuda-redist-find-features/issues/11
|
||||
env.rmPatterns = toString [
|
||||
"nsight-systems/${versionString}/${hostDir}/lib{arrow,jpeg}*"
|
||||
"nsight-systems/${versionString}/${hostDir}/lib{ssl,ssh,crypto}*"
|
||||
"nsight-systems/${versionString}/${hostDir}/libboost*"
|
||||
"nsight-systems/${versionString}/${hostDir}/libexec"
|
||||
"nsight-systems/${versionString}/${hostDir}/libstdc*"
|
||||
"nsight-systems/${versionString}/${hostDir}/python/bin/python"
|
||||
"nsight-systems/${versionString}/${hostDir}/Mesa"
|
||||
];
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
for path in $rmPatterns; do
|
||||
rm -r "$path"
|
||||
done
|
||||
patchShebangs nsight-systems
|
||||
'';
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ qt.wrapQtAppsHook ];
|
||||
dontWrapQtApps = true;
|
||||
buildInputs = prevAttrs.buildInputs ++ [
|
||||
(qt.qtdeclarative or qt.full)
|
||||
(qt.qtsvg or qt.full)
|
||||
(qt.qtimageformats or qt.full)
|
||||
(qt.qtpositioning or qt.full)
|
||||
(qt.qtscxml or qt.full)
|
||||
(qt.qttools or qt.full)
|
||||
(qt.qtwebengine or qt.full)
|
||||
(qt.qtwayland or qt.full)
|
||||
boost178
|
||||
cuda_cudart.stubs
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gstreamer
|
||||
nss
|
||||
numactl
|
||||
pulseaudio
|
||||
qt.qtbase
|
||||
qtWaylandPlugins
|
||||
rdma-core
|
||||
ucx
|
||||
wayland
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXrandr
|
||||
xorg.libXtst
|
||||
];
|
||||
|
||||
postInstall =
|
||||
# 1. Move dependencies of nsys, nsys-ui binaries to bin output
|
||||
# 2. Fix paths in wrapper scripts
|
||||
''
|
||||
moveToOutput 'nsight-systems/${versionString}/${hostDir}' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/${targetDir}' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/bin' "''${!outputBin}"
|
||||
substituteInPlace $bin/bin/nsys $bin/bin/nsys-ui \
|
||||
--replace-fail 'nsight-systems-#VERSION_RSPLIT#' nsight-systems/${versionString}
|
||||
wrapQtApp "$bin/nsight-systems/${versionString}/${hostDir}/nsys-ui.bin"
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so $bin/nsight-systems/${versionString}/${hostDir}/Plugins/imageformats/libqtiff.so
|
||||
'';
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions // {
|
||||
"Qt 5 missing (<2022.4.2.1)" = !(versionOlder version "2022.4.2.1" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.4.2.1)" = !(versionAtLeast version "2022.4.2.1" -> qt6 != null);
|
||||
};
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions // {
|
||||
# Older releases require boost 1.70, which is deprecated in Nixpkgs
|
||||
"CUDA too old (<11.8)" = cudaOlder "11.8";
|
||||
};
|
||||
};
|
||||
|
||||
nvidia_driver =
|
||||
{ }:
|
||||
prevAttrs: {
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions // {
|
||||
"Package is not supported; use drivers from linuxPackages" = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
cudaVersion,
|
||||
fetchurl,
|
||||
final,
|
||||
lib,
|
||||
package,
|
||||
patchelf,
|
||||
zlib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
lists
|
||||
maintainers
|
||||
meta
|
||||
strings
|
||||
;
|
||||
in
|
||||
finalAttrs: prevAttrs: {
|
||||
src = fetchurl { inherit (package) url hash; };
|
||||
|
||||
# Useful for inspecting why something went wrong.
|
||||
badPlatformsConditions =
|
||||
let
|
||||
cudaTooOld = strings.versionOlder cudaVersion package.minCudaVersion;
|
||||
cudaTooNew =
|
||||
(package.maxCudaVersion != null) && strings.versionOlder package.maxCudaVersion cudaVersion;
|
||||
in
|
||||
prevAttrs.badPlatformsConditions
|
||||
// {
|
||||
"CUDA version is too old" = cudaTooOld;
|
||||
"CUDA version is too new" = cudaTooNew;
|
||||
};
|
||||
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
++ [ zlib ]
|
||||
++ lists.optionals finalAttrs.passthru.useCudatoolkitRunfile [ final.cudatoolkit ]
|
||||
++ lists.optionals (!finalAttrs.passthru.useCudatoolkitRunfile) [ final.libcublas.lib ];
|
||||
|
||||
# Tell autoPatchelf about runtime dependencies. *_infer* libraries only
|
||||
# exist in CuDNN 8.
|
||||
# NOTE: Versions from CUDNN releases have four components.
|
||||
postFixup =
|
||||
strings.optionalString
|
||||
(
|
||||
strings.versionAtLeast finalAttrs.version "8.0.5.0"
|
||||
&& strings.versionOlder finalAttrs.version "9.0.0.0"
|
||||
)
|
||||
''
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
|
||||
'';
|
||||
|
||||
passthru.useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
|
||||
|
||||
meta = prevAttrs.meta // {
|
||||
homepage = "https://developer.nvidia.com/cudnn";
|
||||
maintainers =
|
||||
prevAttrs.meta.maintainers or [ ]
|
||||
++ (with maintainers; [
|
||||
mdaiter
|
||||
samuela
|
||||
connorbaker
|
||||
]);
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = {
|
||||
shortName = "cuDNN EULA";
|
||||
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
||||
url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
|
||||
free = false;
|
||||
redistributable = !finalAttrs.passthru.useCudatoolkitRunfile;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
}:
|
||||
{
|
||||
featureRelease = lib.optionalAttrs (redistArch != "unsupported") {
|
||||
inherit (package) minCudaVersion maxCudaVersion;
|
||||
${redistArch}.outputs = {
|
||||
lib = true;
|
||||
static = true;
|
||||
@@ -16,6 +17,6 @@
|
||||
};
|
||||
redistribRelease = {
|
||||
name = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
|
||||
inherit (package) version;
|
||||
inherit (package) hash url version;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ let
|
||||
attrsets
|
||||
lists
|
||||
modules
|
||||
versions
|
||||
strings
|
||||
trivial
|
||||
;
|
||||
|
||||
@@ -65,14 +63,6 @@ let
|
||||
# - 11.0
|
||||
# - 12
|
||||
|
||||
# libPath :: String
|
||||
libPath =
|
||||
let
|
||||
cudaMajorMinor = versions.majorMinor cudaVersion;
|
||||
cudaMajor = versions.major cudaVersion;
|
||||
in
|
||||
if cudaMajorMinor == "10.2" then cudaMajorMinor else cudaMajor;
|
||||
|
||||
# A release is supported if it has a libPath that matches our CUDA version for our platform.
|
||||
# LibPath are not constant across the same release -- one platform may support fewer
|
||||
# CUDA versions than another.
|
||||
@@ -109,30 +99,8 @@ let
|
||||
redistribRelease = redistrib.${pname};
|
||||
featureRelease = feature.${pname};
|
||||
};
|
||||
fixedDrv = drv.overrideAttrs (prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
++ lists.optionals (strings.versionOlder cudaVersion "11.4") [ final.cudatoolkit ]
|
||||
++ lists.optionals (strings.versionAtLeast cudaVersion "11.4") (
|
||||
[ final.libcublas.lib ]
|
||||
# For some reason, the 1.4.x release of cusparselt requires the cudart library.
|
||||
++ lists.optionals (strings.hasPrefix "1.4" redistrib.${pname}.version) [ final.cuda_cudart.lib ]
|
||||
);
|
||||
meta = prevAttrs.meta // {
|
||||
description = "cuSPARSELt: A High-Performance CUDA Library for Sparse Matrix-Matrix Multiplication";
|
||||
homepage = "https://developer.nvidia.com/cusparselt-downloads";
|
||||
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.sepiabrown ];
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuSPARSELt EULA";
|
||||
fullName = "cuSPARSELt SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cusparselt/license.html";
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) fixedDrv;
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) drv;
|
||||
|
||||
extension =
|
||||
let
|
||||
|
||||
@@ -25,7 +25,6 @@ let
|
||||
lists
|
||||
modules
|
||||
versions
|
||||
strings
|
||||
trivial
|
||||
;
|
||||
|
||||
@@ -127,29 +126,8 @@ let
|
||||
redistribRelease = redistrib.${pname};
|
||||
featureRelease = feature.${pname};
|
||||
};
|
||||
fixedDrv = drv.overrideAttrs (prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs
|
||||
++ lists.optionals (strings.versionOlder cudaVersion "11.4") [ final.cudatoolkit ]
|
||||
++ lists.optionals (strings.versionAtLeast cudaVersion "11.4") (
|
||||
[ final.libcublas.lib ]
|
||||
# For some reason, the 1.4.x release of cuTENSOR requires the cudart library.
|
||||
++ lists.optionals (strings.hasPrefix "1.4" redistrib.${pname}.version) [ final.cuda_cudart.lib ]
|
||||
);
|
||||
meta = prevAttrs.meta // {
|
||||
description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives";
|
||||
homepage = "https://developer.nvidia.com/cutensor";
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.obsidian-systems-maintenance ];
|
||||
teams = prevAttrs.meta.teams;
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuTENSOR EULA";
|
||||
fullName = "cuTENSOR SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cutensor/license.html";
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) fixedDrv;
|
||||
attrsets.nameValuePair (computeName redistrib.${pname}) drv;
|
||||
|
||||
extension =
|
||||
let
|
||||
|
||||
12
pkgs/development/cuda-modules/fixups/cuda_compat.nix
Normal file
12
pkgs/development/cuda-modules/fixups/cuda_compat.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ flags, lib }:
|
||||
prevAttrs: {
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvrm_gpu.so"
|
||||
"libnvrm_mem.so"
|
||||
"libnvdla_runtime.so"
|
||||
];
|
||||
# `cuda_compat` only works on aarch64-linux, and only when building for Jetson devices.
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
"Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" = !flags.isJetsonBuild;
|
||||
};
|
||||
}
|
||||
38
pkgs/development/cuda-modules/fixups/cuda_cudart.nix
Normal file
38
pkgs/development/cuda-modules/fixups/cuda_cudart.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
# TODO(@connorbaker): cuda_cudart.dev depends on crt/host_config.h, which is from
|
||||
# (getDev cuda_nvcc). It would be nice to be able to encode that.
|
||||
{ addDriverRunpath, lib }:
|
||||
prevAttrs: {
|
||||
# Remove once cuda-find-redist-features has a special case for libcuda
|
||||
outputs =
|
||||
prevAttrs.outputs or [ ]
|
||||
++ lib.lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ];
|
||||
|
||||
allowFHSReferences = false;
|
||||
|
||||
# The libcuda stub's pkg-config doesn't follow the general pattern:
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
while IFS= read -r -d $'\0' path; do
|
||||
sed -i \
|
||||
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputLib}/lib/stubs|" \
|
||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||
"$path"
|
||||
done < <(find -iname 'cuda-*.pc' -print0)
|
||||
''
|
||||
# Namelink may not be enough, add a soname.
|
||||
# Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/25536
|
||||
+ ''
|
||||
if [[ -f lib/stubs/libcuda.so && ! -f lib/stubs/libcuda.so.1 ]]; then
|
||||
ln -s libcuda.so lib/stubs/libcuda.so.1
|
||||
fi
|
||||
'';
|
||||
|
||||
postFixup =
|
||||
prevAttrs.postFixup or ""
|
||||
+ ''
|
||||
moveToOutput lib/stubs "$stubs"
|
||||
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
|
||||
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
|
||||
'';
|
||||
}
|
||||
18
pkgs/development/cuda-modules/fixups/cuda_demo_suite.nix
Normal file
18
pkgs/development/cuda-modules/fixups/cuda_demo_suite.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
libglut,
|
||||
libcufft,
|
||||
libcurand,
|
||||
libGLU,
|
||||
libglvnd,
|
||||
libgbm,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
libglut
|
||||
libcufft
|
||||
libcurand
|
||||
libGLU
|
||||
libglvnd
|
||||
libgbm
|
||||
];
|
||||
}
|
||||
38
pkgs/development/cuda-modules/fixups/cuda_gdb.nix
Normal file
38
pkgs/development/cuda-modules/fixups/cuda_gdb.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
gmp,
|
||||
expat,
|
||||
libxcrypt-legacy,
|
||||
ncurses6,
|
||||
python310,
|
||||
python311,
|
||||
python312,
|
||||
stdenv,
|
||||
lib,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
# x86_64 only needs gmp from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ gmp ]
|
||||
# Additional dependencies for CUDA 12.5 and later, which
|
||||
# support multiple Python versions.
|
||||
++ lib.lists.optionals (cudaAtLeast "12.5") [
|
||||
libxcrypt-legacy
|
||||
ncurses6
|
||||
python310
|
||||
python311
|
||||
python312
|
||||
]
|
||||
# aarch64,sbsa needs expat
|
||||
++ lib.lists.optionals (stdenv.hostPlatform.isAarch64) [ expat ];
|
||||
|
||||
installPhase =
|
||||
prevAttrs.installPhase or ""
|
||||
# Python 3.8 is not in nixpkgs anymore, delete Python 3.8 cuda-gdb support
|
||||
# to avoid autopatchelf failing to find libpython3.8.so.
|
||||
+ lib.optionalString (cudaAtLeast "12.5") ''
|
||||
find $bin -name '*python3.8*' -delete
|
||||
find $bin -name '*python3.9*' -delete
|
||||
'';
|
||||
}
|
||||
72
pkgs/development/cuda-modules/fixups/cuda_nvcc.nix
Normal file
72
pkgs/development/cuda-modules/fixups/cuda_nvcc.nix
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
lib,
|
||||
backendStdenv,
|
||||
cudaOlder,
|
||||
setupCudaHook,
|
||||
}:
|
||||
prevAttrs: {
|
||||
# Merge "bin" and "dev" into "out" to avoid circular references
|
||||
outputs = builtins.filter (
|
||||
x:
|
||||
!(builtins.elem x [
|
||||
"dev"
|
||||
"bin"
|
||||
])
|
||||
) prevAttrs.outputs or [ ];
|
||||
|
||||
# Patch the nvcc.profile.
|
||||
# Syntax:
|
||||
# - `=` for assignment,
|
||||
# - `?=` for conditional assignment,
|
||||
# - `+=` to "prepend",
|
||||
# - `=+` to "append".
|
||||
|
||||
# Cf. https://web.archive.org/web/20230308044351/https://arcb.csc.ncsu.edu/~mueller/cluster/nvidia/2.0/nvcc_2.0.pdf
|
||||
|
||||
# We set all variables with the lowest priority (=+), but we do force
|
||||
# nvcc to use the fixed backend toolchain. Cf. comments in
|
||||
# backend-stdenv.nix
|
||||
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
substituteInPlace bin/nvcc.profile \
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_TARGET_DIR_)/include' \
|
||||
"''${!outputDev}/include"
|
||||
''
|
||||
# Additional patching required pre-CUDA 12.5.
|
||||
+ lib.optionalString (cudaOlder "12.5") ''
|
||||
substituteInPlace bin/nvcc.profile \
|
||||
--replace-fail \
|
||||
'$(TOP)/$(_NVVM_BRANCH_)' \
|
||||
"''${!outputBin}/nvvm" \
|
||||
''
|
||||
+ ''
|
||||
cat << EOF >> bin/nvcc.profile
|
||||
|
||||
# Fix a compatible backend compiler
|
||||
PATH += "${backendStdenv.cc}/bin":
|
||||
|
||||
# Expose the split-out nvvm
|
||||
LIBRARIES =+ "-L''${!outputBin}/nvvm/lib"
|
||||
INCLUDES =+ "-I''${!outputBin}/nvvm/include"
|
||||
EOF
|
||||
'';
|
||||
|
||||
# Entries here will be in nativeBuildInputs when cuda_nvcc is in nativeBuildInputs.
|
||||
propagatedBuildInputs = prevAttrs.propagatedBuildInputs or [ ] ++ [ setupCudaHook ];
|
||||
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
+ ''
|
||||
moveToOutput "nvvm" "''${!outputBin}"
|
||||
'';
|
||||
|
||||
# The nvcc and cicc binaries contain hard-coded references to /usr
|
||||
allowFHSReferences = true;
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
mainProgram = "nvcc";
|
||||
};
|
||||
}
|
||||
1
pkgs/development/cuda-modules/fixups/cuda_nvprof.nix
Normal file
1
pkgs/development/cuda-modules/fixups/cuda_nvprof.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ cuda_cupti }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ cuda_cupti ]; }
|
||||
@@ -0,0 +1 @@
|
||||
_: _: { outputs = [ "out" ]; }
|
||||
84
pkgs/development/cuda-modules/fixups/cudnn.nix
Normal file
84
pkgs/development/cuda-modules/fixups/cudnn.nix
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
cudaOlder,
|
||||
cudatoolkit,
|
||||
cudaVersion,
|
||||
fetchurl,
|
||||
lib,
|
||||
libcublas ? null, # cuDNN uses CUDA Toolkit on old releases, where libcublas is not available.
|
||||
patchelf,
|
||||
zlib,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
lists
|
||||
maintainers
|
||||
meta
|
||||
strings
|
||||
;
|
||||
in
|
||||
finalAttrs: prevAttrs: {
|
||||
src = fetchurl { inherit (finalAttrs.passthru.redistribRelease) hash url; };
|
||||
|
||||
# Useful for inspecting why something went wrong.
|
||||
badPlatformsConditions =
|
||||
let
|
||||
cudaTooOld = cudaOlder finalAttrs.passthru.featureRelease.minCudaVersion;
|
||||
cudaTooNew =
|
||||
(finalAttrs.passthru.featureRelease.maxCudaVersion != null)
|
||||
&& strings.versionOlder finalAttrs.passthru.featureRelease.maxCudaVersion cudaVersion;
|
||||
in
|
||||
prevAttrs.badPlatformsConditions or { }
|
||||
// {
|
||||
"CUDA version is too old" = cudaTooOld;
|
||||
"CUDA version is too new" = cudaTooNew;
|
||||
};
|
||||
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ [ zlib ]
|
||||
++ lists.optionals finalAttrs.passthru.useCudatoolkitRunfile [ cudatoolkit ]
|
||||
++ lists.optionals (!finalAttrs.passthru.useCudatoolkitRunfile) [ (libcublas.lib or null) ];
|
||||
|
||||
# Tell autoPatchelf about runtime dependencies. *_infer* libraries only
|
||||
# exist in CuDNN 8.
|
||||
# NOTE: Versions from CUDNN releases have four components.
|
||||
postFixup =
|
||||
prevAttrs.postFixup or ""
|
||||
+
|
||||
strings.optionalString
|
||||
(
|
||||
strings.versionAtLeast finalAttrs.version "8.0.5.0"
|
||||
&& strings.versionOlder finalAttrs.version "9.0.0.0"
|
||||
)
|
||||
''
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn.so --add-needed libcudnn_cnn_infer.so
|
||||
${meta.getExe patchelf} $lib/lib/libcudnn_ops_infer.so --add-needed libcublas.so --add-needed libcublasLt.so
|
||||
'';
|
||||
|
||||
passthru = prevAttrs.passthru or { } // {
|
||||
useCudatoolkitRunfile = cudaOlder "11.3.999";
|
||||
};
|
||||
|
||||
meta = prevAttrs.meta or { } // {
|
||||
homepage = "https://developer.nvidia.com/cudnn";
|
||||
maintainers =
|
||||
prevAttrs.meta.maintainers or [ ]
|
||||
++ (with maintainers; [
|
||||
mdaiter
|
||||
samuela
|
||||
connorbaker
|
||||
]);
|
||||
# TODO(@connorbaker): Temporary workaround to avoid changing the derivation hash since introducing more
|
||||
# brokenConditions would change the derivation as they're top-level and __structuredAttrs is set.
|
||||
broken =
|
||||
prevAttrs.meta.broken or false || (finalAttrs.passthru.useCudatoolkitRunfile && libcublas == null);
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = {
|
||||
shortName = "cuDNN EULA";
|
||||
fullName = "NVIDIA cuDNN Software License Agreement (EULA)";
|
||||
url = "https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html#supplement";
|
||||
free = false;
|
||||
redistributable = !finalAttrs.passthru.useCudatoolkitRunfile;
|
||||
};
|
||||
};
|
||||
}
|
||||
12
pkgs/development/cuda-modules/fixups/default.nix
Normal file
12
pkgs/development/cuda-modules/fixups/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ lib }:
|
||||
|
||||
lib.concatMapAttrs (
|
||||
fileName: _type:
|
||||
let
|
||||
# Fixup is in `./${attrName}.nix` or in `./${fileName}/default.nix`:
|
||||
attrName = lib.removeSuffix ".nix" fileName;
|
||||
fixup = import (./. + "/${fileName}");
|
||||
isFixup = fileName != "default.nix";
|
||||
in
|
||||
lib.optionalAttrs isFixup { ${attrName} = fixup; }
|
||||
) (builtins.readDir ./.)
|
||||
1
pkgs/development/cuda-modules/fixups/fabricmanager.nix
Normal file
1
pkgs/development/cuda-modules/fixups/fabricmanager.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ zlib ]; }
|
||||
1
pkgs/development/cuda-modules/fixups/imex.nix
Normal file
1
pkgs/development/cuda-modules/fixups/imex.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ zlib }: prevAttrs: { buildInputs = prevAttrs.buildInputs or [ ] ++ [ zlib ]; }
|
||||
18
pkgs/development/cuda-modules/fixups/libcufile.nix
Normal file
18
pkgs/development/cuda-modules/fixups/libcufile.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
cudaOlder,
|
||||
lib,
|
||||
libcublas,
|
||||
numactl,
|
||||
rdma-core,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
libcublas
|
||||
numactl
|
||||
rdma-core
|
||||
];
|
||||
# Before 11.7 libcufile depends on itself for some reason.
|
||||
autoPatchelfIgnoreMissingDeps =
|
||||
prevAttrs.autoPatchelfIgnoreMissingDeps or [ ]
|
||||
++ lib.lists.optionals (cudaOlder "11.7") [ "libcufile.so.0" ];
|
||||
}
|
||||
24
pkgs/development/cuda-modules/fixups/libcusolver.nix
Normal file
24
pkgs/development/cuda-modules/fixups/libcusolver.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libcublas,
|
||||
libcusparse ? null,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
# Always depends on this
|
||||
++ [ libcublas ]
|
||||
# Dependency from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ libnvjitlink ]
|
||||
# Dependency from 12.1 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.1") [ libcusparse ];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" =
|
||||
!(cudaAtLeast "12.0" -> (libnvjitlink != null && libnvjitlink != null));
|
||||
"libcusparse missing (CUDA >= 12.1)" =
|
||||
!(cudaAtLeast "12.1" -> (libcusparse != null && libcusparse != null));
|
||||
};
|
||||
}
|
||||
16
pkgs/development/cuda-modules/fixups/libcusparse.nix
Normal file
16
pkgs/development/cuda-modules/fixups/libcusparse.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
cudaAtLeast,
|
||||
lib,
|
||||
libnvjitlink ? null,
|
||||
}:
|
||||
prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
# Dependency from 12.0 and on
|
||||
++ lib.lists.optionals (cudaAtLeast "12.0") [ libnvjitlink ];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"libnvjitlink missing (CUDA >= 12.0)" =
|
||||
!(cudaAtLeast "12.0" -> (libnvjitlink != null && libnvjitlink != null));
|
||||
};
|
||||
}
|
||||
37
pkgs/development/cuda-modules/fixups/libcusparse_lt.nix
Normal file
37
pkgs/development/cuda-modules/fixups/libcusparse_lt.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
cuda_cudart ? null,
|
||||
cudaAtLeast,
|
||||
cudaOlder,
|
||||
cudatoolkit,
|
||||
lib,
|
||||
libcublas ? null,
|
||||
}:
|
||||
finalAttrs: prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
|
||||
++ lib.optionals (cudaAtLeast "11.4") (
|
||||
[ (libcublas.lib or null) ]
|
||||
# For some reason, the 1.4.x release of cusparselt requires the cudart library.
|
||||
++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (cuda_cudart.lib or null) ]
|
||||
);
|
||||
meta = prevAttrs.meta or { } // {
|
||||
description = "cuSPARSELt: A High-Performance CUDA Library for Sparse Matrix-Matrix Multiplication";
|
||||
homepage = "https://developer.nvidia.com/cusparselt-downloads";
|
||||
# TODO(@connorbaker): Temporary workaround to avoid changing the derivation hash since introducing more
|
||||
# brokenConditions would change the derivation as they're top-level and __structuredAttrs is set.
|
||||
broken =
|
||||
prevAttrs.meta.broken or false
|
||||
|| (
|
||||
cudaAtLeast "11.4"
|
||||
&& (libcublas == null || (lib.hasPrefix "1.4" finalAttrs.version && cuda_cudart == null))
|
||||
);
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.sepiabrown ];
|
||||
teams = prevAttrs.meta.teams or [ ];
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuSPARSELt EULA";
|
||||
fullName = "cuSPARSELt SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cusparselt/license.html";
|
||||
};
|
||||
};
|
||||
}
|
||||
37
pkgs/development/cuda-modules/fixups/libcutensor.nix
Normal file
37
pkgs/development/cuda-modules/fixups/libcutensor.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
cuda_cudart ? null,
|
||||
cudaAtLeast,
|
||||
cudaOlder,
|
||||
cudatoolkit,
|
||||
lib,
|
||||
libcublas ? null,
|
||||
}:
|
||||
finalAttrs: prevAttrs: {
|
||||
buildInputs =
|
||||
prevAttrs.buildInputs or [ ]
|
||||
++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
|
||||
++ lib.optionals (cudaAtLeast "11.4") (
|
||||
[ (libcublas.lib or null) ]
|
||||
# For some reason, the 1.4.x release of cuTENSOR requires the cudart library.
|
||||
++ lib.optionals (lib.hasPrefix "1.4" finalAttrs.version) [ (cuda_cudart.lib or null) ]
|
||||
);
|
||||
meta = prevAttrs.meta or { } // {
|
||||
description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives";
|
||||
homepage = "https://developer.nvidia.com/cutensor";
|
||||
# TODO(@connorbaker): Temporary workaround to avoid changing the derivation hash since introducing more
|
||||
# brokenConditions would change the derivation as they're top-level and __structuredAttrs is set.
|
||||
broken =
|
||||
prevAttrs.meta.broken or false
|
||||
|| (
|
||||
cudaAtLeast "11.4"
|
||||
&& (libcublas == null || (lib.hasPrefix "1.4" finalAttrs.version && cuda_cudart == null))
|
||||
);
|
||||
maintainers = prevAttrs.meta.maintainers or [ ] ++ [ lib.maintainers.obsidian-systems-maintenance ];
|
||||
teams = prevAttrs.meta.teams;
|
||||
license = lib.licenses.unfreeRedistributable // {
|
||||
shortName = "cuTENSOR EULA";
|
||||
fullName = "cuTENSOR SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS";
|
||||
url = "https://docs.nvidia.com/cuda/cutensor/license.html";
|
||||
};
|
||||
};
|
||||
}
|
||||
62
pkgs/development/cuda-modules/fixups/nsight_compute.nix
Normal file
62
pkgs/development/cuda-modules/fixups/nsight_compute.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
lib,
|
||||
qt5 ? null,
|
||||
qt6 ? null,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
inherit (lib.strings) versionOlder versionAtLeast;
|
||||
inherit (prevAttrs) version;
|
||||
qt = if versionOlder version "2022.2.0" then qt5 else qt6;
|
||||
qtwayland =
|
||||
if lib.versions.major qt.qtbase.version == "5" then
|
||||
lib.getBin qt.qtwayland
|
||||
else
|
||||
lib.getLib qt.qtwayland;
|
||||
inherit (qt) wrapQtAppsHook qtwebview;
|
||||
archDir =
|
||||
{
|
||||
aarch64-linux = "linux-desktop-t210-a64";
|
||||
x86_64-linux = "linux-desktop-glibc_2_11_3-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
in
|
||||
{
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ wrapQtAppsHook ];
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
qtwayland
|
||||
qtwebview
|
||||
(qt.qtwebengine or qt.full)
|
||||
rdma-core
|
||||
];
|
||||
dontWrapQtApps = true;
|
||||
preInstall =
|
||||
prevAttrs.preInstall or ""
|
||||
+ ''
|
||||
rm -rf host/${archDir}/Mesa/
|
||||
'';
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
+ ''
|
||||
moveToOutput 'ncu' "''${!outputBin}/bin"
|
||||
moveToOutput 'ncu-ui' "''${!outputBin}/bin"
|
||||
moveToOutput 'host/${archDir}' "''${!outputBin}/bin"
|
||||
moveToOutput 'target/${archDir}' "''${!outputBin}/bin"
|
||||
wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin"
|
||||
'';
|
||||
preFixup =
|
||||
prevAttrs.preFixup or ""
|
||||
+ ''
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so"
|
||||
'';
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"Qt 5 missing (<2022.2.0)" = !(versionOlder version "2022.2.0" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.2.0)" = !(versionAtLeast version "2022.2.0" -> qt6 != null);
|
||||
};
|
||||
}
|
||||
128
pkgs/development/cuda-modules/fixups/nsight_systems.nix
Normal file
128
pkgs/development/cuda-modules/fixups/nsight_systems.nix
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
boost178,
|
||||
cuda_cudart,
|
||||
cudaOlder,
|
||||
gst_all_1,
|
||||
lib,
|
||||
nss,
|
||||
numactl,
|
||||
pulseaudio,
|
||||
qt5 ? null,
|
||||
qt6 ? null,
|
||||
rdma-core,
|
||||
stdenv,
|
||||
ucx,
|
||||
wayland,
|
||||
xorg,
|
||||
}:
|
||||
prevAttrs:
|
||||
let
|
||||
inherit (lib.strings) versionOlder versionAtLeast;
|
||||
inherit (prevAttrs) version;
|
||||
qt = if lib.strings.versionOlder prevAttrs.version "2022.4.2.1" then qt5 else qt6;
|
||||
qtwayland =
|
||||
if lib.versions.major qt.qtbase.version == "5" then
|
||||
lib.getBin qt.qtwayland
|
||||
else
|
||||
lib.getLib qt.qtwayland;
|
||||
qtWaylandPlugins = "${qtwayland}/${qt.qtbase.qtPluginPrefix}";
|
||||
hostDir =
|
||||
{
|
||||
aarch64-linux = "host-linux-armv8";
|
||||
x86_64-linux = "host-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
targetDir =
|
||||
{
|
||||
aarch64-linux = "target-linux-sbsa-armv8";
|
||||
x86_64-linux = "target-linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
versionString = with lib.versions; "${majorMinor version}.${patch version}";
|
||||
in
|
||||
{
|
||||
# An ad hoc replacement for
|
||||
# https://github.com/ConnorBaker/cuda-redist-find-features/issues/11
|
||||
env = prevAttrs.env or { } // {
|
||||
rmPatterns =
|
||||
prevAttrs.env.rmPatterns or ""
|
||||
+ toString [
|
||||
"nsight-systems/${versionString}/${hostDir}/lib{arrow,jpeg}*"
|
||||
"nsight-systems/${versionString}/${hostDir}/lib{ssl,ssh,crypto}*"
|
||||
"nsight-systems/${versionString}/${hostDir}/libboost*"
|
||||
"nsight-systems/${versionString}/${hostDir}/libexec"
|
||||
"nsight-systems/${versionString}/${hostDir}/libstdc*"
|
||||
"nsight-systems/${versionString}/${hostDir}/python/bin/python"
|
||||
"nsight-systems/${versionString}/${hostDir}/Mesa"
|
||||
];
|
||||
};
|
||||
postPatch =
|
||||
prevAttrs.postPatch or ""
|
||||
+ ''
|
||||
for path in $rmPatterns; do
|
||||
rm -r "$path"
|
||||
done
|
||||
patchShebangs nsight-systems
|
||||
'';
|
||||
nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ qt.wrapQtAppsHook ];
|
||||
dontWrapQtApps = true;
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [
|
||||
(qt.qtdeclarative or qt.full)
|
||||
(qt.qtsvg or qt.full)
|
||||
(qt.qtimageformats or qt.full)
|
||||
(qt.qtpositioning or qt.full)
|
||||
(qt.qtscxml or qt.full)
|
||||
(qt.qttools or qt.full)
|
||||
(qt.qtwebengine or qt.full)
|
||||
(qt.qtwayland or qt.full)
|
||||
boost178
|
||||
cuda_cudart.stubs
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gstreamer
|
||||
nss
|
||||
numactl
|
||||
pulseaudio
|
||||
qt.qtbase
|
||||
qtWaylandPlugins
|
||||
rdma-core
|
||||
ucx
|
||||
wayland
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXrandr
|
||||
xorg.libXtst
|
||||
];
|
||||
|
||||
postInstall =
|
||||
prevAttrs.postInstall or ""
|
||||
# 1. Move dependencies of nsys, nsys-ui binaries to bin output
|
||||
# 2. Fix paths in wrapper scripts
|
||||
+ ''
|
||||
moveToOutput 'nsight-systems/${versionString}/${hostDir}' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/${targetDir}' "''${!outputBin}"
|
||||
moveToOutput 'nsight-systems/${versionString}/bin' "''${!outputBin}"
|
||||
substituteInPlace $bin/bin/nsys $bin/bin/nsys-ui \
|
||||
--replace-fail 'nsight-systems-#VERSION_RSPLIT#' nsight-systems/${versionString}
|
||||
wrapQtApp "$bin/nsight-systems/${versionString}/${hostDir}/nsys-ui.bin"
|
||||
'';
|
||||
|
||||
preFixup =
|
||||
prevAttrs.preFixup or ""
|
||||
+ ''
|
||||
# lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6
|
||||
patchelf --replace-needed libtiff.so.5 libtiff.so $bin/nsight-systems/${versionString}/${hostDir}/Plugins/imageformats/libqtiff.so
|
||||
'';
|
||||
|
||||
autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [
|
||||
"libnvidia-ml.so.1"
|
||||
];
|
||||
|
||||
brokenConditions = prevAttrs.brokenConditions or { } // {
|
||||
"Qt 5 missing (<2022.4.2.1)" = !(versionOlder version "2022.4.2.1" -> qt5 != null);
|
||||
"Qt 6 missing (>=2022.4.2.1)" = !(versionAtLeast version "2022.4.2.1" -> qt6 != null);
|
||||
};
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
# Older releases require boost 1.70, which is deprecated in Nixpkgs
|
||||
"CUDA too old (<11.8)" = cudaOlder "11.8";
|
||||
};
|
||||
}
|
||||
5
pkgs/development/cuda-modules/fixups/nvidia_driver.nix
Normal file
5
pkgs/development/cuda-modules/fixups/nvidia_driver.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
_: prevAttrs: {
|
||||
badPlatformsConditions = prevAttrs.badPlatformsConditions or { } // {
|
||||
"Package is not supported; use drivers from linuxPackages" = true;
|
||||
};
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
{
|
||||
cudaOlder,
|
||||
cudaPackages,
|
||||
cudaVersion,
|
||||
final,
|
||||
lib,
|
||||
mkVersionedPackageName,
|
||||
package,
|
||||
patchelf,
|
||||
requireFile,
|
||||
stdenv,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
@@ -28,18 +27,19 @@ finalAttrs: prevAttrs: {
|
||||
# Useful for inspecting why something went wrong.
|
||||
brokenConditions =
|
||||
let
|
||||
cudaTooOld = strings.versionOlder cudaVersion package.minCudaVersion;
|
||||
cudaTooOld = cudaOlder finalAttrs.passthru.featureRelease.minCudaVersion;
|
||||
cudaTooNew =
|
||||
(package.maxCudaVersion != null) && strings.versionOlder package.maxCudaVersion cudaVersion;
|
||||
cudnnVersionIsSpecified = package.cudnnVersion != null;
|
||||
cudnnVersionSpecified = versions.majorMinor package.cudnnVersion;
|
||||
(finalAttrs.passthru.featureRelease.maxCudaVersion != null)
|
||||
&& strings.versionOlder finalAttrs.passthru.featureRelease.maxCudaVersion cudaVersion;
|
||||
cudnnVersionIsSpecified = finalAttrs.passthru.featureRelease.cudnnVersion != null;
|
||||
cudnnVersionSpecified = versions.majorMinor finalAttrs.passthru.featureRelease.cudnnVersion;
|
||||
cudnnVersionProvided = versions.majorMinor finalAttrs.passthru.cudnn.version;
|
||||
cudnnTooOld =
|
||||
cudnnVersionIsSpecified && (strings.versionOlder cudnnVersionProvided cudnnVersionSpecified);
|
||||
cudnnTooNew =
|
||||
cudnnVersionIsSpecified && (strings.versionOlder cudnnVersionSpecified cudnnVersionProvided);
|
||||
in
|
||||
prevAttrs.brokenConditions
|
||||
prevAttrs.brokenConditions or { }
|
||||
// {
|
||||
"CUDA version is too old" = cudaTooOld;
|
||||
"CUDA version is too new" = cudaTooNew;
|
||||
@@ -48,27 +48,27 @@ finalAttrs: prevAttrs: {
|
||||
};
|
||||
|
||||
src = requireFile {
|
||||
name = package.filename;
|
||||
inherit (package) hash;
|
||||
name = finalAttrs.passthru.redistribRelease.filename;
|
||||
inherit (finalAttrs.passthru.redistribRelease) hash;
|
||||
message = ''
|
||||
To use the TensorRT derivation, you must join the NVIDIA Developer Program and
|
||||
download the ${package.version} TAR package for CUDA ${cudaVersion} from
|
||||
download the ${finalAttrs.version} TAR package for CUDA ${cudaVersion} from
|
||||
${finalAttrs.meta.homepage}.
|
||||
|
||||
Once you have downloaded the file, add it to the store with the following
|
||||
command, and try building this derivation again.
|
||||
|
||||
$ nix-store --add-fixed sha256 ${package.filename}
|
||||
$ nix-store --add-fixed sha256 ${finalAttrs.passthru.redistribRelease.filename}
|
||||
'';
|
||||
};
|
||||
|
||||
# We need to look inside the extracted output to get the files we need.
|
||||
sourceRoot = "TensorRT-${finalAttrs.version}";
|
||||
|
||||
buildInputs = prevAttrs.buildInputs ++ [ (finalAttrs.passthru.cudnn.lib or null) ];
|
||||
buildInputs = prevAttrs.buildInputs or [ ] ++ [ (finalAttrs.passthru.cudnn.lib or null) ];
|
||||
|
||||
preInstall =
|
||||
(prevAttrs.preInstall or "")
|
||||
prevAttrs.preInstall or ""
|
||||
+ strings.optionalString (targetArch != "unsupported") ''
|
||||
# Replace symlinks to bin and lib with the actual directories from targets.
|
||||
for dir in bin lib; do
|
||||
@@ -87,7 +87,7 @@ finalAttrs: prevAttrs: {
|
||||
let
|
||||
versionTriple = "${versions.majorMinor finalAttrs.version}.${versions.patch finalAttrs.version}";
|
||||
in
|
||||
(prevAttrs.postFixup or "")
|
||||
prevAttrs.postFixup or ""
|
||||
+ ''
|
||||
${meta.getExe' patchelf "patchelf"} --add-needed libnvinfer.so \
|
||||
"$lib/lib/libnvinfer.so.${versionTriple}" \
|
||||
@@ -95,7 +95,7 @@ finalAttrs: prevAttrs: {
|
||||
"$lib/lib/libnvinfer_builder_resource.so.${versionTriple}"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
passthru = prevAttrs.passthru or { } // {
|
||||
useCudatoolkitRunfile = strings.versionOlder cudaVersion "11.3.999";
|
||||
# The CUDNN used with TensorRT.
|
||||
# If null, the default cudnn derivation will be used.
|
||||
@@ -103,12 +103,15 @@ finalAttrs: prevAttrs: {
|
||||
# unless it is not available, in which case the default cudnn derivation will be used.
|
||||
cudnn =
|
||||
let
|
||||
desiredName = mkVersionedPackageName "cudnn" package.cudnnVersion;
|
||||
desiredName = mkVersionedPackageName "cudnn" finalAttrs.passthru.featureRelease.cudnnVersion;
|
||||
in
|
||||
if package.cudnnVersion == null || (final ? desiredName) then final.cudnn else final.${desiredName};
|
||||
if finalAttrs.passthru.featureRelease.cudnnVersion == null || (cudaPackages ? desiredName) then
|
||||
cudaPackages.cudnn
|
||||
else
|
||||
cudaPackages.${desiredName};
|
||||
};
|
||||
|
||||
meta = prevAttrs.meta // {
|
||||
meta = prevAttrs.meta or { } // {
|
||||
badPlatforms =
|
||||
prevAttrs.meta.badPlatforms or [ ]
|
||||
++ lib.optionals (targetArch == "unsupported") [ hostPlatform.system ];
|
||||
@@ -4,7 +4,9 @@
|
||||
autoAddCudaCompatRunpath,
|
||||
autoPatchelfHook,
|
||||
backendStdenv,
|
||||
callPackage,
|
||||
fetchurl,
|
||||
fixups,
|
||||
lib,
|
||||
markForCudatoolkitRootHook,
|
||||
flags,
|
||||
@@ -30,7 +32,6 @@ let
|
||||
inherit (lib)
|
||||
attrsets
|
||||
lists
|
||||
meta
|
||||
strings
|
||||
trivial
|
||||
licenses
|
||||
@@ -40,6 +41,12 @@ let
|
||||
|
||||
inherit (stdenv) hostPlatform;
|
||||
|
||||
# Last step before returning control to `callPackage` (adds the `.override` method)
|
||||
# we'll apply (`overrideAttrs`) necessary package-specific "fixup" functions.
|
||||
# Order is significant.
|
||||
maybeFixup = fixups.${pname} or null;
|
||||
fixup = if maybeFixup != null then callPackage maybeFixup { } else { };
|
||||
|
||||
# Get the redist architectures for which package provides distributables.
|
||||
# These are used by meta.platforms.
|
||||
supportedRedistArchs = builtins.attrNames featureRelease;
|
||||
@@ -50,7 +57,7 @@ let
|
||||
|
||||
sourceMatchesHost = flags.getNixSystem redistArch == hostPlatform.system;
|
||||
in
|
||||
backendStdenv.mkDerivation (finalAttrs: {
|
||||
(backendStdenv.mkDerivation (finalAttrs: {
|
||||
# NOTE: Even though there's no actual buildPhase going on here, the derivations of the
|
||||
# redistributables are sensitive to the compiler flags provided to stdenv. The patchelf package
|
||||
# is sensitive to the compiler flags provided to stdenv, and we depend on it. As such, we are
|
||||
@@ -303,8 +310,12 @@ backendStdenv.mkDerivation (finalAttrs: {
|
||||
true
|
||||
'';
|
||||
|
||||
# Make the CUDA-patched stdenv available
|
||||
passthru.stdenv = backendStdenv;
|
||||
passthru = {
|
||||
# Provide access to the release information for fixup functions.
|
||||
inherit redistribRelease featureRelease;
|
||||
# Make the CUDA-patched stdenv available
|
||||
stdenv = backendStdenv;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "${redistribRelease.name}. By downloading and using the packages you accept the terms and conditions of the ${finalAttrs.meta.license.shortName}";
|
||||
@@ -321,7 +332,21 @@ backendStdenv.mkDerivation (finalAttrs: {
|
||||
isBadPlatform = lists.any trivial.id (attrsets.attrValues finalAttrs.badPlatformsConditions);
|
||||
in
|
||||
lists.optionals isBadPlatform finalAttrs.meta.platforms;
|
||||
license = licenses.unfree;
|
||||
license =
|
||||
if redistName == "cuda" then
|
||||
# Add the package-specific license.
|
||||
let
|
||||
licensePath =
|
||||
if redistribRelease.license_path != null then
|
||||
redistribRelease.license_path
|
||||
else
|
||||
"${pname}/LICENSE.txt";
|
||||
url = "https://developer.download.nvidia.com/compute/cuda/redist/${licensePath}";
|
||||
in
|
||||
lib.licenses.nvidiaCudaRedist // { inherit url; }
|
||||
else
|
||||
licenses.unfree;
|
||||
teams = [ teams.cuda ];
|
||||
};
|
||||
})
|
||||
})).overrideAttrs
|
||||
fixup
|
||||
|
||||
@@ -6,8 +6,14 @@
|
||||
stdenv,
|
||||
# Expected to be passed by the caller
|
||||
mkVersionedPackageName,
|
||||
# pname :: String
|
||||
# Builder-specific arguments
|
||||
# Short package name (e.g., "cuda_cccl")
|
||||
# pname : String
|
||||
pname,
|
||||
# Common name (e.g., "cutensor" or "cudnn") -- used in the URL.
|
||||
# Also known as the Redistributable Name.
|
||||
# redistName : String,
|
||||
redistName,
|
||||
# releasesModule :: Path
|
||||
# A path to a module which provides a `releases` attribute
|
||||
releasesModule,
|
||||
@@ -17,20 +23,11 @@
|
||||
# and the package description (which NVIDIA's manifest calls the "name").
|
||||
# It's also used for fetching the source, but we override that since we can't
|
||||
# re-use that portion of the functionality (different URLs, etc.).
|
||||
# The featureRelease is used to populate meta.platforms (by way of looking at the attribute names)
|
||||
# and to determine the outputs of the package.
|
||||
# The featureRelease is used to populate meta.platforms (by way of looking at the attribute names), determine the
|
||||
# outputs of the package, and provide additional package-specific constraints (e.g., min/max supported CUDA versions,
|
||||
# required versions of other packages, etc.).
|
||||
# shimFn :: {package, redistArch} -> AttrSet
|
||||
shimsFn ? (throw "shimsFn must be provided"),
|
||||
# fixupFn :: Path
|
||||
# A path (or nix expression) to be evaluated with callPackage and then
|
||||
# provided to the package's overrideAttrs function.
|
||||
# It must accept at least the following arguments:
|
||||
# - final
|
||||
# - cudaVersion
|
||||
# - mkVersionedPackageName
|
||||
# - package
|
||||
# - ...
|
||||
fixupFn ? (throw "fixupFn must be provided"),
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
@@ -97,19 +94,6 @@ let
|
||||
|
||||
newest = builtins.head (builtins.sort preferable allReleases);
|
||||
|
||||
# A function which takes the `final` overlay and the `package` being built and returns
|
||||
# a function to be consumed via `overrideAttrs`.
|
||||
overrideAttrsFixupFn =
|
||||
final: package:
|
||||
final.callPackage fixupFn {
|
||||
inherit
|
||||
final
|
||||
cudaVersion
|
||||
mkVersionedPackageName
|
||||
package
|
||||
;
|
||||
};
|
||||
|
||||
extension =
|
||||
final: _:
|
||||
let
|
||||
@@ -124,13 +108,11 @@ let
|
||||
};
|
||||
name = computeName package;
|
||||
drv = final.callPackage ./manifest.nix {
|
||||
inherit pname;
|
||||
redistName = pname;
|
||||
inherit pname redistName;
|
||||
inherit (shims) redistribRelease featureRelease;
|
||||
};
|
||||
fixedDrv = drv.overrideAttrs (overrideAttrsFixupFn final package);
|
||||
in
|
||||
attrsets.nameValuePair name fixedDrv;
|
||||
attrsets.nameValuePair name drv;
|
||||
|
||||
# versionedDerivations :: AttrSet Derivation
|
||||
versionedDerivations = builtins.listToAttrs (lists.map buildPackage allReleases);
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
autoAddDriverRunpath,
|
||||
catch2_3,
|
||||
cmake,
|
||||
cudaPackages,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
lib,
|
||||
ninja,
|
||||
nlohmann_json,
|
||||
stdenv,
|
||||
cuda_cccl ? null,
|
||||
cuda_cudart ? null,
|
||||
cuda_nvcc ? null,
|
||||
cuda_nvrtc ? null,
|
||||
cudnn ? null,
|
||||
libcublas ? null,
|
||||
}:
|
||||
let
|
||||
inherit (lib.lists) optionals;
|
||||
@@ -17,14 +22,6 @@ let
|
||||
cmakeFeature
|
||||
optionalString
|
||||
;
|
||||
inherit (cudaPackages)
|
||||
cuda_cccl
|
||||
cuda_cudart
|
||||
cuda_nvcc
|
||||
cuda_nvrtc
|
||||
cudnn
|
||||
libcublas
|
||||
;
|
||||
in
|
||||
|
||||
# TODO(@connorbaker): This should be a hybrid C++/Python package.
|
||||
@@ -125,6 +122,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
description = "A c++ wrapper for the cudnn backend API";
|
||||
homepage = "https://github.com/NVIDIA/cudnn-frontend";
|
||||
license = lib.licenses.mit;
|
||||
badPlatforms = optionals (cudnn == null) finalAttrs.meta.platforms;
|
||||
platforms = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
}:
|
||||
{
|
||||
featureRelease = lib.optionalAttrs (redistArch != "unsupported") {
|
||||
inherit (package) cudnnVersion minCudaVersion maxCudaVersion;
|
||||
${redistArch}.outputs = {
|
||||
bin = true;
|
||||
lib = true;
|
||||
@@ -19,6 +20,6 @@
|
||||
};
|
||||
redistribRelease = {
|
||||
name = "TensorRT: a high-performance deep learning interface";
|
||||
inherit (package) version;
|
||||
inherit (package) hash filename version;
|
||||
};
|
||||
}
|
||||
|
||||
81
pkgs/development/python-modules/fenics-basix/default.nix
Normal file
81
pkgs/development/python-modules/fenics-basix/default.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
scikit-build-core,
|
||||
nanobind,
|
||||
cmake,
|
||||
ninja,
|
||||
pkg-config,
|
||||
blas,
|
||||
lapack,
|
||||
numpy,
|
||||
sympy,
|
||||
scipy,
|
||||
matplotlib,
|
||||
fenics-ufl,
|
||||
pytest-xdist,
|
||||
pytestCheckHook,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "fenics-basix";
|
||||
version = "0.9.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fenics";
|
||||
repo = "basix";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-jLQMDt6zdl+oixd5Qevn4bvxBsXpTNcbH2Os6TC9sRQ=";
|
||||
};
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
build-system = [
|
||||
scikit-build-core
|
||||
nanobind
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
numpy
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
blas
|
||||
lapack
|
||||
];
|
||||
|
||||
# Prefer finding BLAS and LAPACK via pkg-config.
|
||||
# Avoid using the Accelerate.framework from the Darwin SDK.
|
||||
# Also, avoid mistaking BLAS for LAPACK.
|
||||
env.CMAKE_ARGS = lib.cmakeBool "BLA_PREFER_PKGCONFIG" true;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"basix"
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
sympy
|
||||
scipy
|
||||
matplotlib
|
||||
fenics-ufl
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://fenicsproject.org";
|
||||
downloadPage = "https://github.com/fenics/basix";
|
||||
description = "Finite element definition and tabulation runtime library";
|
||||
changelog = "https://github.com/fenics/basix/releases/tag/${src.tag}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ qbisi ];
|
||||
};
|
||||
}
|
||||
157
pkgs/development/python-modules/fenics-dolfinx/default.nix
Normal file
157
pkgs/development/python-modules/fenics-dolfinx/default.nix
Normal file
@@ -0,0 +1,157 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
toPythonModule,
|
||||
fetchFromGitHub,
|
||||
buildPythonPackage,
|
||||
|
||||
# build-system
|
||||
scikit-build-core,
|
||||
nanobind,
|
||||
|
||||
# nativeBuildInputs
|
||||
cmake,
|
||||
ninja,
|
||||
pkg-config,
|
||||
|
||||
# buildInputs
|
||||
dolfinx,
|
||||
|
||||
# dependency
|
||||
numpy,
|
||||
cffi,
|
||||
mpi4py,
|
||||
petsc4py,
|
||||
slepc4py,
|
||||
adios2,
|
||||
kahip,
|
||||
fenics-ffcx,
|
||||
fenics-basix,
|
||||
fenics-ufl,
|
||||
|
||||
# nativeCheckInputs
|
||||
scipy,
|
||||
matplotlib,
|
||||
pytest-xdist,
|
||||
pytestCheckHook,
|
||||
writableTmpDirAsHomeHook,
|
||||
mpiCheckPhaseHook,
|
||||
|
||||
# custom options
|
||||
withParmetis ? false,
|
||||
|
||||
# passthru.tests
|
||||
fenics-dolfinx,
|
||||
mpich,
|
||||
}:
|
||||
|
||||
let
|
||||
fenicsPackages = petsc4py.petscPackages.overrideScope (
|
||||
final: prev: {
|
||||
slepc = final.callPackage slepc4py.override { };
|
||||
adios2 = final.callPackage adios2.override { };
|
||||
kahip = final.callPackage kahip.override { };
|
||||
dolfinx = final.callPackage dolfinx.override { inherit withParmetis; };
|
||||
}
|
||||
);
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
inherit (dolfinx)
|
||||
version
|
||||
src
|
||||
;
|
||||
pname = "fenics-dolfinx";
|
||||
pyproject = true;
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"cffi"
|
||||
"fenics-ufl"
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
cd python
|
||||
'';
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
build-system = [
|
||||
scikit-build-core
|
||||
nanobind
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
pkg-config
|
||||
fenicsPackages.mpi
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
fenicsPackages.dolfinx
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
numpy
|
||||
cffi
|
||||
fenics-basix
|
||||
fenics-ffcx
|
||||
fenics-ufl
|
||||
petsc4py
|
||||
fenicsPackages.slepc
|
||||
fenicsPackages.adios2
|
||||
fenicsPackages.kahip
|
||||
(mpi4py.override { inherit (fenicsPackages) mpi; })
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
nativeCheckInputs = [
|
||||
scipy
|
||||
matplotlib
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
writableTmpDirAsHomeHook
|
||||
mpiCheckPhaseHook
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
rm -rf dolfinx
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
"dolfinx"
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# require cffi<1.17
|
||||
"test_cffi_expression"
|
||||
"test_hexahedron_mesh"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
tests =
|
||||
{
|
||||
complex = fenics-dolfinx.override {
|
||||
petsc4py = petsc4py.override { scalarType = "complex"; };
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
|
||||
mpich = fenics-dolfinx.override {
|
||||
petsc4py = petsc4py.override { mpi = mpich; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://fenicsproject.org";
|
||||
downloadPage = "https://github.com/fenics/dolfinx";
|
||||
description = "Computational environment of FEniCSx and implements the FEniCS Problem Solving Environment in C++ and Python";
|
||||
changelog = "https://github.com/fenics/dolfinx/releases/tag/${src.tag}";
|
||||
license = with lib.licenses; [
|
||||
bsd2
|
||||
lgpl3Plus
|
||||
];
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ qbisi ];
|
||||
};
|
||||
}
|
||||
70
pkgs/development/python-modules/fenics-ffcx/default.nix
Normal file
70
pkgs/development/python-modules/fenics-ffcx/default.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
numpy,
|
||||
cffi,
|
||||
fenics-ufl,
|
||||
fenics-basix,
|
||||
sympy,
|
||||
numba,
|
||||
pytestCheckHook,
|
||||
addBinToPathHook,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "fenics-ffcx";
|
||||
version = "0.9.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fenics";
|
||||
repo = "ffcx";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-eAV//RLbrxyhqgbZ2DiR7qML7xfgPn0/Seh+2no0x8w=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"fenics-ufl"
|
||||
];
|
||||
|
||||
build-system = [
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
numpy
|
||||
cffi
|
||||
setuptools
|
||||
fenics-ufl
|
||||
fenics-basix
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"ffcx"
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
sympy
|
||||
numba
|
||||
pytestCheckHook
|
||||
addBinToPathHook
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unused-command-line-argument";
|
||||
|
||||
meta = {
|
||||
homepage = "https://fenicsproject.org";
|
||||
downloadPage = "https://github.com/fenics/ffcx";
|
||||
description = "FEniCSx Form Compiler";
|
||||
changelog = "https://github.com/fenics/ffcx/releases/tag/${src.tag}";
|
||||
mainProgram = "ffcx";
|
||||
license = with lib.licenses; [
|
||||
unlicense
|
||||
lgpl3Plus
|
||||
];
|
||||
maintainers = with lib.maintainers; [ qbisi ];
|
||||
};
|
||||
}
|
||||
@@ -1005,10 +1005,6 @@ with pkgs;
|
||||
|
||||
_3llo = callPackage ../tools/misc/3llo { };
|
||||
|
||||
_1password-gui = callPackage ../applications/misc/1password-gui { };
|
||||
|
||||
_1password-gui-beta = callPackage ../applications/misc/1password-gui { channel = "beta"; };
|
||||
|
||||
_7zz-rar = _7zz.override { enableUnfree = true; };
|
||||
|
||||
acquire = with python3Packages; toPythonApplication acquire;
|
||||
|
||||
@@ -13,20 +13,20 @@
|
||||
#
|
||||
# - `prev` should only be used to access attributes which are going to be overridden.
|
||||
# - `final` should only be used to access `callPackage` to build new packages.
|
||||
# - Attribute names should be computable without relying on `final`.
|
||||
# - Extensions should take arguments to build attribute names before relying on `final`.
|
||||
# - Attribute names are evaluated eagerly ("NAMESET STRICTNESS").
|
||||
# - Extensions must not depend on `final` when computing names and count of new attributes.
|
||||
#
|
||||
# Silvan's recommendation then is to explicitly use `callPackage` to provide everything our
|
||||
# extensions need to compute the attribute names, without relying on `final`.
|
||||
#
|
||||
# I've (@connorbaker) attempted to do that, though I'm unsure of how this will interact with overrides.
|
||||
{
|
||||
callPackage,
|
||||
config,
|
||||
cudaVersion,
|
||||
lib,
|
||||
newScope,
|
||||
pkgs,
|
||||
config,
|
||||
stdenv,
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
@@ -37,18 +37,42 @@ let
|
||||
strings
|
||||
versions
|
||||
;
|
||||
# Backbone
|
||||
gpus = builtins.import ../development/cuda-modules/gpus.nix;
|
||||
nvccCompatibilities = builtins.import ../development/cuda-modules/nvcc-compatibilities.nix;
|
||||
flags = callPackage ../development/cuda-modules/flags.nix { inherit cudaVersion gpus; };
|
||||
# MUST be defined outside fix-point (cf. "NAMESET STRICTNESS" above)
|
||||
fixups = import ../development/cuda-modules/fixups { inherit lib; };
|
||||
gpus = import ../development/cuda-modules/gpus.nix;
|
||||
nvccCompatibilities = import ../development/cuda-modules/nvcc-compatibilities.nix;
|
||||
flags = import ../development/cuda-modules/flags.nix {
|
||||
inherit
|
||||
config
|
||||
cudaVersion
|
||||
gpus
|
||||
lib
|
||||
stdenv
|
||||
;
|
||||
};
|
||||
|
||||
mkVersionedPackageName =
|
||||
name: version: name + "_" + strings.replaceStrings [ "." ] [ "_" ] (versions.majorMinor version);
|
||||
|
||||
passthruFunction = final: {
|
||||
inherit cudaVersion lib pkgs;
|
||||
inherit gpus nvccCompatibilities flags;
|
||||
inherit
|
||||
cudaVersion
|
||||
fixups
|
||||
flags
|
||||
gpus
|
||||
lib
|
||||
nvccCompatibilities
|
||||
pkgs
|
||||
;
|
||||
cudaMajorVersion = versions.major cudaVersion;
|
||||
cudaMajorMinorVersion = versions.majorMinor cudaVersion;
|
||||
cudaOlder = strings.versionOlder cudaVersion;
|
||||
cudaAtLeast = strings.versionAtLeast cudaVersion;
|
||||
|
||||
# NOTE: mkVersionedPackageName is an internal, implementation detail and should not be relied on by outside consumers.
|
||||
# It may be removed in the future.
|
||||
inherit mkVersionedPackageName;
|
||||
|
||||
# Maintain a reference to the final cudaPackages.
|
||||
# Without this, if we use `final.callPackage` and a package accepts `cudaPackages` as an
|
||||
# argument, it's provided with `cudaPackages` from the top-level scope, which is not what we
|
||||
@@ -111,13 +135,6 @@ let
|
||||
attrsets.listToAttrs (attrsets.mapCartesianProduct builder configs);
|
||||
};
|
||||
|
||||
mkVersionedPackageName =
|
||||
name: version:
|
||||
strings.concatStringsSep "_" [
|
||||
name
|
||||
(strings.replaceStrings [ "." ] [ "_" ] (versions.majorMinor version))
|
||||
];
|
||||
|
||||
composedExtension = fixedPoints.composeManyExtensions (
|
||||
[
|
||||
(
|
||||
@@ -127,30 +144,53 @@ let
|
||||
directory = ../development/cuda-modules/packages;
|
||||
}
|
||||
)
|
||||
(callPackage ../development/cuda-modules/cuda/extension.nix { inherit cudaVersion; })
|
||||
(import ../development/cuda-modules/cuda/overrides.nix)
|
||||
(callPackage ../development/cuda-modules/generic-builders/multiplex.nix {
|
||||
inherit cudaVersion flags mkVersionedPackageName;
|
||||
(import ../development/cuda-modules/cuda/extension.nix { inherit cudaVersion lib; })
|
||||
(import ../development/cuda-modules/generic-builders/multiplex.nix {
|
||||
inherit
|
||||
cudaVersion
|
||||
flags
|
||||
lib
|
||||
mkVersionedPackageName
|
||||
stdenv
|
||||
;
|
||||
pname = "cudnn";
|
||||
redistName = "cudnn";
|
||||
releasesModule = ../development/cuda-modules/cudnn/releases.nix;
|
||||
shimsFn = ../development/cuda-modules/cudnn/shims.nix;
|
||||
fixupFn = ../development/cuda-modules/cudnn/fixup.nix;
|
||||
})
|
||||
(callPackage ../development/cuda-modules/cutensor/extension.nix {
|
||||
inherit cudaVersion flags mkVersionedPackageName;
|
||||
(import ../development/cuda-modules/cutensor/extension.nix {
|
||||
inherit
|
||||
cudaVersion
|
||||
flags
|
||||
lib
|
||||
mkVersionedPackageName
|
||||
stdenv
|
||||
;
|
||||
})
|
||||
(callPackage ../development/cuda-modules/cusparselt/extension.nix {
|
||||
inherit cudaVersion flags mkVersionedPackageName;
|
||||
(import ../development/cuda-modules/cusparselt/extension.nix {
|
||||
inherit
|
||||
cudaVersion
|
||||
flags
|
||||
lib
|
||||
mkVersionedPackageName
|
||||
stdenv
|
||||
;
|
||||
})
|
||||
(callPackage ../development/cuda-modules/generic-builders/multiplex.nix {
|
||||
inherit cudaVersion flags mkVersionedPackageName;
|
||||
(import ../development/cuda-modules/generic-builders/multiplex.nix {
|
||||
inherit
|
||||
cudaVersion
|
||||
flags
|
||||
lib
|
||||
mkVersionedPackageName
|
||||
stdenv
|
||||
;
|
||||
pname = "tensorrt";
|
||||
redistName = "tensorrt";
|
||||
releasesModule = ../development/cuda-modules/tensorrt/releases.nix;
|
||||
shimsFn = ../development/cuda-modules/tensorrt/shims.nix;
|
||||
fixupFn = ../development/cuda-modules/tensorrt/fixup.nix;
|
||||
})
|
||||
(callPackage ../development/cuda-modules/cuda-samples/extension.nix { inherit cudaVersion; })
|
||||
(callPackage ../development/cuda-modules/cuda-library-samples/extension.nix { })
|
||||
(import ../development/cuda-modules/cuda-samples/extension.nix { inherit cudaVersion lib stdenv; })
|
||||
(import ../development/cuda-modules/cuda-library-samples/extension.nix { inherit lib stdenv; })
|
||||
]
|
||||
++ lib.optionals config.allowAliases [ (import ../development/cuda-modules/aliases.nix) ]
|
||||
);
|
||||
|
||||
@@ -4861,6 +4861,12 @@ self: super: with self; {
|
||||
|
||||
fenics = callPackage ../development/python-modules/fenics { hdf5 = pkgs.hdf5_1_10; };
|
||||
|
||||
fenics-basix = callPackage ../development/python-modules/fenics-basix { };
|
||||
|
||||
fenics-dolfinx = callPackage ../development/python-modules/fenics-dolfinx { };
|
||||
|
||||
fenics-ffcx = callPackage ../development/python-modules/fenics-ffcx { };
|
||||
|
||||
fenics-ufl = callPackage ../development/python-modules/fenics-ufl { };
|
||||
|
||||
ffcv = callPackage ../development/python-modules/ffcv { };
|
||||
|
||||
Reference in New Issue
Block a user