From cc8a55802d2b7fd7a73a46857dd72152be2380d5 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Wed, 4 May 2022 15:50:16 +0200 Subject: [PATCH] rocclr: Re-enable support for gfx8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch has been floating around for a while and I think it’s applied for some distributions. I tested OpenCL on gfx8 and gfx10 and it's both working with this patch. --- pkgs/development/libraries/rocclr/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/libraries/rocclr/default.nix b/pkgs/development/libraries/rocclr/default.nix index fb847b83fe9..8afb0d04418 100644 --- a/pkgs/development/libraries/rocclr/default.nix +++ b/pkgs/development/libraries/rocclr/default.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchFromGitHub +, fetchpatch , writeScript , rocm-comgr }: @@ -15,6 +16,16 @@ stdenv.mkDerivation rec { hash = "sha256-SFWEGKffhuiTE7ICbkElVV5cldXu4Xbwvjb6LiNmijA="; }; + patches = [ + # Enable support for gfx8 again + # See the upstream issue: https://github.com/RadeonOpenCompute/ROCm/issues/1659 + # And the arch patch: https://github.com/rocm-arch/rocm-arch/pull/742 + (fetchpatch { + url = "https://raw.githubusercontent.com/John-Gee/rocm-arch/d6812d308fee3caf2b6bb01b4d19fe03a6a0e3bd/rocm-opencl-runtime/enable-gfx800.patch"; + hash = "sha256-59jFDIIsTTZcNns9RyMVWPRUggn/bSlAGrky4quu8B4="; + }) + ]; + prePatch = '' substituteInPlace device/comgrctx.cpp \ --replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"