From 083823b7904e43a4fc1c7229781417e875359a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 20 Jun 2024 16:05:41 +0200 Subject: [PATCH] gpu/amd: drop hardware.amdgpu.opencl option This now conflicts with nixpkgs. --- common/gpu/amd/default.nix | 11 ----------- lenovo/legion/15ach6h/nvidia/default.nix | 6 ++++-- lenovo/legion/16ach6h/nvidia/default.nix | 6 ++++-- lenovo/legion/16achg6/nvidia/default.nix | 6 ++++-- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix index 26cd833..6987d6e 100644 --- a/common/gpu/amd/default.nix +++ b/common/gpu/amd/default.nix @@ -6,11 +6,6 @@ ) // { default = true; }; - options.hardware.amdgpu.opencl = lib.mkEnableOption (lib.mdDoc - "rocm opencl runtime (Install rocmPackages.clr and rocmPackages.clr.icd)" - ) // { - default = true; - }; config = lib.mkMerge [ { @@ -24,11 +19,5 @@ (lib.mkIf config.hardware.amdgpu.loadInInitrd { boot.initrd.kernelModules = [ "amdgpu" ]; }) - (lib.mkIf config.hardware.amdgpu.opencl { - hardware.opengl.extraPackages = - if pkgs ? rocmPackages.clr - then with pkgs.rocmPackages; [ clr clr.icd ] - else with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ]; - }) ]; } diff --git a/lenovo/legion/15ach6h/nvidia/default.nix b/lenovo/legion/15ach6h/nvidia/default.nix index ad62415..33f3265 100644 --- a/lenovo/legion/15ach6h/nvidia/default.nix +++ b/lenovo/legion/15ach6h/nvidia/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; @@ -12,6 +12,8 @@ # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; } diff --git a/lenovo/legion/16ach6h/nvidia/default.nix b/lenovo/legion/16ach6h/nvidia/default.nix index ad62415..33f3265 100644 --- a/lenovo/legion/16ach6h/nvidia/default.nix +++ b/lenovo/legion/16ach6h/nvidia/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; @@ -12,6 +12,8 @@ # of nix cannot implement such an operation as canceling an import. hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; } diff --git a/lenovo/legion/16achg6/nvidia/default.nix b/lenovo/legion/16achg6/nvidia/default.nix index aa292cd..5c933fa 100644 --- a/lenovo/legion/16achg6/nvidia/default.nix +++ b/lenovo/legion/16achg6/nvidia/default.nix @@ -1,10 +1,12 @@ -{ ... }: +{ lib, options, ... }: { imports = [ ../hybrid ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware = { nvidia.prime.offload.enable = false; - amdgpu.opencl = false; + } // lib.optionalAttrs (options ? amdgpu.opencl.enable) { + # introduced in https://github.com/NixOS/nixpkgs/pull/319865 + amdgpu.opencl.enable = lib.mkDefault false; }; }