From 437fa8d107c1976f9e537d2999c452e007e96072 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Mon, 8 Nov 2021 17:29:29 -0800 Subject: [PATCH] ocl-icd: fix ICD vendor path for NixOS This fixes the vendor ICD load path to work with NixOS's opengl path. Previously, the only workaround to load ICD files was to manually override the load path at runtime using an environment variable. Tested against Intel and Nvidia drivers using the clinfo package: Before: ``` $ clinfo Number of platforms 0 ``` After: ``` $ clinfo Number of platforms 1 Platform Name NVIDIA CUDA Platform Vendor NVIDIA Corporation <...> ``` --- pkgs/development/libraries/ocl-icd/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/ocl-icd/default.nix b/pkgs/development/libraries/ocl-icd/default.nix index 7dbcecab0c86..ea8e1841b0c1 100644 --- a/pkgs/development/libraries/ocl-icd/default.nix +++ b/pkgs/development/libraries/ocl-icd/default.nix @@ -25,10 +25,15 @@ stdenv.mkDerivation rec { buildInputs = [ opencl-headers ]; + configureFlags = [ + "--enable-custom-vendordir=/run/opengl-driver/etc/OpenCL/vendors" + ]; + meta = with lib; { description = "OpenCL ICD Loader for ${opencl-headers.name}"; homepage = "https://github.com/OCL-dev/ocl-icd"; license = licenses.bsd2; platforms = platforms.unix; + maintainers = with maintainers; [ r-burns ]; }; }