GPU监控文档 (#73)

This commit is contained in:
UUBulb
2024-06-25 22:06:14 +08:00
committed by GitHub
parent 152f482594
commit b71ec7eaea
5 changed files with 162 additions and 2 deletions
+2 -1
View File
@@ -24,4 +24,5 @@ If you installed the Agent using the one-click script, you can edit `/etc/system
- `--disable-auto-update`: Disables **automatic updates** for the Agent (security feature).
- `--disable-force-update`: Disables **forced updates** for the Agent (security feature).
- `--disable-command-execute`: Disables the execution of scheduled tasks and the opening of the online terminal on the Agent (security feature).
- `--tls`: Enables SSL/TLS encryption (required if you use nginx to reverse proxy the Agent's gRPC connection and nginx has SSL/TLS enabled).
- `--tls`: Enables SSL/TLS encryption (required if you use nginx to reverse proxy the Agent's gRPC connection and nginx has SSL/TLS enabled).
- `--gpu`: Enable GPU monitoring (may need extra dependencies while monitoring GPU utilization. Refer to FAQ - Enable GPU monitoring for any questions.)
+78
View File
@@ -0,0 +1,78 @@
# Enable GPU monitoring
GPU monitoring is a new feature implemented in Nezha Monitoring v0.17.x. Before using the feature, please check you Dashboard version is higher than v0.17.2 and Agent version is higher than v0.17.0.
## Enable
### From Command-Line Flag
Append the `--gpu` flag to the Agent argument. For example:
```bash
/opt/nezha/agent/nezha-agent -s example.com:5555 -p example --gpu
```
### From configuration file
Execute the following command to modify Agent configuration to enable GPU monitoring.
```bash
/opt/nezha/agent/nezha-agent edit
```
In the returned interactive menu, choose to enable GPU monitoring.
## Enable GPU utilization monitoring
GPU model and GPU utilization are two different monitor items, which uses different approaches to obtain their value.
Windows and macOS supports getting GPU utilization without extra dependencies, and support multiple graphics card brands.
Linux distros support only NVIDIA and AMD cards and need to install extra dependencies.
Below are the instructions on how to enable GPU utilization monitoring on Linux for NVIDIA / AMD graphics cards.
### NVIDIA
NVIDIA cards need the `nvidia-smi` utility to get GPU utilization. This utility is included in the official driver by default.
If you use unofficial drivers like `nouveau`, then it's not possible to get GPU utilization.
### AMD
AMD cards need to install the official `amdgpu` driver and the `rocm-smi` utility.
Mainstream distros have already packaged `rocm-smi`, below are commands to install the utility on these distros:
```bash
# Arch Linux
pacman -Sy rocm-smi-lib
# Debian / Ubuntu
apt install rocm-smi
# Fedora / RHEL 8+
dnf install rocm-smi
```
If your distro doesn't have the package, then you will need to compile `rocm_smi_lib` manually.
Required dependencies`git` `cmake` `gcc`
First, clone the git repository of `rocm_smi_lib`:
```bash
git clone https://github.com/ROCm/rocm_smi_lib
```
Then compile the libraries and install them on your system.
```bash
cd rocm_smi_lib
mkdir -p build
cd build
cmake ..
make -j $(nproc)
# Install library file and header; default location is /opt/rocm
make install
```