Add rocmtools support

This commit adds integration with ROCmTools

Additional changes:
- Fix DEB and RPM installation issue when systemd is not present
- Fix typos in rdc.h
- Wrap negative values in parentheses in rdc.h
- CMAKE: Improve rocm_smi searching
- README: Improve formatting, add info about ROCmTools

Metrics added: 700-714
Metrics can be listed with `rdci dmon --list-all`
Majority of the metrics are only supported by Instict (MI) series GPUs
700 RDC_FI_PROF_ELAPSED_CYCLES should be available on most devices
See README for more information

Change-Id: I907d3eacdc92fc5588ca6c76c2fa1ce0ad900770
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/rdc commit: 861a843ed7]
이 커밋은 다음에 포함됨:
Galantsev, Dmitrii
2022-12-13 14:37:59 -06:00
부모 001461e975
커밋 eccb4e202c
26개의 변경된 파일1061개의 추가작업 그리고 107개의 파일을 삭제
+22 -4
파일 보기
@@ -1,9 +1,18 @@
#!/bin/bash
set -e
# This will return 0 if an id is created and non-zero if
# it already exists
# https://www.debian.org/doc/debian-policy/ch-opersys.html#users-and-groups
do_create_rdc_user() {
useradd -r -s /bin/nologin rdc
adduser \
--system \
--quiet \
--home /nonexistent \
--no-create-home \
--disabled-password \
rdc
if [ $(getent group render) ]; then
usermod -a -G render rdc
else
@@ -13,16 +22,25 @@ do_create_rdc_user() {
return 0
}
create_rdc_service() {
#Symlink RDC Service
if [ -d /run/systemd/system ]; then
ln -s -f -r /@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service /lib/systemd/system/rdc.service
fi
}
reload_systemd() {
systemctl daemon-reload
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
case "$1" in
configure)
do_create_rdc_user
#Symlink RDC Service
ln -s -f -r /@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service /lib/systemd/system/rdc.service
create_rdc_service
reload_systemd
exit 0
;;
+15 -4
파일 보기
@@ -3,13 +3,24 @@
set -e
stop_rdc() {
#stop RDC if running
systemctl stop rdc
if [ -d /run/systemd/system ]; then
#stop RDC if running
systemctl stop rdc
fi
return 0
}
rm_rdc_service() {
if [ -e /run/systemd/system ]; then
unlink /lib/systemd/system/rdc.service
fi
return 0
}
reload_systemd() {
systemctl daemon-reload
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
@@ -21,7 +32,7 @@ rm_pyc() {
case "$1" in
remove | upgrade )
stop_rdc
unlink /lib/systemd/system/rdc.service
rm_rdc_service
reload_systemd
rm_pyc
;;
+16 -3
파일 보기
@@ -1,17 +1,30 @@
#!/bin/bash
stop_rdc() {
#stop RDC if running
systemctl stop rdc
if [ -d /run/systemd/system ]; then
systemctl stop rdc
fi
return 0
}
rm_rdc_service() {
if [ -e /run/systemd/system ]; then
unlink @DISTRO_ROOT@/rdc.service
fi
return 0
}
reload_systemd() {
systemctl daemon-reload
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
if [ $1 -le 1 ]; then
# perform the below actions for rpm remove($1=0) or upgrade($1=1) operations
stop_rdc
unlink @DISTRO_ROOT@/rdc.service
rm_rdc_service
reload_systemd
fi
+13 -3
파일 보기
@@ -1,7 +1,8 @@
#!/bin/bash
# https://fedoraproject.org/wiki/Packaging%3aUsersAndGroups
do_create_rdc_user() {
useradd -r -s /bin/nologin rdc
useradd -r -s /sbin/nologin rdc
if [ $(getent group render) ]; then
usermod -a -G render rdc
else
@@ -12,14 +13,23 @@ do_create_rdc_user() {
return 0
}
create_rdc_service() {
if [ -d /run/systemd/system ]; then
ln -s -f -r /@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service @DISTRO_ROOT@/rdc.service
fi
}
reload_systemd() {
systemctl daemon-reload
if [ -d /run/systemd/system ]; then
systemctl daemon-reload
fi
return 0
}
do_create_rdc_user
#Symlink RDC Service
ln -s -f -r /@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rdc/rdc.service @DISTRO_ROOT@/rdc.service
create_rdc_service
#Request systemctl to reload file since RDC is adding new file/service
reload_systemd