• [gentoo-dev] [PATCH 0/2] rocm.eclass for ROCm packages written in HIP

    From Yiyang Wu@21:1/5 to All on Mon Aug 8 16:20:01 2022
    This eclass provides utilities for ROCm libraries in https://github.com/ROCmSoftwarePlatform, e.g. rocBLAS, rocFFT.
    It contains a USE_EXPAND, amdgpu_targets_*, which handles the GPU
    architecture to compile, and keep targets coherent among dependencies.
    Packages that depend on ROCm libraries, like cupy, can also make use of
    this eclass, mainly specify GPU architecture and it's corresponding dependencies via USE_EXPAND.

    This is the core delivery in GSoC 2022 project "Refining ROCm Packages
    in Gentoo"

    Yiyang Wu (2):
    rocm.eclass: new eclass
    profiles/desc: add amdgpu_targets.desc for USE_EXPAND

    eclass/rocm.eclass | 278 ++++++++++++++++++++++++++++++
    profiles/base/make.defaults | 2 +-
    profiles/desc/amdgpu_targets.desc | 15 ++
    3 files changed, 294 insertions(+), 1 deletion(-)
    create mode 100644 eclass/rocm.eclass
    create mode 100644 profiles/desc/amdgpu_targets.desc

    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From wuyy@21:1/5 to Yiyang Wu on Mon Aug 8 17:10:01 2022
    On Mon, Aug 08, 2022 at 10:15:25PM +0800, Yiyang Wu wrote:
    This eclass provides utilities for ROCm libraries in https://github.com/ROCmSoftwarePlatform, e.g. rocBLAS, rocFFT.
    It contains a USE_EXPAND, amdgpu_targets_*, which handles the GPU architecture to compile, and keep targets coherent among dependencies. Packages that depend on ROCm libraries, like cupy, can also make use of
    this eclass, mainly specify GPU architecture and it's corresponding dependencies via USE_EXPAND.

    This is the core delivery in GSoC 2022 project "Refining ROCm Packages
    in Gentoo"

    Yiyang Wu (2):
    rocm.eclass: new eclass
    profiles/desc: add amdgpu_targets.desc for USE_EXPAND

    eclass/rocm.eclass | 278 ++++++++++++++++++++++++++++++
    profiles/base/make.defaults | 2 +-
    profiles/desc/amdgpu_targets.desc | 15 ++
    3 files changed, 294 insertions(+), 1 deletion(-)
    create mode 100644 eclass/rocm.eclass
    create mode 100644 profiles/desc/amdgpu_targets.desc

    --
    2.34.1

    I have created a PR of this patch at https://github.com/gentoo/gentoo/pull/26784.
    --
    Yiyang Wu

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Yiyang Wu@21:1/5 to All on Mon Aug 8 16:20:01 2022
    Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
    ---
    profiles/desc/amdgpu_targets.desc | 15 +++++++++++++++
    1 file changed, 15 insertions(+)
    create mode 100644 profiles/desc/amdgpu_targets.desc

    diff --git a/profiles/desc/amdgpu_targets.desc b/profiles/desc/amdgpu_targets.desc
    new file mode 100644
    index 000000000000..942ab51356fb
    --- /dev/null
    +++ b/profiles/desc/amdgpu_targets.desc
    @@ -0,0 +1,15 @@
    +# Copyright 1999-2022 Gentoo Authors.
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# Copied from https://www.coelacanth-dream.com/posts/2019/12/30/did-rid-product-matome-p2/#fn:67
    +
    +gfx803 - Fiji GPU, codename fiji, including Radeon R9 Nano/Fury/FuryX, Radeon Pro Duo, FirePro S9300x2, Radeon Instinct MI8
    +gfx900 - Vega GPU, codename vega10, including Radeon Vega Frontier Edition, Radeon RX Vega 56/64, Radeon RX Vega 64 Liquid, Radeon Pro Vega 48/56/64/64X, Radeon Pro WX 8200/9100, Radeon Pro V320/V340/SSG, Radeon Instinct MI25
    +gfx906 - Vega GPU, codename vega20, including Radeon (Pro) VII, Radeon Instinct MI50/MI
  • From Yiyang Wu@21:1/5 to All on Mon Aug 8 16:20:01 2022
    Closes: https://bugs.gentoo.org/810619
    Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com>
    ---
    eclass/rocm.eclass | 278 ++++++++++++++++++++++++++++++++++++
    profiles/base/make.defaults | 2 +-
    2 files changed, 279 insertions(+), 1 deletion(-)
    create mode 100644 eclass/rocm.eclass

    diff --git a/eclass/rocm.eclass b/eclass/rocm.eclass
    new file mode 100644
    index 000000000000..e4b448f7b894
    --- /dev/null
    +++ b/eclass/rocm.eclass
    @@ -0,0 +1,278 @@
    +# Copyright 2022 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: rocm.eclass
    +# @MAINTAINER:
    +# Gentoo Science Project <sci@gentoo.org>
    +# @AUTHOR:
    +# Yiyang Wu <xgreenlandforwyy@gmail.com>
    +# @SUPPORTED_EAPIS: 7 8
    +# @BLURB: Common functions and variables for ROCm packages written in HIP
    +# @DESCRIPTION:
    +# ROCm packages such as sci-libs/<roc|hip>* can utilize functions in this eclass.
    +# Currently, it handles the AMDGPU_TARGETS variable via USE_EXPAND, so user can
    +# use USE flag to control which GPU architecture to compile, and ensure coherence
    +# among dependencies. It
  • From Ulrich Mueller@21:1/5 to All on Mon Aug 8 17:50:01 2022
    On Mon, 08 Aug 2022, Yiyang Wu wrote:
    +case ${EAPI} in
    + 0|1|2|3|4|5|6)
    + die "${ECLASS}: unsupported EAPI=${EAPI:-0} (too old)"
    + ;;
    + 7|8)
    + ;;
    + *)
    + die "${ECLASS}: unsupported EAPI=${EAPI} (unknown)"
    + ;;
    +esac

    We no longer distinguished between too old and unknown. Modern style
    is like this:

    case ${EAPI} in
    7|8) ;;
    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    esac

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmLxLlUPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u8dEIAMwmzObnOf6HM88+8olhhvEHDErcgiu4oiyP 2OTLSwoX41NvevfyzAacIhR1oIzRoEaRotA4m4O89DbbCujbUxnCVmw2WY/u1sdH rY2O5/HBpdTsqgjS6xP6nrcWtfQhH3qsp8LWiOmUQuvCKuZJeKYJh7eVeIx/UaYD ucRvJeTs4Vjc9u+ttBl8vMm/A23TxVhYgasrHMFeNHez7GwTSK3S22oXeE6/yXmN MOFbyrEt+2K3QOywBzgFza4sJX0mHzq1X71v2YoE4KxlBGFJlpptDfiKMFu9Kf+B GW601aUN9Vh7LycJoToww+F+OqumnPZnXH3Y7cumFfSHIGTdEso=
    =h/CQ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Benda Xu@21:1/5 to Yiyang Wu on Mon Aug 8 18:40:01 2022
    Yiyang Wu <xgreenlandforwyy@gmail.com> writes:

    +gfx1010 - RDNA GPU, codename navi10, including Radeon RX 5700XT/5700/5700M/5700B/5700XTB/5600XT/5600/5600M, Radeon Pro 5700Xt/5700, Radeon Pro W5700X/W5700

    s/5700Xt/5700XT/

    Benda

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)