From e204329fc7b20a05135857723b2a9c42d466731f Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sun, 22 Sep 2024 10:39:22 +0200 Subject: [PATCH] Added documentation for Intel GPU support and setcap command to Makefile --- Makefile | 7 +++++++ README.md | 46 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 0f8aef61..af0a0fe1 100644 --- a/Makefile +++ b/Makefile @@ -283,6 +283,7 @@ help: @printf " clean Remove built objects\n" @printf " distclean Remove built objects and binaries\n" @printf " install Install btop++ to \$$PREFIX ($(PREFIX))\n" + @printf " setcap Set extended capabilities on binary (preferable to setuid)\n" @printf " setuid Set installed binary owner/group to \$$SU_USER/\$$SU_GROUP ($(SU_USER)/$(SU_GROUP)) and set SUID bit\n" @printf " uninstall Uninstall btop++ from \$$PREFIX\n" @printf " info Display information about Environment,compiler and linker flags\n" @@ -355,6 +356,12 @@ setuid: @printf "\033[1;92mSetting SUID bit\033[0m\n" @chmod u+s $(DESTDIR)$(PREFIX)/bin/btop +#? Run setcap on btop for extended capabilities +setcap: + @printf "\033[1;97mFile: $(DESTDIR)$(PREFIX)/bin/btop\n" + @printf "\033[1;92mSetting capabilities...\033[0m\n" + @setcap cap_perfmon=+ep $(DESTDIR)$(PREFIX)/bin/btop + # With 'rm -v' user will see what files (if any) got removed uninstall: @printf "\033[1;91mRemoving: \033[1;97m$(DESTDIR)$(PREFIX)/bin/btop\033[0m\n" diff --git a/README.md b/README.md index 8002a0a6..6fee43ec 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ Also needs a UTF8 locale and a font that covers: * Unicode Block “Geometric Shapes” U+25A0 - U+25FF * Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F -### **Optional Dependencies (Needed for GPU monitoring)** +### **Optional Dependencies (Needed for GPU monitoring) (Only Linux)** GPU monitoring also requires a btop binary built with GPU support (`GPU_SUPPORT=true` flag). @@ -241,6 +241,14 @@ In addition to that you must also have the nvidia-ml dynamic library installed, If you have an AMD GPU `rocm_smi_lib` is required, which may or may not be packaged for your distribution. + * **INTEL** + +Requires a working C compiler if compiling from source - tested with GCC12 and Clang16. + +Also requires the user to have permission to read from SYSFS. + +Can be set with `make setcap` (preferred) or `make setuid` or by running btop with `sudo` or equivalent. + ### **Notice (Text rendering issues)** * If you are having problems with the characters in the graphs not looking like they do in the screenshots, it's likely a problem with your systems configured fallback font not having support for braille characters. @@ -299,11 +307,19 @@ If you have an AMD GPU `rocm_smi_lib` is required, which may or may not be packa sudo make install ``` -3. **(Optional) Set suid bit to make btop always run as root (or other user)** +3. **(Optional/Required for Intel GPU) Set extended capabilities or suid bit to btop** Enables signal sending to any process without starting with `sudo` and can prevent /proc read permissions problems on some systems. - * **Run setuid.sh or:** + Is required for Intel GPU support. + + * **Run:** + + ```bash + # run after make install and use same PREFIX if any was used at install + sudo make setcap + ``` + * **or** ```bash # run after make install and use same PREFIX if any was used at install @@ -367,11 +383,9 @@ If you have an AMD GPU `rocm_smi_lib` is required, which may or may not be packa ### GPU compatibility - Btop++ supports NVIDIA and AMD GPUs out of the box on Linux x86_64, provided you have the correct drivers and libraries. + Btop++ supports Nvidia and AMD GPUs and Intel IGPUs out of the box on Linux x86_64, provided you have the correct drivers and libraries. - Compatibility with Intel GPUs using generic DRM calls is planned, as is compatibility for FreeBSD and macOS. - - Gpu support will not work when static linking glibc (or musl, etc.)! + Gpu support for Nvidia or AMD will not work when static linking glibc (or musl, etc.)! For x86_64 Linux the flag `GPU_SUPPORT` is automatically set to `true`, to manually disable gpu support set the flag to false, like: @@ -448,18 +462,26 @@ If you have an AMD GPU `rocm_smi_lib` is required, which may or may not be packa Notice! Only use "sudo" when installing to a NON user owned directory. -5. **(Optional) Set suid bit to make btop always run as root (or other user)** - - ```bash - sudo make setuid - ``` +5. **(Optional/Required for Intel GPU support) Set extended capabilities or suid bit to btop** No need for `sudo` to enable signal sending to any process and to prevent /proc read permissions problems on some systems. + Also required for Intel GPU monitoring. + Run after make install and use same PREFIX if any was used at install. + ```bash + sudo make setcap + ``` + + or + Set `SU_USER` and `SU_GROUP` to select user and group, default is `root` and `root` + ```bash + sudo make setuid + ``` + * **Uninstall** ```bash