Import radeontop 1.3.0

View your GPU utilization, both for the total activity percent and individual
blocks. The total GPU utilization is also valid for OpenCL loads; the other
blocks are only useful in GL loads.
Requires access to /dev/dri/cardN files or /dev/mem (root privileges).
R600 and up, even Southern Islands should work fine.

Tweak: AMD Catalyst driver reference removed from DESCR before commit.

Port originally created by thfr@, updated by sdk@ and I'm taking maintainer.

ok by thfr@ and solene@
This commit is contained in:
sdk 2021-10-29 21:00:42 +00:00
parent bae061ba23
commit 1cc0ce7b10
7 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,40 @@
# $OpenBSD: Makefile,v 1.1.1.1 2021/10/29 21:00:42 sdk Exp $
COMMENT = monitor GPU utilization for R600 and up
GH_ACCOUNT = clbr
GH_PROJECT = radeontop
GH_TAGNAME = v1.3
SHARED_LIBS = radeontop_xcb 0.0 # 1.3
CATEGORIES = graphics
MAINTAINER = Stefan Hagen <sh+ports@codevoid.de>
# GPLv3.0+
PERMIT_PACKAGE = Yes
WANTLIB += c curses drm_amdgpu drm intl m pciaccess pthread xcb xcb-dri2
COMPILER = base-clang ports-gcc base-gcc
BUILD_DEPENDS = devel/gettext,-tools
RUN_DEPENDS = textproc/intltool
MAKE_FLAGS = amdgpu=1
MAKE_ENV = MANDIR=man LDFLAGS="${LDFLAGS}"
USE_GMAKE = Yes
NO_TEST = Yes
CFLAGS += -I${LOCALBASE}/include
LDFLAGS += -L${LOCALBASE}/lib -lintl
do-gen:
${SUBST_CMD} ${WRKSRC}/Makefile
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (radeontop-1.3.tar.gz) = Dmq6yvo8eV7ng74Ytzb238f/k8bjwyN8x8FoSGPggQA=
SIZE (radeontop-1.3.tar.gz) = 38138

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2021/10/29 21:00:42 sdk Exp $
version lib
don't redo all target for install
correct the install path
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -20,6 +20,7 @@ xcb ?= 1
bin = radeontop
xcblib = libradeontop_xcb.so
+xcblib = libradeontop_xcb.so.${LIBradeontop_xcb_VERSION}
src = $(filter-out amdgpu.c auth_xcb.c,$(wildcard *.c))
verh = include/version.h
@@ -80,7 +81,6 @@ LIBS += $(shell pkg-config --libs libdrm)
LIBS += -lm
ifeq ($(xcb), 1)
xcb_LIBS += $(shell pkg-config --libs xcb xcb-dri2)
- LIBS += -ldl
endif
# On some distros, you might have to change this to ncursesw
@@ -116,12 +116,12 @@ trans:
xgettext -o translations/radeontop.pot -k_ *.c \
--package-name radeontop
-install: all
- $(INSTALL) -D -m755 $(bin) $(DESTDIR)/$(PREFIX)/sbin/$(bin)
+install:
+ $(INSTALL) -D -m755 $(bin) $(PREFIX)/sbin/$(bin)
ifeq ($(xcb), 1)
- $(INSTALL) -D -m755 $(xcblib) $(DESTDIR)/$(PREFIX)/$(LIBDIR)/$(xcblib)
+ $(INSTALL) -D -m755 $(xcblib) $(PREFIX)/$(LIBDIR)/$(xcblib)
endif
- $(INSTALL) -D -m644 radeontop.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1/radeontop.1
+ $(INSTALL) -D -m644 radeontop.1 $(PREFIX)/$(MANDIR)/man1/radeontop.1
ifeq ($(nls), 1)
$(MAKE) -C translations install PREFIX=$(PREFIX)
endif

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-translations_Makefile,v 1.1.1.1 2021/10/29 21:00:42 sdk Exp $
fix install dir
Index: translations/Makefile
--- translations/Makefile.orig
+++ translations/Makefile
@@ -15,6 +15,6 @@ $(obj): $(src)
$(MSGFMT) -o $@ $<
%.inst: %.mo
- $(INSTALL) -D -m 644 $< $(DESTDIR)/$(PREFIX)/share/locale/$*/LC_MESSAGES/radeontop.mo
+ $(INSTALL) -D -m 644 $< $(PREFIX)/share/locale/$*/LC_MESSAGES/radeontop.mo
install: all $(inst)

View File

@ -0,0 +1,5 @@
View your GPU utilization, both for the total activity percent and individual
blocks. The total GPU utilization is also valid for OpenCL loads; the other
blocks are only useful in GL loads.
Requires access to /dev/dri/cardN files or /dev/mem (root privileges).
R600 and up, even Southern Islands should work fine.

View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2021/10/29 21:00:42 sdk Exp $
@lib lib/libradeontop_xcb.so.${LIBradeontop_xcb_VERSION}
@man man/man1/radeontop.1
@bin sbin/radeontop
share/doc/pkg-readmes/${PKGSTEM}
share/locale/ru/LC_MESSAGES/radeontop.mo

View File

@ -0,0 +1,11 @@
$OpenBSD: README,v 1.1.1.1 2021/10/29 21:00:42 sdk Exp $
+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------
Radeontop needs access to the system main memory via /dev/mem. This is
forbidden on a default installation. To allow access to this device, add
the following line to /etc/sysctl.conf.
kern.allowkmem=1