Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linuxPackages.nvidiaPackages.beta: 555.52.04 -> 560.28.03 #329450

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nixos/modules/hardware/video/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ in

open = lib.mkEnableOption ''
the open source NVIDIA kernel module
'';
'' // {
defaultText = lib.literalExpression ''lib.versionAtLeast config.hardware.nvidia.package.version "560"'';
};
};
};

Expand Down Expand Up @@ -302,6 +304,8 @@ in
extraPackages32 = [ nvidia_x11.lib32 ];
};
environment.systemPackages = [ nvidia_x11.bin ];

hardware.nvidia.open = lib.mkDefault (lib.versionAtLeast nvidia_x11.version "560");
})

# X11
Expand Down
17 changes: 9 additions & 8 deletions pkgs/os-specific/linux/nvidia-x11/builder.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should eventually migrate away from the custom builder script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a tool to turn the nvidia-installer manifest into a json document listing all the files and where they should be installed. But I haven't had the time to turn it into a full installer.

https://github.com/Kiskae/nvidia.nix/blob/prototype/pkgs/nvidia-driver/nvidia-installer/parse-manifest.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kiskae I like where this is going. I had a similar approach some time ago, but didn't have time to finish. I pushed the changes here baracoder@5fcda66, in case there is something useful. It builds but something was not quite working yet.

Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,17 @@ installPhase() {

# EGL
if [ "$useGLVND" = "1" ]; then
sed -E "s#(libEGL_nvidia)#$i/lib/\\1#" 10_nvidia.json > 10_nvidia.json.fixed
sed -E "s#(libnvidia-egl-wayland)#$i/lib/\\1#" 10_nvidia_wayland.json > 10_nvidia_wayland.json.fixed
mkdir -p "$i/share/egl/egl_external_platform.d"
for icdname in $(find . -name '*_nvidia*.json')
do
cat "$icdname" | jq ".ICD.library_path |= \"$i/lib/\(.)\"" | tee "$i/share/egl/egl_external_platform.d/$icdname"
done

install -Dm644 10_nvidia.json.fixed $i/share/glvnd/egl_vendor.d/10_nvidia.json
install -Dm644 10_nvidia_wayland.json.fixed $i/share/egl/egl_external_platform.d/10_nvidia_wayland.json

if [[ -f "15_nvidia_gbm.json" ]]; then
sed -E "s#(libnvidia-egl-gbm)#$i/lib/\\1#" 15_nvidia_gbm.json > 15_nvidia_gbm.json.fixed
install -Dm644 15_nvidia_gbm.json.fixed $i/share/egl/egl_external_platform.d/15_nvidia_gbm.json
# glvnd icd
mkdir -p "$i/share/glvnd/egl_vendor.d"
mv "$i/share/egl/egl_external_platform.d/10_nvidia.json" "$i/share/glvnd/egl_vendor.d/10_nvidia.json"

if [[ -f "$i/share/egl/egl_external_platform.d/15_nvidia_gbm.json" ]]; then
mkdir -p $i/lib/gbm
ln -s $i/lib/libnvidia-allocator.so $i/lib/gbm/nvidia-drm_gbm.so
fi
Expand Down
12 changes: 6 additions & 6 deletions pkgs/os-specific/linux/nvidia-x11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ rec {
});

beta = selectHighestVersion latest (generic {
version = "555.52.04";
sha256_64bit = "sha256-nVOubb7zKulXhux9AruUTVBQwccFFuYGWrU1ZiakRAI=";
sha256_aarch64 = "sha256-Kt60kTTO3mli66De2d1CAoE3wr0yUbBe7eqCIrYHcWk=";
openSha256 = "sha256-wDimW8/rJlmwr1zQz8+b1uvxxxbOf3Bpk060lfLKuy0=";
settingsSha256 = "sha256-PMh5efbSEq7iqEMBr2+VGQYkBG73TGUh6FuDHZhmwHk=";
persistencedSha256 = "sha256-KAYIvPjUVilQQcD04h163MHmKcQrn2a8oaXujL2Bxro=";
version = "560.28.03";
sha256_64bit = "sha256-martv18vngYBJw1IFUCAaYr+uc65KtlHAMdLMdtQJ+Y=";
sha256_aarch64 = "sha256-+u0ZolZcZoej4nqPGmZn5qpyynLvu2QSm9Rd3wLdDmM=";
openSha256 = "sha256-asGpqOpU0tIO9QqceA8XRn5L27OiBFuI9RZ1NjSVwaM=";
settingsSha256 = "sha256-b4nhUMCzZc3VANnNb0rmcEH6H7SK2D5eZIplgPV59c8=";
persistencedSha256 = "sha256-MhITuC8tH/IPhCOUm60SrPOldOpitk78mH0rg+egkTE=";
});

# Vulkan developer beta driver
Expand Down
3 changes: 2 additions & 1 deletion pkgs/os-specific/linux/nvidia-x11/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
, nukeReferences
, which
, libarchive
, jq
, # Whether to build the libraries only (i.e. not the kernel module or
# nvidia-settings). Used to support 32-bit binaries on 64-bit
# Linux.
Expand Down Expand Up @@ -175,7 +176,7 @@ let
libPath = libPathFor pkgs;
libPath32 = optionalString i686bundled (libPathFor pkgsi686Linux);

nativeBuildInputs = [ perl nukeReferences which libarchive ]
nativeBuildInputs = [ perl nukeReferences which libarchive jq ]
++ optionals (!libsOnly) kernel.moduleBuildDependencies;

disallowedReferences = optionals (!libsOnly) [ kernel.dev ];
Expand Down
3 changes: 2 additions & 1 deletion pkgs/os-specific/linux/nvidia-x11/settings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ nvidia_x11: sha256:
, jansson
, gtk2
, dbus
, vulkan-headers
, gtk3
, libXv
, libXrandr
Expand Down Expand Up @@ -117,7 +118,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ]
++ lib.optionals withGtk3 [ wrapGAppsHook3 ];

buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 dbus ]
buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 dbus vulkan-headers ]
++ lib.optionals (withGtk2 || lib.versionOlder nvidia_x11.settingsVersion "525.53") [ gtk2 ]
++ lib.optionals withGtk3 [ gtk3 librsvg ];

Expand Down