Openhood

Openhood Experiments

Let's share our tech experiments and discoveries.
By Openhood
proxmox ubuntu opengl vulkan Estimated reading time:

Hardware-accelerated OpenGL and Vulkan in a Proxmox Ubuntu VM

This setup uses a MINISFORUM UM790 Pro with an AMD Ryzen 9 7940HS (16 logical CPUs) and integrated Radeon 780M graphics. The GPU stays bound to amdgpu and remains available to the Proxmox host. No PCI passthrough or host reboot is needed.

Proxmox host

Replace 500 with your Ubuntu guest's VM ID before running any qm command. Run as root on the host:

apt install libgl1 libegl1 libgl1-mesa-dri mesa-vulkan-drivers virgl-server

VMID=500  # Replace 500 with your VM ID.
qm shutdown "$VMID"
qm status "$VMID"

Wait until qm status "$VMID" reports stopped. Then configure and start the VM:

qm set "$VMID" --vga virtio-gl
qm set "$VMID" --args '-set device.vga.blob=on -set device.vga.hostmem=4G -set device.vga.venus=on'
qm start "$VMID"

virtio-gl enables VirGL for OpenGL. The extra QEMU arguments enable Venus for Vulkan on the same virtual GPU. --args replaces existing custom QEMU arguments. If the VM already has an args: entry, merge the new flags into it instead.

The missing piece on this host was virgl-server. It provides /usr/libexec/virgl_render_server, which is packaged separately from libvirglrenderer1. Without it, QEMU advertised Venus, but the guest failed with VK_ERROR_OUT_OF_HOST_MEMORY.

Ubuntu guest

Run these commands as the user who will use the GPU, then log out and reconnect over SSH so the new group membership takes effect:

sudo apt install mesa-vulkan-drivers vulkan-tools mesa-utils
sudo usermod -aG render "$(id -un)"

Verify both APIs from the new session:

eglinfo -B
VK_DRIVER_FILES=/usr/share/vulkan/icd.d/virtio_icd.json vulkaninfo --summary
  • OpenGL: Under Surfaceless platform, look for virgl (AMD Radeon 780M …).
  • Vulkan: Look for DRIVER_ID_MESA_VENUS or driverName = venus. The VK_DRIVER_FILES override is only for this check: it excludes the software driver so a fallback can't pass the test.

Read more

Read more: Hardware-accelerated OpenGL and Vulkan in a Proxmox Ubuntu VM
By Openhood
odin gamedev tools Estimated reading time:

Building a sprite atlas cli in Odin

Let's build a small sprite atlas CLI in Odin and use it to compare six rectangle-packing algorithms on the same folder of PNGs. Given loose sprites and a width limit, the tool packs them into one RGBA8 texture and writes each sprite's name and rectangle as JSON or a Godot 4 SpriteFrames resource.

Odin fits this kind of data-oriented tool well: the packers operate on plain slices of sizes and rectangles, and we only touch pixel buffers once every sprite has coordinates. Odin's core library covers the rest without third-party packages: core:flags parses command-line flags, core:image/png decodes and encodes PNGs, and core:encoding/json serializes the layout struct.

Install Odin (installation instructions) and check your setup with odin version. Every example below targets dev-2026-11a.

Read more

Read more: Building a sprite atlas cli in Odin
By Openhood
elixir phoenix docker gitlab ci Estimated reading time:

Speed up Docker-in-Docker jobs in GitLab CI

A one-line edit to a Phoenix template shouldn't send CI back through mix deps.compile. Our Docker-in-Docker (DinD) jobs start with a fresh Docker daemon, so we keep the build cache in GitLab's Container Registry. The Dockerfile here is for Elixir/Phoenix. The GitLab job works the same way for any image you build with Buildx in DinD.

Read more

Read more: Speed up Docker-in-Docker jobs in GitLab CI
By Openhood
ruby bundler dev til Estimated reading time:

bundler/inline for single-file ruby scripts

Sometimes you want to create a single ruby script using exact versions of some gems, but you don't want to have to create a directory just to have a Gemfile and your script file in it, then have to do the bundle install/bundle exec dance to run it properly.

Read more

Read more: bundler/inline for single-file ruby scripts
By Openhood
nginx sysadmin Estimated reading time:

NGinx Useful Tips

During an epic debugging session with an NGinx configuration for a project, I discovered some useful, but not so common (at least to me) configuration.

Read more

Read more: NGinx Useful Tips