Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkgbuilds/btop-xe/.omarchy/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"source": "local"
}
37 changes: 37 additions & 0 deletions pkgbuilds/btop-xe/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pkgname=btop-xe
pkgver=1.4.7.xe.76530c8
pkgrel=2
pkgdesc='btop with Intel Xe GPU support'
arch=('x86_64')
url='https://github.com/aristocratos/btop'
license=('Apache-2.0')
depends=('glibc' 'hicolor-icon-theme' 'libgcc' 'libstdc++' 'libcap')
makedepends=('git' 'gcc' 'make' 'libdrm' 'libpciaccess')
optdepends=('rocm-smi-lib: AMD GPU support')
provides=('btop')
conflicts=('btop')
install=btop-xe.install
options=('!debug')
source=(
"btop::git+https://github.com/deveworld/btop.git#commit=76530c80dd6184ccb72d7048c2589afdc4bdee52"
"prefer-gtidle-for-xe-utilization.patch"
)
sha256sums=(
'SKIP'
'53e0b555589a3333c0e40430988c62221becbeba02ed8c69ca69d452c9439371'
)

prepare() {
cd btop
patch -Np1 -i "$srcdir/prefer-gtidle-for-xe-utilization.patch"
}

build() {
cd btop
make STATIC= GPU_SUPPORT=true RSMI_STATIC= STRIP=true
}

package() {
cd btop
make PREFIX=/usr DESTDIR="$pkgdir" install
}
7 changes: 7 additions & 0 deletions pkgbuilds/btop-xe/btop-xe.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
post_install() {
setcap 'cap_perfmon=+ep cap_dac_read_search=+ep' /usr/bin/btop 2>/dev/null || true
}

post_upgrade() {
post_install
}
32 changes: 32 additions & 0 deletions pkgbuilds/btop-xe/prefer-gtidle-for-xe-utilization.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kristoffer Haugland <stappmus@gmail.com>
Date: Thu, 25 Jun 2026 23:48:00 +0200
Subject: [PATCH] Prefer Xe gtidle before fdinfo utilization

The fdinfo collector walks /proc/*/fd and /proc/*/fdinfo on each sample.
That is much more expensive than sysfs gtidle counters on process-heavy
desktops. Prefer gtidle when the kernel exposes it, and keep fdinfo as a
fallback for systems without gtidle.
---
src/linux/btop_collect.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp
index 57a2f2d..e816404 100644
--- a/src/linux/btop_collect.cpp
+++ b/src/linux/btop_collect.cpp
@@ -2487,8 +2487,10 @@ namespace Gpu {
st.mem_total = mem_total;
}

- // Test fdinfo availability
- if (not st.pci_slot.empty()) {
+ // Prefer gtidle when the kernel exposes it. fdinfo scans /proc every
+ // sample and is much more expensive on process-heavy desktops.
+ // Systems without gtidle still use fdinfo when available.
+ if (not st.pci_slot.empty() and st.gt_idle.empty()) {
FdinfoCycles test_cycles = collect_fdinfo_cycles(st.pci_slot);
st.fdinfo_probe_enabled = true;
st.fdinfo_next_probe_ns = 0;
--
2.50.0