Getting Beszel agent to monitor GPU usage when using Docker

Getting Beszel agent to monitor GPU usage when using Docker

I found a forum post discussing if there was any way to get Beszel the server monitoring software to be able to monitor the host computers GPU and report it back to the Beszel server. I found a comment from Arunoruto stating that they came up with a way and make a fork of the beszel-agent repo to allow for this for Nvidia GPUs. They are using Github workflows to keep their fork up to date.

GitHub - arunoruto/beszel-agent: Container package for the beszel-agent with nvidia
Container package for the beszel-agent with nvidia - arunoruto/beszel-agent

I'm running this on Unraid but you need to use Docker Compose to make that happen. In order to do that I installed the Unraid "app" called Docker Compose Manager which adds a section to the Docker Containers page where you can create a stack and then add the compose info to get it working.

I used the following compose to make it work, putting in my key from the Beszel entry my server has. After that the GPU data is now reporting. If you need to debug this further you can go into the Logs screen of the docker and see what the logs show. Once you have gotten this working you can change the LOG_LEVEL line from debug back to info.

services: beszel-agent: image: ghcr.io/arunoruto/beszel-agent:latest container_name: beszel-agent restart: unless-stopped command: nvidia-smi runtime: nvidia deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: - utility network_mode: host volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /media/hdds/.beszel:/extra-filesystems/md0:ro environment: LOG_LEVEL: debug LISTEN: 45876 GPU: true KEY: "ssh-ed25519 AAAAC3NzaC...EbMs"