Gentoo Archives: gentoo-soc

From: wuyy <xgreenlandforwyy@×××××.com>
To: gentoo-soc <gentoo-soc@l.g.o>
Subject: [gentoo-soc] Week 9 Report for Refining ROCm Packages in Gentoo
Date: Mon, 15 Aug 2022 15:32:34
Message-Id: YvpnDMPGuI8NZtwB@HEPwuyy
1 Hello all,
2
3 This week I mainly focused on dev-libs/rocm-opencl-runtime.
4
5 I bumped dev-libs/rocm-opencl-runtime to 5.1.3. That's relatively easy.
6 The difficult part is enabling its tests. I came across a major problem,
7 which is oclgl test requiring X server. I compiled using debug options
8 and use gdb to dive into the code, but found there is no simple
9 solution. Currently the test needs a X server where OpenGL vender is
10 AMD. Xvfb only provides llvmpipe, not meeting the requirements. I
11 consulted some friends, they said NVIDIA recommends using EGL when there
12 is no X [1], but apparently ROCm can only get OpenGL from X [2]. So my
13 workaround is to let user passing an X display into the ebuild, by
14 reading the environment variable OCLGL_DISPLAY (DISPLAY variable will be
15 wiped when calling emerge, while this can survive). If no display is
16 detected, or glxinfo shows the OpenGL vendor is not AMD, then src_test
17 dies, throwing indications about running an X server using amdgpu
18 driver.
19
20 I was also trapped by CRLF problem in src_test of
21 dev-libs/rocm-opencl-runtime. Tests in oclperf.exclude should be skipped
22 for oclperf test, but it did not. After numerous trials, I finally found
23 that this file is using CRLF, not LF, which causes the exclusion failed
24 :-(
25
26 Nevertheless, rocm-opencl-runtime tests passed on Radeon RX 6700XT! A
27 good thing, because I know many user in Gentoo rely on this package to
28 provide opencl in their computation, and the correctness is vital.
29 Before we does not have src_test enabled. The PR is now in [6].
30
31 Other works including starting wiki writing [3,4], refine rocm.eclass
32 according to feedback (not much, see gentoo-dev mailing list), and found
33 a bug of dev-util/hip -- FindHIP.cmake module is not in the correct
34 place. Fix can be found in [5] but I need to further polish the patch
35 before PR.
36
37 If no further suggestions on rocm.eclass, I'll land rocm.eclass in
38 ::gentoo next week, and start bumping the sci-libs version already done
39 locally.
40
41 [1] https://developer.nvidia.com/blog/egl-eye-opengl-visualization-without-x-server/
42 [2] https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/blob/bbdc87e08b322d349f82bdd7575c8ce94d31d276/tests/ocltst/module/common/OCLGLCommonLinux.cpp
43 [3] https://wiki.gentoo.org/wiki/ROCm
44 [4] https://wiki.gentoo.org/wiki/HIP
45 [5] https://github.com/littlewu2508/gentoo/tree/hip-correct-cmake
46 [6] https://github.com/gentoo/gentoo/pull/26870
47
48 Best wishes,
49 --
50 Yiyang Wu