From 13beb432fb21fb5bea38ac374df0fbace92eec76 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Tue, 21 Jul 2020 16:58:30 +0200 Subject: [PATCH 1/3] amdvlk: Add i686-linux platform --- pkgs/development/libraries/amdvlk/default.nix | 25 ++++++++++++++----- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/amdvlk/default.nix b/pkgs/development/libraries/amdvlk/default.nix index 73983dba050..2480a2707f9 100644 --- a/pkgs/development/libraries/amdvlk/default.nix +++ b/pkgs/development/libraries/amdvlk/default.nix @@ -15,8 +15,11 @@ , xorg , zlib }: +let -stdenv.mkDerivation rec { + suffix = if stdenv.system == "x86_64-linux" then "64" else "32"; + +in stdenv.mkDerivation rec { pname = "amdvlk"; version = "2020.Q3.4"; @@ -62,14 +65,24 @@ stdenv.mkDerivation rec { cmakeDir = "../drivers/xgl"; + # LTO is disabled in gcc for i686 as of #66528 + cmakeFlags = stdenv.lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"]; + + postPatch = stdenv.lib.optionalString stdenv.is32bit '' + substituteInPlace drivers/pal/cmake/PalCompilerOptions.cmake \ + --replace "pal_setup_gcc_ipo()" "" + ''; + installPhase = '' - install -Dm755 -t $out/lib icd/amdvlk64.so - install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd64.json + install -Dm755 -t $out/lib icd/amdvlk${suffix}.so + install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd${suffix}.json - substituteInPlace $out/share/vulkan/icd.d/amd_icd64.json --replace \ + substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \ "/usr/lib64" "$out/lib" + substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace \ + "/usr/lib" "$out/lib" - patchelf --set-rpath "$rpath" $out/lib/amdvlk64.so + patchelf --set-rpath "$rpath" $out/lib/amdvlk${suffix}.so ''; # Keep the rpath, otherwise vulkaninfo and vkcube segfault @@ -80,7 +93,7 @@ stdenv.mkDerivation rec { homepage = "https://github.com/GPUOpen-Drivers/AMDVLK"; changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${version}"; license = licenses.mit; - platforms = [ "x86_64-linux" ]; + platforms = [ "x86_64-linux" "i686-linux" ]; maintainers = with maintainers; [ danieldk Flakebi ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c9179f5c5d..1b91dfd4553 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12159,6 +12159,7 @@ in # Multi-arch "drivers" which we want to build for i686. driversi686Linux = recurseIntoAttrs { inherit (pkgsi686Linux) + amdvlk mesa vaapiIntel libvdpau-va-gl From 0dca8d5b1eec611a6e2b770725eb841aa023c1b2 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Fri, 28 Aug 2020 09:47:50 +0200 Subject: [PATCH 2/3] nixos/manual: add 32-bit amdvlk usage --- nixos/doc/manual/configuration/gpu-accel.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/configuration/gpu-accel.xml b/nixos/doc/manual/configuration/gpu-accel.xml index 251e5c26ba4..95ee13f4796 100644 --- a/nixos/doc/manual/configuration/gpu-accel.xml +++ b/nixos/doc/manual/configuration/gpu-accel.xml @@ -183,7 +183,12 @@ GPU1: be forced as follows: = [ - amdvlk + pkgs.amdvlk +]; + +# To enable Vulkan support for 32-bit applications, also add: + = [ + pkgs.driversi686Linux.amdvlk ]; # For amdvlk From 50733da4b0f1187d65111449d80dea241abf7985 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Mon, 14 Sep 2020 13:36:37 +0200 Subject: [PATCH 3/3] amdvlk: 2020.Q3.4 -> 2020.Q3.5 --- pkgs/development/libraries/amdvlk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/amdvlk/default.nix b/pkgs/development/libraries/amdvlk/default.nix index 2480a2707f9..1f75892b9ac 100644 --- a/pkgs/development/libraries/amdvlk/default.nix +++ b/pkgs/development/libraries/amdvlk/default.nix @@ -21,13 +21,13 @@ let in stdenv.mkDerivation rec { pname = "amdvlk"; - version = "2020.Q3.4"; + version = "2020.Q3.5"; src = fetchRepoProject { name = "${pname}-src"; manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git"; rev = "refs/tags/v-${version}"; - sha256 = "13yy1v43wyw2dbanl39sk1798344smmycgvl3gla61ipqls0qfgd"; + sha256 = "08fj3cg3axnwadlpfim23g5nyjl69044fqxdr57af6y79441njay"; }; buildInputs = [