-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
nvidia fails to build on unstable #90459
Comments
I just did some research on this and found the following (including a patch): https://forums.developer.nvidia.com/t/nvidia-440-82-kernel-5-7-patch/125815/5 |
oops I found that link and forgot to add it in my message after |
cc @eadwu @baracoder |
As a quick fix from user-side ( { ... }: {
# ...
nixpkgs = {
overlays = [
(self: super: {
linuxPackages_latest = super.linuxPackages_latest.extend (self: super: {
nvidia_x11 = super.nvidia_x11.overrideAttrs (attrs: {
patches = [
./nvidia/conftest.patch
];
});
});
})
];
};
} edit: there's a better snippet a few posts below |
@Patryk27 That did not work for me (the patch doesn't seem to be applied). Is your config online? |
@srid: Unfortunately, I don't have my configuration online - an excerpt that's responsible for configuring nvidia on my machine is: https://gist.github.com/Patryk27/696ed8c3d7ff028c5ca84a3ee06ba745. Could you maybe post your logs for |
I have the following in nixpkgs.overlays = [
(self: super: {
linuxPackages_latest = super.linuxPackages_latest.extend (self: super: {
nvidia_x11 = super.nvidia_x11.overrideAttrs (attrs: {
patches = [
(pkgs.fetchpatch {
name = "nvidia-kernel-5.7.patch";
url = "https://gitlab.com/snippets/1965550/raw";
sha256 = "03iwxhkajk65phc0h5j7v4gr4fjj6mhxdn04pa57am5qax8i2g9w";
})
];
});
});
})
];
|
@romildo: How are you using your Nvidia drivers - just something like I've had that issue before too (patch being seemingly ignored), and - in my case - it was caused by Nvidia being loaded twice, in different versions (I was doing |
Here are the sections of the { config, pkgs, ... }:
let
myNvidia = {
# NVIDIA Optimus Prime: prime render offload
# Https://nixos.wiki/wiki/Nvidia
# https://github.com/NixOS/nixpkgs/pull/66601
hardware.nvidia.prime.sync.enable = true;
#hardware.nvidia.prime.offload.enable = true;
hardware.nvidia.prime.intelBusId = "PCI:0:2:0";
hardware.nvidia.prime.nvidiaBusId = "PCI:1:0:0";
#hardware.nvidia.modesetting.enable = true; ###! ??? prevent tearing
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.displayManager.sddm.setupScript = ''
# workaround for using NVIDIA Optimus without Bumblebee
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
'';
nixpkgs.overlays = [
(self: super: {
linuxPackages_latest = super.linuxPackages_latest.extend (self: super: {
nvidia_x11 = super.nvidia_x11.overrideAttrs (attrs: {
patches = [
(pkgs.fetchpatch {
name = "nvidia-kernel-5.7.patch";
url = "https://gitlab.com/snippets/1965550/raw";
sha256 = "03iwxhkajk65phc0h5j7v4gr4fjj6mhxdn04pa57am5qax8i2g9w";
})
];
});
});
})
];
};
# ...
in
{
imports = [
myNvidia
# ...
];
# ...
} |
Thanks; @srid, @romildo - the issue was that Could you please try this one? { config, pkgs, ... }: {
nixpkgs.overlays = [
(self: super: {
linuxPackages_latest = super.linuxPackages_latest.extend (self: super: {
nvidiaPackages = super.nvidiaPackages // {
stable = super.nvidiaPackages.stable.overrideAttrs (attrs: {
patches = [
(pkgs.fetchpatch {
name = "nvidia-kernel-5.7.patch";
url = "https://gitlab.com/snippets/1965550/raw";
sha256 = "03iwxhkajk65phc0h5j7v4gr4fjj6mhxdn04pa57am5qax8i2g9w";
})
];
passthru = {
settings = pkgs.callPackage (import <nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix> self.nvidiaPackages.stable "15psxvd65wi6hmxmd2vvsp2v0m07axw613hb355nh15r1dpkr3ma") {
withGtk2 = true;
withGtk3 = false;
};
persistenced = pkgs.lib.mapNullable (hash: pkgs.callPackage (import <nixpkgs/pkgs/os-specific/linux/nvidia-x11/persistenced.nix> self.nvidiaPackages.stable hash) { }) "13izz9p2kg9g38gf57g3s2sw7wshp1i9m5pzljh9v82c4c22x1fw";
};
});
};
});
})
];
} (for reference: those two fancy hashes were copied from |
@Patryk27 That worked, thanks! |
This workaround fixed it for me too. |
confirming the workaround as well. the backport for 20.03 looks merged but updating nix-channel was not enough for me, I might have missed something... |
The latest commit for https://github.com/NixOS/nixpkgs-channels/commits/nixos-20.03 |
The nvidia update PR which fixed the issue is in both unstable and stable now. |
Describe the bug
Nvidia fails to build with 5.7 on unstable.
Seems like there is a fix
The text was updated successfully, but these errors were encountered: