Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PKGBUILD for rocminfo 2.7.0
# Maintainer: Jakub Okoński <jakub@okonski.org>
# Maintainer: Rigo Reddig <rigo.reddig@gmail.com>
pkgname=rocminfo
pkgver=2.7.0
pkgrel=1
pkgdesc="ROCm info tools - rocm_agent_enumerator"
arch=(x86_64)
url="https://github.com/RadeonOpenCompute/rocminfo"
license=('NCSA')
makedepends=(git cmake ninja)
depends=(pciutils rocm-cmake rocr-runtime roct-thunk-interface)
source=("$pkgname-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/rocminfo/archive/roc-$pkgver.tar.gz"
"sizeof_fix.patch")
md5sums=('da82c4a17ee0d760485387c562818bdb'
'5674052b93693483b3cddd65dbd9ad21')
prepare() {
cd $srcdir/$pkgname-roc-$pkgver
patch --forward -i "${srcdir}/sizeof_fix.patch"
}
build() {
mkdir -p "$srcdir/$pkgname-roc-$pkgver/build"
cd "$srcdir/$pkgname-roc-$pkgver/build"
# TODO: fix rocminfo binary, it contains references to $srcdir
cmake -DCMAKE_PREFIX_PATH=/opt/rocm \
-DCMAKE_INSTALL_PREFIX="$pkgdir/opt/rocm" \
-DROCM_DIR=/opt/rocm \
-G Ninja \
"$srcdir/rocminfo-roc-$pkgver"
ninja
}
package() {
ninja -C "$srcdir/$pkgname-roc-$pkgver/build" install
}
diff --git a/src/rocminfo-roc-2.7.0/rocminfo.cc b/src/rocminfo-roc-2.7.0/rocminfo.cc
index 9fddcfb..30bbc97 100755
--- a/src/rocminfo-roc-2.7.0/rocminfo.cc
+++ b/src/rocminfo-roc-2.7.0/rocminfo.cc
@@ -72,7 +72,7 @@
char* err_str = NULL; \
if (hsa_status_string(err, \
(const char**)&err_str) != HSA_STATUS_SUCCESS) { \
- snprintf(&(err_val[0]), sizeof(err_val[12]), "%#x", (uint32_t)err); \
+ snprintf(&(err_val[0]), sizeof(err_val), "%#x", (uint32_t)err); \
err_str = &(err_val[0]); \
} \
printf("%shsa api call failure at: %s:%d\n", \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.