From: Yiyang Wu <xgreenlandforwyy@gmail.com>
To: gentoo-dev@lists.gentoo.org
Cc: Benda Xu <heroxbd@gentoo.org>
Subject: [gentoo-dev] [PATCH v7 0/2] rocm.eclass: new eclass
Date: Mon, 5 Sep 2022 21:31:15 +0800 [thread overview]
Message-ID: <cover.1662383384.git.xgreenlandforwyy@gmail.com> (raw)
Comparing to v6, rocn.eclass refactorized a lot in v7, thanks to
MichaĆ's critical comments on
https://github.com/gentoo/gentoo/pull/26784.
Now the eclass code base is much cleaner, mostly because specific codes
in phase functions are removed.
Changelog against v6:
1. Remove phase functions rocm_src_configure and rocm_src_test. The code
duplication among ROCm ebuilds are not so large that a common phase
function is necessary. Writing a all-in-one phase function would cause
the eclass hard to maintain.
2. check_rw_permission -> check_amdgpu. Limit the function to check
amdgpu device, and move `addwrite /dev/kfd` from rocm_src_test into it.
So ebuilds can simply call check_amdgpu in src_test and do the reset of
testing.
3. Standardize and simplify codes including bash array handling.
4. ROCM_VERSION is required for all packages, not assumed to be ${PV}.
5. Reshaped the examples according to the changes.
6. Update reference of AMDGPU device map, pointing to codes in an
official repo rather than a summarize hosted on a third-party web page.
I would also like to ask a question. In check_amdgpu, if GPU access
denied, the eclass suggest the user to check whether the portage user is
in render group or not. I would like to print the username, so I tried
use ${USER} but it is not set during src_test. Previously, I used
${PORTAGE_USERNAME} but its a potage internal variable. Is there an
approach to print the portage username? Would $(whoami) suitable for
this job?
Yiyang Wu (2):
rocm.eclass: new eclass
profiles/desc: add amdgpu_targets.desc for USE_EXPAND
eclass/rocm.eclass | 223 ++++++++++++++++++++++++++++++
profiles/base/make.defaults | 2 +-
profiles/desc/amdgpu_targets.desc | 17 +++
3 files changed, 241 insertions(+), 1 deletion(-)
create mode 100644 eclass/rocm.eclass
create mode 100644 profiles/desc/amdgpu_targets.desc
--
2.34.1
next reply other threads:[~2022-09-05 13:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-05 13:31 Yiyang Wu [this message]
2022-09-05 13:31 ` [gentoo-dev] [PATCH v7 1/2] rocm.eclass: new eclass Yiyang Wu
2022-09-05 13:31 ` [gentoo-dev] [PATCH v7 2/2] profiles/desc: add amdgpu_targets.desc for USE_EXPAND Yiyang Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1662383384.git.xgreenlandforwyy@gmail.com \
--to=xgreenlandforwyy@gmail.com \
--cc=gentoo-dev@lists.gentoo.org \
--cc=heroxbd@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox