Radeon Open Ecosystem (ROCm) on Gentoo Platform

 
ROCm on Gentoo
 
2021 TUNA OSPP Project: 
完善
 Gentoo ROCm GPGPU 
框架
学生:武益阳
导师:续本达
 
+
+
 
W
h
a
t
 
i
s
 
R
a
d
e
o
n
 
O
p
e
n
 
E
c
o
s
y
s
t
e
m
 
(
R
O
C
m
)
?
 
1.
Open -- open source
2.
Ecosystem -- a bench of software and frame works
3.
Radeon -- high performance computing on Radeon GPUs
 
AMD’s 
cuda
ecosystem. Very similar to cuda for end users, since most of its API
mimiate cuda’s for smooth porting, which means softwares written in cuda can be easily
transfered to hip (Heterogenous compute Interface for Portability), and compiled to GPU
kernels that runs on AMD GPU.
 
A
h
 
h
a
,
 
n
o
 
p
a
i
n
 
t
o
 
p
o
r
t
 
m
y
 
c
u
d
a
 
c
o
d
e
 
o
n
 
A
M
D
s
 
G
P
U
!
 
R
O
C
m
 
Y
E
S
,
 
O
p
e
n
C
L
 
N
o
!
 
But how many dark magic are hidden behind for this compability?
 
D
e
p
l
o
y
i
n
g
 
R
O
C
m
 
ROCm is so nice. Let’s install!
https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-
Guide.html : we 
only 
support
 ubuntu, RHEL
 series 
officially
; we need 
dkms
for AMDGPU which only works on certein versions of Linux kernel. rpm
and deb packages provided, all install files in 
/opt/rocm
. Want some
customize? No root privilage? Want to try some new cards we don’t
support? We are all open-sourced, so GO COMPILE IT YOURSELF!
 
W
h
y
 
R
O
C
m
 
o
n
 
G
e
n
t
o
o
 
Its time to use Gentoo
1.
All packages are compiled, can be custmized to fit for your device.
2.
Installation location follow the Gentoo FHS (filesystem hierarchy
standard).
3.
Compatible with Gentoo Prefix, which means you can port it anywhere
without root privilages.
4.
Compatible with the newest Gentoo portage tree. Use the newest
packages from Gentoo, as well as ROCm.
5.
Don’t need dkms.
 
A
 
c
l
o
s
e
r
 
l
o
o
k
 
a
t
 
R
O
C
m
 
b
a
s
e
 
s
y
s
t
e
m
 
O
u
r
 
g
o
a
l
 
Pytorch
 
Gentoo (Prefix)
 
W
h
a
t
 
h
a
s
 
b
e
e
n
 
d
o
n
e
 
 
 
 
Pytorch
 
r
e
a
d
y
 
P
R
 
r
e
a
d
y
 
H
o
w
 
t
o
 
t
r
y
 
H
I
P
 
Complilation 
prerequisite: Gentoo or Gentoo Prefix, amd64 machine.
Runtime prerequisite : 
Linux kernel >= 5.13
, or rock-dkms for AMDGPU 
kfd
driver; 
Radeon GPU
. Gentoo or Gentoo prefix. rw access to 
/dev/kfd
Using the latest portage tree, accept 
~amd64
 keyword.
to install hip complier:
 
emerge dev-util/hip
Runtime dependencies will also be installed.
Then you can compile hip program with hipcc (just like nvcc)
 
hipcc <source> -o <exe>
 (auto detect GPU arch)
 
hipcc --offload-arch=<specific gpu arch> 
<source> -o
<exe>
Transfer cuda code to hip code:
 
hipify-perl source.cu > souce.hip
 
G
P
U
 
a
r
c
h
i
t
e
c
t
u
r
e
 
https://llvm.org/docs/AMDGPUUsage.html#processors
Supported archs for HIP:
gfx70[0-5] -- Sea Islands
gfx80[1-35], gfx810 -- Volcanic Islands
gfx90[024689a] -- Vega, CDNA1
gfx101[0-2] -- RDNA1
gfx103[0-2] -- RDNA2
 
Target feature for
xnack for gfx9** and RDNA1 cards
sramecc for 
gfx906, gfx908, gfx90a
 
Auto detect GPU arch
:
 
emerge rocminfo
 
rocminfo | sed -n "s/.*amdgcn-amd-amdhsa--\(.*\)/\1/p"
 
H
o
w
 
t
o
 
t
r
y
 
m
a
t
h
 
l
i
b
r
a
r
i
e
s
 
Specify GPU architectures you want to compile to AMDGPU_TARGETS.
 
echo 
“AMDGPU_TARGETS=gfx906:xnack-;gfx908:xnack-;gfx1030” >>
/etc/portage/make.conf
Install math libs:
 
emerge =sci-libs/rocBLAS-4.3.0
 
emerge =sci-libs/
rocSPARSE
-4.3.0
 
emerge =sci-libs/
rocPRIM
-4.3.0
 
emerge =sci-libs/
rocSOLVER
-4.3.0
 
roc
FFT
-4.3, roc
RAND
-4.3, roc
Thrust
-4.3, hip
SPARSE
-4.3, hipCUB-4.3, hipFFT-
4.3 are in 
PR
, and will be 
ready soon
. You can find their ebuild in
https://github.com/littlewu2508/gentoo/tree/rocm4.3
 
H
o
w
 
t
o
 
i
n
s
t
a
l
l
 
m
a
c
h
i
n
e
 
l
e
a
r
n
i
n
g
 
f
r
a
m
e
w
o
r
k
s
 
MIOpen-4.3 is in 
https://github.com/littlewu2508/gentoo/tree/rocm4.3
 
Switch portage tree to this branch;
 
emerge =sci-libs/miopen-4.3.0
 
pytorch-1.9.1 is in
 https://github.com/littlewu2508/sci/tree/pytorch-1.9.1-rocm
 
Add science overlay and switch 
to 
this branch;
 
emerge =sci-libs/
pytorch-1.9.1
 
M
o
r
e
 
t
o
 
e
x
p
l
o
r
e
 
Testing and benchmarking devices
 
Trying new cards (RX 6700XT works for me after some hacks: sed ‘s/gfx1030/gfx1031/g’)
 
Building more ROCm based packages
 
T
h
a
n
k
s
 
f
o
r
 
l
i
s
t
e
n
i
n
g
!
Slide Note
Embed
Share

Delve into the detailed guide for deploying Radeon Open Ecosystem (ROCm) on Gentoo, a versatile platform offering high-performance computing on Radeon GPUs. Discover the seamless integration, benefits of customization, and the compatibility with Gentoo Prefix for portability without root privileges. Experience ROCm's efficient deployment, open-source flexibility, and compatibility with the latest Gentoo packages.

  • Radeon Open Ecosystem
  • ROCm
  • Gentoo Platform
  • High-Performance Computing
  • GPU

Uploaded on Aug 05, 2024 | 4 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. + ROCm on Gentoo 2021 TUNA OSPP Project: Gentoo ROCm GPGPU

  2. What is Radeon Open Ecosystem (ROCm)? What is Radeon Open Ecosystem (ROCm)? 1. 2. 3. Open -- open source Ecosystem -- a bench of software and frame works Radeon -- high performance computing on Radeon GPUs AMD s cuda ecosystem. Very similar to cuda for end users, since most of its API mimiate cuda s for smooth porting, which means softwares written in cuda can be easily transfered to hip (Heterogenous compute Interface for Portability), and compiled to GPU kernels that runs on AMD GPU. Ah ha, no pain to port my cuda code on AMD s GPU! ROCm YES, OpenCL No! But how many dark magic are hidden behind for this compability?

  3. Deploying ROCm Deploying ROCm ROCm is so nice. Let s install! https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation- Guide.html : we only support ubuntu, RHEL series officially; we need dkms for AMDGPU which only works on certein versions of Linux kernel. rpm and deb packages provided, all install files in /opt/rocm. Want some customize? No root privilage? Want to try some new cards we don t support? We are all open-sourced, so GO COMPILE IT YOURSELF!

  4. Why ROCm on Gentoo Why ROCm on Gentoo Its time to use Gentoo 1. All packages are compiled, can be custmized to fit for your device. 2. Installation location follow the Gentoo FHS (filesystem hierarchy standard). 3. Compatible with Gentoo Prefix, which means you can port it anywhere without root privilages. 4. Compatible with the newest Gentoo portage tree. Use the newest packages from Gentoo, as well as ROCm. 5. Don t need dkms.

  5. A closer look at ROCm base system A closer look at ROCm base system

  6. Our goal Our goal Gentoo (Prefix) Pytorch

  7. What has been done What has been done Pytorch ready PR ready

  8. How to try HIP How to try HIP Complilation prerequisite: Gentoo or Gentoo Prefix, amd64 machine. Runtime prerequisite : Linux kernel >= 5.13, or rock-dkms for AMDGPU kfd driver; Radeon GPU. Gentoo or Gentoo prefix. rw access to /dev/kfd Using the latest portage tree, accept ~amd64 keyword. to install hip complier: emerge dev-util/hip Runtime dependencies will also be installed. Then you can compile hip program with hipcc (just like nvcc) hipcc <source> -o <exe> (auto detect GPU arch) hipcc --offload-arch=<specific gpu arch> <source> -o <exe> Transfer cuda code to hip code: hipify perl source.cu > souce.hip

  9. GPU GPU architecture architecture https://llvm.org/docs/AMDGPUUsage.html#processors Supported archs for HIP: gfx70[0-5] -- Sea Islands gfx80[1-35], gfx810 -- Volcanic Islands gfx90[024689a] -- Vega, CDNA1 gfx101[0-2] -- RDNA1 gfx103[0-2] -- RDNA2 Target feature for xnack for gfx9** and RDNA1 cards sramecc for gfx906, gfx908, gfx90a Auto detect GPU arch: emerge rocminfo rocminfo | sed -n "s/.*amdgcn-amd-amdhsa--\(.*\)/\1/p"

  10. How to try How to try m math ath l libraries ibraries Specify GPU architectures you want to compile to AMDGPU_TARGETS. echo AMDGPU_TARGETS=gfx906:xnack-;gfx908:xnack-;gfx1030 >> /etc/portage/make.conf Install math libs: emerge =sci-libs/rocBLAS-4.3.0 emerge =sci-libs/rocSPARSE-4.3.0 emerge =sci-libs/rocPRIM-4.3.0 emerge =sci-libs/rocSOLVER-4.3.0 rocFFT-4.3, rocRAND-4.3, rocThrust-4.3, hipSPARSE-4.3, hipCUB-4.3, hipFFT- 4.3 are in PR, and will be ready soon. You can find their ebuild in https://github.com/littlewu2508/gentoo/tree/rocm4.3

  11. How to install machine learning frameworks How to install machine learning frameworks MIOpen-4.3 is in https://github.com/littlewu2508/gentoo/tree/rocm4.3 Switch portage tree to this branch; emerge =sci-libs/miopen-4.3.0 pytorch-1.9.1 is in https://github.com/littlewu2508/sci/tree/pytorch-1.9.1-rocm Add science overlay and switch to this branch; emerge =sci-libs/pytorch-1.9.1

  12. More to explore More to explore Testing and benchmarking devices Trying new cards (RX 6700XT works for me after some hacks: sed s/gfx1030/gfx1031/g ) Building more ROCm based packages

  13. Thanks for listening! Thanks for listening!

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#