{"id":380,"date":"2022-09-11T10:07:25","date_gmt":"2022-09-11T10:07:25","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=380"},"modified":"2022-09-11T10:11:09","modified_gmt":"2022-09-11T10:11:09","slug":"week-9-report-for-refining-rocm-packages-in-gentoo","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2022\/09\/11\/week-9-report-for-refining-rocm-packages-in-gentoo\/","title":{"rendered":"Week 9 Report for Refining ROCm Packages in Gentoo"},"content":{"rendered":"<p>This week I mainly focused on <code>dev-libs\/rocm-opencl-runtime<\/code>.<\/p>\n<p>I bumped <code>dev-libs\/rocm-opencl-runtime<\/code> to 5.1.3. That&#8217;s relatively easy. The difficult part is enabling its tests. I came across a major problem, which is oclgl test requiring X server. I compiled using debug options and use gdb to dive into the code, but found there is no simple solution. Currently the test needs a X server where OpenGL vender is AMD. Xvfb only provides llvmpipe, not meeting the requirements. I consulted some friends, they said NVIDIA recommends using EGL when there is no X [1], but apparently ROCm can only get OpenGL from X [2]. So my workaround is to let user passing an X display into the ebuild, by reading the environment variable OCLGL_DISPLAY (DISPLAY variable will be wiped when calling emerge, while this can survive). If no display is detected, or glxinfo shows the OpenGL vendor is not AMD, then src_test dies, throwing indications about running an X server using amdgpu driver.<\/p>\n<p>I was also trapped by CRLF problem in src_test of <code>dev-libs\/rocm-opencl-runtime<\/code>. Tests in oclperf.exclude should be skipped for oclperf test, but it did not. After numerous trials, I finally found that this file is using CRLF, not LF, which causes the exclusion failed \ud83d\ude41<\/p>\n<p>Nevertheless, rocm-opencl-runtime tests passed on Radeon RX 6700XT! A good thing, because I know many user in Gentoo rely on this package to provide opencl in their computation, and the correctness is vital. Before we does not have src_test enabled. The PR is now in [6].<\/p>\n<p>Other works including starting wiki writing [3,4], refine rocm.eclass according to feedback (not much, see gentoo-dev mailing list), and found a bug of <code>dev-util\/hip<\/code> &#8212; <code>FindHIP.cmake<\/code> module is not in the correct place. Fix can be found in [5] but I need to further polish the patch before PR.<\/p>\n<p>If no further suggestions on rocm.eclass, I&#8217;ll land rocm.eclass in <code>::gentoo<\/code> next week, and start bumping the sci-libs version already done locally.<\/p>\n<p>[1] https:\/\/developer.nvidia.com\/blog\/egl-eye-opengl-visualization-without-x-server\/<br \/>\n[2] https:\/\/github.com\/RadeonOpenCompute\/ROCm-OpenCL-Runtime\/blob\/bbdc87e08b322d349f82bdd7575c8ce94d31d276\/tests\/ocltst\/module\/common\/OCLGLCommonLinux.cpp<br \/>\n[3] https:\/\/wiki.gentoo.org\/wiki\/ROCm<br \/>\n[4] https:\/\/wiki.gentoo.org\/wiki\/HIP<br \/>\n[5] https:\/\/github.com\/littlewu2508\/gentoo\/tree\/hip-correct-cmake<br \/>\n[6] https:\/\/github.com\/gentoo\/gentoo\/pull\/26870<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I mainly focused on dev-libs\/rocm-opencl-runtime. I bumped dev-libs\/rocm-opencl-runtime to 5.1.3. That&#8217;s relatively easy. The difficult part is enabling its tests. I came across a major problem, which is oclgl test requiring X server. I compiled using debug options &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2022\/09\/11\/week-9-report-for-refining-rocm-packages-in-gentoo\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":179,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/380"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/179"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=380"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"predecessor-version":[{"id":381,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/380\/revisions\/381"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}