From patchwork Fri Aug 6 07:11:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 31858 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8AADD27BC6B; Fri, 6 Aug 2021 08:12:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A440327BC78 for ; Fri, 6 Aug 2021 08:12:18 +0100 (BST) Received: from localhost ([::1]:32946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBu1h-000490-Kl for patchwork@mira.cbaines.net; Fri, 06 Aug 2021 03:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBu1T-00047s-P6 for guix-patches@gnu.org; Fri, 06 Aug 2021 03:12:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBu1S-0006np-E6 for guix-patches@gnu.org; Fri, 06 Aug 2021 03:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBu1S-0007su-9L for guix-patches@gnu.org; Fri, 06 Aug 2021 03:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49907] Acknowledgement ([PATCH 00/11] AMD ROCm OpenCL runtime) Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 Aug 2021 07:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49907 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49907@debbugs.gnu.org Received: via spool by 49907-submit@debbugs.gnu.org id=B49907.162823388730269 (code B ref 49907); Fri, 06 Aug 2021 07:12:02 +0000 Received: (at 49907) by debbugs.gnu.org; 6 Aug 2021 07:11:27 +0000 Received: from localhost ([127.0.0.1]:48975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBu0n-0007s3-Ja for submit@debbugs.gnu.org; Fri, 06 Aug 2021 03:11:27 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:20218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBu0k-0007rp-Ed for 49907@debbugs.gnu.org; Fri, 06 Aug 2021 03:11:20 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4GgxTr4FgnzQk9Z for <49907@debbugs.gnu.org>; Fri, 6 Aug 2021 09:11:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1628233870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zUAmL1/1nBOaqgguDa8ebHrhk9vQpvy2xminhEFcNkM=; b=LjIVoQsEBOHmzYCV7QFLNb9/UBxSZOYiVXOM+ExHcLAuGGwveXniefRpz6gIx+ZmxVbbC3 J4yz+lQYbvMlUcXdTLoiV8ux/pigGWqQXRvz/BoMX28y5Z5jzhGYP2Vhr5zWmQI9MiZqQc WytIX85cyIVlSM+dMQ7HbgG2dHm7wwBatklcFP23lEDZpAlTeXeaccS+KQA8iU/7bb8Xgt PBm+xmP9P2/DzrFEKtwmfhSDCyAxRUcT659dC9uROlFsIK73DP75u+jR5dwbMIuGIMAnMf EkkdPszlBA9oRtsovhL4p2lA5ZbFhWCvdeuMAkw/3R4c/Bbq03zRdF+hJp03Xg== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id cIYCIIoRerIR for <49907@debbugs.gnu.org>; Fri, 6 Aug 2021 09:11:07 +0200 (CEST) Date: Fri, 6 Aug 2021 09:11:06 +0200 From: Lars-Dominik Braun Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 3ABA9182F X-Rspamd-UID: da8d30 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Forgot to attach the actual patches, sorry. From 164a786fe3bc322bdba549c6f3b8b49e7435d0f1 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 6 Aug 2021 08:30:13 +0200 Subject: [PATCH 11/11] gnu: darktable: Add compatibility for ROCm. darktable has a few tools, which can use OpenCL, not just the main binary. Instead of wrapping it, patch the search path. ROCm also fails to build OpenCL kernels with just the inline keyword. Apply upstream fix. * gnu/packages/photo.scm (darktable) [#:phases]: Add new phases, remove LD_LIBRARY_PATH from wrap-binary. --- gnu/packages/photo.scm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm index 3ef0fbf7f5..bf51e6885f 100644 --- a/gnu/packages/photo.scm +++ b/gnu/packages/photo.scm @@ -486,6 +486,24 @@ photographic equipment.") "-DBUILD_TESTING=On") #:phases (modify-phases %standard-phases + (add-after 'unpack 'libOpenCL-path + (lambda* (#:key inputs #:allow-other-keys) + ;; Statically link to libOpenCL. + (substitute* "./src/common/dlopencl.c" + (("\"libOpenCL\"") + (string-append "\"" (assoc-ref inputs "ocl-icd") "/lib/libOpenCL.so\""))) + #t)) + ;; The use of inline is wrong and darktable cannot compile its kernels + ;; with ROCm. See upstream commit + ;; https://github.com/darktable-org/darktable/commit/f0d8710f5ef34eb7e33b4064e022ebf3057b9e53 + (add-after 'unpack 'opencl-inline + (lambda* (#:key inputs #:allow-other-keys) + ;; This is a feature of OpenCL 1.2 and later. + (substitute* "data/kernels/CMakeLists.txt" + (("CL1\\.1") "CL1.2")) + (substitute* (find-files "data/kernels" "\\.(cl|h)$") + (("inline") "static inline")) + #t)) (add-before 'configure 'prepare-build-environment (lambda* (#:key inputs #:allow-other-keys) ;; Rawspeed fails to build with GCC due to OpenMP error: @@ -516,11 +534,7 @@ photographic equipment.") ;; For GtkFileChooserDialog. `("GSETTINGS_SCHEMA_DIR" = (,(string-append (assoc-ref inputs "gtk+") - "/share/glib-2.0/schemas"))) - ;; For libOpenCL.so. - `("LD_LIBRARY_PATH" = - (,(string-append (assoc-ref inputs "ocl-icd") - "/lib")))) + "/share/glib-2.0/schemas")))) #t))))) (native-inputs `(("clang" ,clang-11) -- 2.31.1