error: attribute '"550.90.07"' missing #7

Closed
opened 2024-06-12 08:20:48 +00:00 by kapsikkum · 8 comments
kapsikkum commented 2024-06-12 08:20:48 +00:00 (Migrated from github.com)

latest version of the nvidia driver from the unstable channel is unsupported

latest version of the nvidia driver from the unstable channel is unsupported
icewind1991 commented 2024-06-12 11:57:15 +00:00 (Migrated from github.com)

It will be added automatically once upstream adds support for it

It will be added automatically once upstream adds support for it
nipsy commented 2024-12-09 17:19:43 +00:00 (Migrated from github.com)

I see the same thing happening currently with the latest version. I'm wondering if failing during a rebuild is the only option here or if there's a way to fail more gracefully in this situation to allow throwing an error but otherwise allowing the rebuild to succeed?

I can understand the correctness of failing to rebuild in the situation that version is missing from upstream. I can also understand the desire to simply ignore this without needing to comment out this overlay periodically when it breaks.

It would be nice if there was an optional way to handle this as a warning instead of a hard failure, if possible.

I see the same thing happening currently with the latest version. I'm wondering if failing during a rebuild is the only option here or if there's a way to fail more gracefully in this situation to allow throwing an error but otherwise allowing the rebuild to succeed? I can understand the correctness of failing to rebuild in the situation that version is missing from upstream. I can also understand the desire to simply ignore this without needing to comment out this overlay periodically when it breaks. It would be nice if there was an optional way to handle this as a warning instead of a hard failure, if possible.
icewind1991 commented 2024-12-09 18:33:29 +00:00 (Migrated from github.com)

I've exposed the list of patches so you can check if a patch is available for a driver version from your nixos config.

Something like:

builtins.hasAttr config.boot.kernelPackages.nvidiaPackages.stable.version pkgs.nvidia-patch-list.fbc;
I've exposed the list of patches so you can check if a patch is available for a driver version from your nixos config. Something like: ```nix builtins.hasAttr config.boot.kernelPackages.nvidiaPackages.stable.version pkgs.nvidia-patch-list.fbc; ```
heywoodlh commented 2024-12-19 16:10:38 +00:00 (Migrated from github.com)

I ran into this as well. For now, my fix is to just use this patch against NixOS 24.05. Is there a convenient way to identify the latest commit possible that is available in nixpkgs that corresponds with the latest version of the patched driver in a specific branch -- for example release-24.11?

It'd be nice to have inputs like this in a flake:

nixpkgs-nvidia = "github:nixos/nixpkgs/<some-rev>"; # <some-rev> in this case matching the latest available commit in release-24.11 branch
nvidia-patch.url = "github:icewind1991/nvidia-patch-nixos";  
nvidia-patch.inputs.nixpkgs.follows = "nixpkgs-nvidia";

And implementation could look something like this:

{ pkgs, nvidia-patch, nixpkgs-nvidia, ... }:
let
  system = pkgs.system;
  pkgs-stable = import nixpkgs-nvidia {
    inherit system;
    config.allowUnfree = true;
    overlays = [ nvidia-patch.overlays.default ];
  };
  package = pkgs-stable.linuxKernel.packages.linux_zen.nvidiaPackages.stable;
in {
  ...
  hardware.nvidia = {
    ...
    package = pkgs-stable.nvidia-patch.patch-nvenc (pkgs-stable.nvidia-patch.patch-fbc package);
  };

Ultimately, I'd love to not run an outdated version of NixOS kernel to use this patch -- but I'm not sure how other than my current solution of using the 24.05 release. :)

I ran into this as well. For now, my fix is to just use this patch against NixOS 24.05. Is there a convenient way to identify the latest commit possible that is available in nixpkgs that corresponds with the latest version of the patched driver in a specific branch -- for example `release-24.11`? It'd be nice to have inputs like this in a flake: ``` nixpkgs-nvidia = "github:nixos/nixpkgs/<some-rev>"; # <some-rev> in this case matching the latest available commit in release-24.11 branch nvidia-patch.url = "github:icewind1991/nvidia-patch-nixos"; nvidia-patch.inputs.nixpkgs.follows = "nixpkgs-nvidia"; ``` And implementation could look something like this: ``` { pkgs, nvidia-patch, nixpkgs-nvidia, ... }: let system = pkgs.system; pkgs-stable = import nixpkgs-nvidia { inherit system; config.allowUnfree = true; overlays = [ nvidia-patch.overlays.default ]; }; package = pkgs-stable.linuxKernel.packages.linux_zen.nvidiaPackages.stable; in { ... hardware.nvidia = { ... package = pkgs-stable.nvidia-patch.patch-nvenc (pkgs-stable.nvidia-patch.patch-fbc package); }; ``` Ultimately, I'd love to not run an outdated version of NixOS kernel to use this patch -- but I'm not sure how other than my current solution of using the 24.05 release. :)
Krutonium commented 2025-02-11 18:14:46 +00:00 (Migrated from github.com)

My solution was thus:

    package =
      if builtins.hasAttr video.version pkgs.nvidia-patch-list.fbc
      then pkgs.nvidia-patch.patch-nvenc (pkgs.nvidia-patch.patch-fbc video)
      else video;

Where video is defined as video = config.boot.kernelPackages.nvidiaPackages.beta; in a let block earlier.

Edit: Alternatively, this one actually applies either or both patches based on availability:

let
  stablePkg = config.boot.kernelPackages.nvidiaPackages.stable;
  pkgAfterFbc = if builtins.hasAttr stablePkg.version pkgs.nvidia-patch-list.fbc
                then pkgs.nvidia-patch.patch-fbc stablePkg
                else stablePkg;
  finalPkg   = if builtins.hasAttr stablePkg.version pkgs.nvidia-patch-list.nvenc
                then pkgs.nvidia-patch.patch-nvenc pkgAfterFbc
                else pkgAfterFbc;
in
{
  hardware.nvidia.package = finalPkg;
}

It will automatically patch the driver if a patch is available, but won't if it isn't.
@icewind1991 Perhaps this could be suggested in the readme?

My solution was thus: ``` package = if builtins.hasAttr video.version pkgs.nvidia-patch-list.fbc then pkgs.nvidia-patch.patch-nvenc (pkgs.nvidia-patch.patch-fbc video) else video; ``` Where `video` is defined as `video = config.boot.kernelPackages.nvidiaPackages.beta;` in a let block earlier. Edit: Alternatively, this one actually applies either or both patches based on availability: ``` let stablePkg = config.boot.kernelPackages.nvidiaPackages.stable; pkgAfterFbc = if builtins.hasAttr stablePkg.version pkgs.nvidia-patch-list.fbc then pkgs.nvidia-patch.patch-fbc stablePkg else stablePkg; finalPkg = if builtins.hasAttr stablePkg.version pkgs.nvidia-patch-list.nvenc then pkgs.nvidia-patch.patch-nvenc pkgAfterFbc else pkgAfterFbc; in { hardware.nvidia.package = finalPkg; } ``` It will automatically patch the driver if a patch is available, but won't if it isn't. @icewind1991 Perhaps this could be suggested in the readme?
nipsy commented 2025-02-11 18:34:26 +00:00 (Migrated from github.com)

Brilliant @Krutonium. I figured there was a cute way to handle this, and this looks to do the trick.

Brilliant @Krutonium. I figured there was a cute way to handle this, and this looks to do the trick.
nipsy commented 2025-02-11 18:42:13 +00:00 (Migrated from github.com)

Just to clarify @Krutonium, is the second version to handle situations where the patch is available for one component (fbc) but not the other (nvenc) and therefore cleanly falls back to no patching at all?

Assuming that's the case, it seems like the more robust solution obviously to avoid potential rebuild breakage. But out of curiosity, is that a situation that you've ever really encountered? Just curious.

Just to clarify @Krutonium, is the second version to handle situations where the patch is available for one component (fbc) but not the other (nvenc) and therefore cleanly falls back to no patching at all? Assuming that's the case, it seems like the more robust solution obviously to avoid potential rebuild breakage. But out of curiosity, is that a situation that you've ever really encountered? Just curious.
Krutonium commented 2025-02-11 19:12:42 +00:00 (Migrated from github.com)

The second solution will check each patch individually and apply it if it's available, so you could end up with nvenc and not fbc or fbc and not nvenc or with both. And it's possible to enounter; I looked at the source of this patch that this repo ingests and there has been versions where you only get one or the other, but not both. It's very unlikely but not impossible and that preemptively catches it.

Technically there's also no reason why you couldn't replace the if on the hardware.nvidia.package with just finalPkg - It'd point at the unmodified nvidia driver if both patches don't apply.

The second solution will check each patch individually and apply it if it's available, so you could end up with nvenc and not fbc or fbc and not nvenc or with both. And it's possible to enounter; I looked at the source of this patch that this repo ingests and there has been versions where you only get one or the other, but not both. It's very *unlikely* but not *impossible* and that preemptively catches it. Technically there's also no reason why you couldn't replace the if on the `hardware.nvidia.package` with just `finalPkg` - It'd point at the unmodified nvidia driver if both patches don't apply.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mohamed/nvidia-patch-nixos#7
No description provided.