Skip to content

Commit

Permalink
Added documentation for Intel GPU support and setcap command to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed Sep 22, 2024
1 parent 928d66d commit e204329
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e204329

Please sign in to comment.