aristocratos / btop

A monitor of resources
Apache License 2.0
21.38k stars 656 forks source link

[BUG] Config shown_boxes doesn't work with gpu1 #695

Open finn-celta opened 11 months ago

finn-celta commented 11 months ago

Describe the bug

When adding "gpu1" to the "shown_boxes" config, the gpu1 boxes isn't shown on startup and instead gets replaced with the proc box.

To Reproduce

Start btop -> add gpu1 to "Shown Boxes" in the options -> quit btop -> start btop

Expected behavior

gpu1 is shown on startup

Info (please complete the following information):

Additional context

Contents of ~/.config/btop/btop.log

2023/12/23 (13:26:47) | ===> btop++ v.1.3.0 2023/12/23 (13:26:47) | INFO: Logger set to DEBUG 2023/12/23 (13:26:47) | WARNING: Invalid box name(s) in shown_boxes! 2023/12/23 (13:26:47) | DEBUG: Setting LC_ALL=en_US.UTF-8 2023/12/23 (13:26:47) | INFO: Running on /dev/pts/2 2023/12/23 (13:26:47) | INFO: Failed to load libnvidia-ml.so, NVIDIA GPUs will not be detected: libnvidia-ml.so: cannot open shared object file: No such file or directory 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get maximum GPU power draw, defaulting to 225W 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get maximum GPU temperature, defaulting to 110°C 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get VRAM utilization 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get GPU power usage 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get PCIe throughput 2023/12/23 (13:26:47) | WARNING: ROCm SMI: Failed to get maximum GPU temperature, defaulting to 110°C 2023/12/23 (13:26:47) | DEBUG: Shared::init() : Initialized. 2023/12/23 (13:27:10) | DEBUG: Writing new config file 2023/12/23 (13:27:10) | INFO: Quitting! Runtime: 00:00:23

ycros commented 11 months ago

gpu0 doesn't work for me, where gpu1 to gpu3 work fine - it'll show all 4 gpus just fine in the gpu-totals graphs too

edit: this might actually be a different bug to OP, since I can't even add gpu0 during a session edit2: hitting 5 actually shows gpu0, it's only trying to add it into the show_boxes that's not working

I just ran make to compile it out of the source repo: commit: 2fba934cde14d72e3ed58c389dc2e24d7297475b (current main) distro: Ubuntu 22.04.3 LTS gpus: all nvidia 3090s

Log: 2023/12/27 (04:56:23) | ===> btop++ v.1.3.0 2023/12/27 (04:56:23) | DEBUG: Starting in DEBUG mode! 2023/12/27 (04:56:23) | INFO: Logger set to DEBUG 2023/12/27 (04:56:23) | DEBUG: Using locale C.UTF-8 2023/12/27 (04:56:23) | INFO: Running on /dev/pts/4 2023/12/27 (04:56:23) | INFO: Failed to load librocm_smi64.so, AMD GPUs will not be detected: librocm_smi64.so.1.0: cannot open shared object file: No such file or directory 2023/12/27 (04:56:23) | DEBUG: Shared::init() : Initialized. 2023/12/27 (04:56:36) | INFO: Quitting! Runtime: 00:00:13

MightyPiggie commented 11 months ago

I am having the same issue. Whenever I try to add gpu0 trough the settings within btop itself or adding it myself in the config file it won't accept gpu0 in the shown_boxes. Also adding it to the presets doesn't work.

However whenever I press 5 it does show everything correctly.

$ uname -a
Linux Lithium 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux
$ nvidia-smi
Wed Dec 27 10:58:01 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3080        Off | 00000000:01:00.0  On |                  N/A |
|  0%   35C    P5              34W / 340W |   1088MiB / 10240MiB |     36%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

I have the ryzen 7 7800x3d as cpu. This does however have a integrated GPU. It is disabled within the bios tho but it still might mess something up?

Edit 1:

This is the output when adding gpu0 to the preset:

2023/12/23 (19:01:46) | ===> btop++ v.1.3.0
2023/12/23 (19:01:46) | ERROR: Exception in main loop -> Input::process("p") : key not found

And this is the output when adding the gpu0 to the shown_boxes:

2023/12/23 (19:07:14) | ===> btop++ v.1.3.0
2023/12/23 (19:07:14) | WARNING: Invalid box name(s) in shown_boxes!
aristocratos commented 11 months ago

@finn-celta @MightyPiggie Fixed in latest release.

MightyPiggie commented 11 months ago

@finn-celta @MightyPiggie Fixed in latest release.

Can confirm it has been fixed, however it introduced a new bug. Not sure why it happends or how to fix it but here's the error message in ~/.config/btop/btop.log:

2024/01/07 (19:55:49) | ===> btop++ v.1.3.0
2024/01/07 (19:55:49) | ERROR: Exception during Config::unlock() : unordered_map::at

And here is how to reproduce:

  1. Add gpu0 to shown_boxed save and go back to main menu.
  2. Switch between presets. For me on average it takes like 6 switches.
  3. Either it has crashed with the above error or it has removed gpu0 and/or net from the shown_boxes.
edwloef commented 9 months ago

I can confirm this happening to me as well

MightyPiggie commented 8 months ago

I have used it multiple times now and for me the problem has been fixed. So unless someone else has problems, this issue can be closed.