Gentoo Archives: gentoo-dev

From: Yiyang Wu <xgreenlandforwyy@×××××.com>
To: gentoo-dev@l.g.o
Cc: Benda Xu <heroxbd@g.o>
Subject: [gentoo-dev] [PATCH v7 0/2] rocm.eclass: new eclass
Date: Mon, 05 Sep 2022 13:31:26
Message-Id: cover.1662383384.git.xgreenlandforwyy@gmail.com
1 Comparing to v6, rocn.eclass refactorized a lot in v7, thanks to
2 Michał's critical comments on
3 https://github.com/gentoo/gentoo/pull/26784.
4
5 Now the eclass code base is much cleaner, mostly because specific codes
6 in phase functions are removed.
7
8 Changelog against v6:
9
10 1. Remove phase functions rocm_src_configure and rocm_src_test. The code
11 duplication among ROCm ebuilds are not so large that a common phase
12 function is necessary. Writing a all-in-one phase function would cause
13 the eclass hard to maintain.
14
15 2. check_rw_permission -> check_amdgpu. Limit the function to check
16 amdgpu device, and move `addwrite /dev/kfd` from rocm_src_test into it.
17 So ebuilds can simply call check_amdgpu in src_test and do the reset of
18 testing.
19
20 3. Standardize and simplify codes including bash array handling.
21
22 4. ROCM_VERSION is required for all packages, not assumed to be ${PV}.
23
24 5. Reshaped the examples according to the changes.
25
26 6. Update reference of AMDGPU device map, pointing to codes in an
27 official repo rather than a summarize hosted on a third-party web page.
28
29 I would also like to ask a question. In check_amdgpu, if GPU access
30 denied, the eclass suggest the user to check whether the portage user is
31 in render group or not. I would like to print the username, so I tried
32 use ${USER} but it is not set during src_test. Previously, I used
33 ${PORTAGE_USERNAME} but its a potage internal variable. Is there an
34 approach to print the portage username? Would $(whoami) suitable for
35 this job?
36
37 Yiyang Wu (2):
38 rocm.eclass: new eclass
39 profiles/desc: add amdgpu_targets.desc for USE_EXPAND
40
41 eclass/rocm.eclass | 223 ++++++++++++++++++++++++++++++
42 profiles/base/make.defaults | 2 +-
43 profiles/desc/amdgpu_targets.desc | 17 +++
44 3 files changed, 241 insertions(+), 1 deletion(-)
45 create mode 100644 eclass/rocm.eclass
46 create mode 100644 profiles/desc/amdgpu_targets.desc
47
48 --
49 2.34.1

Replies

Subject Author
[gentoo-dev] [PATCH v7 1/2] rocm.eclass: new eclass Yiyang Wu <xgreenlandforwyy@×××××.com>
[gentoo-dev] [PATCH v7 2/2] profiles/desc: add amdgpu_targets.desc for USE_EXPAND Yiyang Wu <xgreenlandforwyy@×××××.com>