-
Notifications
You must be signed in to change notification settings - Fork 291
other: handle systems with only libnvidia-ml.so.1 #1655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
other: handle systems with only libnvidia-ml.so.1 #1655
Conversation
Recently, NVIDIA CUDA repository packages started shipping only `libnvidia-ml.so.1` file, without `libnvidia-ml.so`. The upstream `nvml-wrapper` package has a fix proposed (rust-nvml/nvml-wrapper#63), yet the package is in search of a maintainer at the moment. To allow `bottom` to correctly detect NVIDIA GPUs on Ubuntu with official NVIDIA packages, add a wrapper around `Nvml::init` to be more persistent in its search for the NVML library.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1655 +/- ##
==========================================
+ Coverage 41.29% 41.30% +0.01%
==========================================
Files 109 109
Lines 17885 17900 +15
==========================================
+ Hits 7386 7394 +8
- Misses 10499 10506 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Looks good, thanks! @all-contributors please add @al42and for code. |
I've put up a pull request to add @al42and! 🎉 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [ClementTsang/bottom](https://github.com/ClementTsang/bottom) | minor | `0.10.2` -> `0.11.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>ClementTsang/bottom (ClementTsang/bottom)</summary> ### [`v0.11.0`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0110---2025-08-05) [Compare Source](ClementTsang/bottom@0.10.2...0.11.0) ##### Features - [#​1625](ClementTsang/bottom#1625): Add the ability to configure the disk widget's table columns. - [#​1641](ClementTsang/bottom#1641) + [#​1692](ClementTsang/bottom#1692): Support AMD GPU data collection on Linux. - [#​1642](ClementTsang/bottom#1642): Support changing the widget borders. - [#​1717](ClementTsang/bottom#1717): Support delete key (fn + delete on macOS) to kill processes. - [#​1306](ClementTsang/bottom#1306): Support using left/right key to collapse/expand process trees respectively. - [#​1767](ClementTsang/bottom#1767): Add a virtual memory column for processes. - [#​1770](ClementTsang/bottom#1770) (originally [#​1627](ClementTsang/bottom#1627)): Add option to have process tree entries be collapsed by default. ##### Bug Fixes - [#​1551](ClementTsang/bottom#1551): Fix missing parent section names in default config. - [#​1552](ClementTsang/bottom#1552): Fix typo in default config. - [#​1565](ClementTsang/bottom#1565): Fix issue where CPU usage in basic mode looks weird if core count isn't divisible by four. - [#​1578](ClementTsang/bottom#1578): Fix missing selected text background colour in `default-light` theme. - [#​1593](ClementTsang/bottom#1593): Fix using `"none"` for chart legend position in configs. - [#​1594](ClementTsang/bottom#1594): Fix incorrect default config definitions for chart legends. - [#​1596](ClementTsang/bottom#1596): Fix support for nilfs2 file system. - [#​1660](ClementTsang/bottom#1660): Fix properly cleaning up the terminal if the program is terminated due to an `Err` bubbling to the top. - [#​1663](ClementTsang/bottom#1663): Fix network graphs using log scaling having broken lines when a point was 0. - [#​1667](ClementTsang/bottom#1667): Fix for ARC/SWAP not being hidden in basic mode after refactor. - [#​1683](ClementTsang/bottom#1683): Fix graph lines potentially showing up behind legends. - [#​1701](ClementTsang/bottom#1701): Fix process kill dialog occasionally causing panics. - [#​1755](ClementTsang/bottom#1755): Fix missing stats/incorrect mount name for certain entries in the disk widget. - [#​1759](ClementTsang/bottom#1759): Fix increment for data tables if the change is greater than the number of entries left. ##### Changes - [#​1559](ClementTsang/bottom#1559): Rename `--enable_gpu` to `--disable_gpu`, and make GPU features enabled by default. - [#​1570](ClementTsang/bottom#1570): Consider `$XDG_CONFIG_HOME` on macOS when looking for a default config path in a backwards-compatible fashion. - [#​1686](ClementTsang/bottom#1686): Allow hyphenated arguments to work as well (e.g. `--autohide-time`). - [#​1701](ClementTsang/bottom#1701): Redesign process kill dialog. - [#​1706](ClementTsang/bottom#1706): Disable mouse capture when `disable_click` is set. - [#​1769](ClementTsang/bottom#1769): Change how we calculate swap usage in Windows. ##### Other - [#​1655](ClementTsang/bottom#1655): Better handle NVIDIA GPUs on Linux with only libnvidia-ml.so.1. - [#​1658](ClementTsang/bottom#1658): Make it possible to override completion/manpage generation output directory via env. - [#​1663](ClementTsang/bottom#1663): Rework how data is stored internally, reducing memory usage a bit. - [#​1749](ClementTsang/bottom#1749): Fix invalid desktop file values. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS41My4xIiwidXBkYXRlZEluVmVyIjoiNDEuNTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Description
Recently, NVIDIA CUDA repository packages started shipping only
libnvidia-ml.so.1
file, withoutlibnvidia-ml.so
. The upstreamnvml-wrapper
package has a fix proposed (rust-nvml/nvml-wrapper#63), yet the package is in search of a maintainer at the moment and the PR is not getting merged.To allow
bottom
to correctly detect NVIDIA GPUs on Ubuntu with official NVIDIA packages, add a wrapper aroundNvml::init
to be more persistent in its search for the NVML library.Note: I don't see a reason why we can't try looking for
libnvidia-ml.so.1
on non-Linux systems, thus simplifying the code. But I don't have a non-Linux machine with an NVIDIA GPU around to make sure this is indeed the case and nothing weird happens. The extra platform-specificity is, admittedly, not great for long-term maintenance; but I hope thatnvml-wrapper
will be updated eventually and this code will be removed.Issue
N/A
Testing
Code was tested on two machines, Ubuntu 22.04 with NVIDIA driver 565 and Ubuntu 24.04 with NVIDIA driver 560; NVIDIA software installed from official CUDA repos, per https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#ubuntu. In both cases, GPU temperature and RAM usage were not displayed without this change. With this change, the information is displayed and is consistent with
nvidia-smi
. Iflibnvidia-ml.so.1
is removed andlibnvidia-ml.so
is added, things work too (with or without this PR).If this is a code change, please also indicate which platforms were tested:
Checklist
If relevant, ensure the following have been met:
cargo fmt
)README.md
, help menu, doc pages, etc.)