Arch vs Ubuntu vs NixOS for Local LLM Home Lab


When I tested Linux against Windows for local AI, the headline number was an 800 megabyte VRAM saving on the same RTX card across every single context stress test I ran. That is the kind of margin that decides whether a model loads at all on a 16 GB GPU. But the moment you commit to Linux for a home lab, a second question appears immediately. Which Linux. I have spent the last few months running local LLM workloads across Arch, Ubuntu, and NixOS to figure out which one actually deserves to live on the machine sitting under my desk. The answer is not what most distro evangelists will tell you, and the trade offs matter more than the surface level features.

This is a working AI engineer comparing three distributions on the things that actually break when you are running a coding model with a real context window. Driver pain, CUDA versioning, freshness versus stability, declarative reproducibility, kernel updates, and the package manager war between AUR, apt, and nix.

Why does the distro choice matter for a local LLM home lab in the first place?

A home lab for local AI is not a normal Linux desktop. You are stacking proprietary Nvidia drivers, a specific CUDA toolkit version, cuDNN, a matching PyTorch build, llama.cpp or vLLM, and a container runtime that respects GPU passthrough. Every layer has a version pin, and every layer can break if the layer below it shifts.

When I ran benchmarks on my RTX with 32 GB of VRAM, the operating system overhead alone was the difference between fitting a 24 billion parameter quantized model with 60,000 tokens of context or watching it spill into system RAM. Local AI lives or dies on VRAM headroom, and the distro you pick determines how often you fight your OS instead of your model. My Linux vs Windows VRAM analysis for local AI covers the baseline numbers behind this investigation.

How bad is the Nvidia driver situation on each distro?

This is where the three distributions diverge the most, and it is the single biggest reason most beginners give up on Linux for AI within their first weekend.

On Ubuntu, Nvidia drivers are essentially a non issue. The installer detects the card during setup and offers to install the proprietary driver before you even reach the desktop. The driver gets pinned to a stable version, the kernel module rebuilds automatically through DKMS when the kernel updates, and CUDA installs cleanly through the official Nvidia apt repository. I said it in the video and I will say it here. AI engineering is hard enough already. The last thing I want is to spend three days fighting drivers when I could be debugging my actual model code. If you have never set up Ubuntu for this kind of work, my Ubuntu setup guide for AI engineers walks through the exact steps I use on every fresh install.

On Arch, the driver story is fine when it works and brutal when it does not. You install nvidia or nvidia-dkms from the official repository, and most of the time it just runs. The problem is Arch ships kernel updates aggressively. When a new kernel lands before the Nvidia driver has rebuilt for it, you can end up with a black screen on next boot. The fix is booting a fallback kernel or downgrading. Rare, but it happens often enough in a year that I would not recommend Arch for a machine you need available on demand.

On NixOS, drivers are declarative. You add hardware.nvidia.package and hardware.opengl.enable to your configuration.nix, rebuild, and the driver is installed atomically. If the rebuild fails or the new generation breaks, you reboot and pick the previous generation from the boot menu. Nothing is ever half installed. This is genuinely magical the first time you experience it. The catch is that the Nix way of doing things means you cannot just run the Nvidia installer or follow most online guides. You have to learn the Nix language, and you have to trust that nixpkgs has packaged the version you need.

How does CUDA versioning play out across Arch, Ubuntu, and NixOS?

CUDA versioning is where the three distros really show their personalities.

Ubuntu has the smoothest path because Nvidia themselves treat Ubuntu LTS as a first class target. The official CUDA repository ships specific CUDA toolkit versions as separate packages, you can install cuda-12-1 alongside cuda-12-4, and switching between them is just a matter of updating your PATH or symlink. Most production AI infrastructure runs on Ubuntu, which means most documentation, most container images, and most error messages on Stack Overflow assume Ubuntu. That is a real productivity multiplier when something goes wrong at midnight.

Arch ships a single CUDA version in its repositories, and that version tracks upstream aggressively. If your project needs CUDA 12.1 specifically and Arch has moved on to 12.5, your options are pinning through the Arch Linux Archive, building from source, or using Docker. The AUR helps here because community members maintain older CUDA versions as separate packages, but you are now trusting AUR maintainers with your toolchain, which is a different kind of risk.

NixOS handles CUDA versioning the cleanest of all three in theory. You can pin any CUDA version per project through a flake, and that pin is reproducible across every machine that consumes the flake. In practice, the CUDA packaging in nixpkgs is large, slow to build, and not always up to date with the latest Nvidia releases. I have hit cases where the version I needed was not yet in nixpkgs and I had to write my own derivation, which is a real time sink if you are not already comfortable with the Nix language.

For most people running a local LLM home lab, installing CUDA system wide on Ubuntu and containerizing everything else is the pragmatic winner. My cost effective local LLM setup guide breaks down the full hardware and software stack.

If you want a head start on what to run once your distro is sorted, browse the local AI starter projects I keep open source. They are designed for exactly this kind of home lab.

What about package freshness versus stability?

This is the classic Linux trade off, and local AI sharpens it in interesting ways.

Arch is rolling release. You get the newest llama.cpp, the newest PyTorch, the newest ROCm if you happen to be on AMD, often within days of upstream release. For someone who wants to try the latest quantization method or run a model that was published yesterday, this is genuinely valuable. The cost is that any update can break any other update, and you are responsible for noticing when that happens. AUR amplifies this because community packages can lag behind their dependencies and silently fail to build.

Ubuntu LTS goes the other direction. Packages are frozen at release and only get security updates for five years. That means the apt version of PyTorch is always old, the apt version of CUDA lags upstream, and you cannot rely on the system package manager for anything cutting edge. The workaround is that the AI ecosystem has standardized on Docker, conda, and pip wheels, all of which give you fresh versions on top of a stable base. This combination of stable base plus containerized application layer is, in my experience, the most reliable way to run a home lab that you do not want to babysit.

NixOS sits in the middle. The unstable channel is reasonably fresh, the stable channel is reasonably stable, and you can mix them per package through overlays. The nixpkgs collection is enormous and well maintained, but AI specific packages sometimes lag because they are large, complex, and require Nvidia binaries that the Nix philosophy does not love.

Is declarative reproducibility worth switching to NixOS for?

This is the NixOS pitch in one sentence. Your entire system, including kernel, drivers, CUDA, Python environment, and every service you run, is described in a single configuration file. If your machine dies, you reinstall NixOS, copy your config, rebuild, and you are back exactly where you were. No snowflake servers. No forgotten apt-get install commands from two years ago. No environment drift.

For a home lab, that is genuinely compelling. I have rebuilt my Ubuntu machine three times in the last year because of accumulated cruft from experiments, and each rebuild costs me half a day of remembering what I had installed. On NixOS, that rebuild would be one command.

The honest counterpoint is that the learning curve is steep. The Nix language is unusual, and the moment you need a package not in nixpkgs, you are writing derivations. For someone who just wants to run local models, Ubuntu plus Docker plus a pinned requirements.txt gives you most of the reproducibility benefit with about ten percent of the learning investment.

If you are the kind of person who already runs everything else through nix or guix, NixOS is obviously the answer. If you are not, the marginal benefit over a disciplined Ubuntu setup is smaller than the NixOS community will tell you.

How do AUR, apt, and nix compare for installing AI tooling?

AUR is the wild west. Everything is there, including ten variants of every model runner, but quality varies. I have installed AUR packages that just worked and AUR packages that silently corrupted my system. You are running build scripts written by strangers, which is fine if you read them and not fine if you do not.

Apt is conservative and predictable. You will not find the latest niche tools in apt, and that is the point. For AI work, apt handles the system layer, including drivers and CUDA from the Nvidia repository, and pip or conda or Docker handles the application layer. This separation has been the most reliable pattern I have found.

Nix is rigorous. Every package is reproducible, every dependency is explicit, and you can have multiple versions of the same package coexisting without conflict. The trade off is that installing something not in nixpkgs is a real engineering task, not a one liner. For a working home lab, this can become friction every time you want to try a new tool.

If you want Arch freshness without committing to Arch, run Ubuntu with Distrobox to get access to AUR style packages without the kernel risk. WSL is not a real alternative for AI workloads. I covered the details in why WSL2 falls short for local AI development. The short version is the GPU passthrough layer costs you about a gigabyte of VRAM compared to native Linux.

Which distribution should you actually pick for your home lab?

If you are starting out and want your home lab to just work, pick Ubuntu LTS. The driver path is solved, the CUDA path is solved, the documentation assumes Ubuntu, and the production AI ecosystem targets Ubuntu first. You will spend your time training, fine tuning, and serving models instead of debugging kernel modules.

If you are already a confident Linux user, you want bleeding edge packages, and you accept that your system is your responsibility, Arch is a fine choice. The AUR is genuinely useful for AI tooling, and the rolling release cadence means you are never far from the latest llama.cpp or vLLM build. Just keep a rescue USB nearby and learn to use the Arch Linux Archive for rollbacks.

If you are a reproducibility obsessive, you run a fleet of home lab machines, or you want to treat your AI infrastructure like infrastructure, NixOS is the most powerful option of the three. It also has the highest learning cost, and you will spend your first month writing derivations instead of running models. Whether that is worth it depends entirely on how much you value the rebuild guarantee.

The serious AI tooling does not really care which distro you pick as long as it is Linux. vLLM targets Linux. TensorRT targets Linux. The Lambda stack targets Ubuntu specifically. The benchmarks I ran showed the same 800 megabyte VRAM saving regardless of which distribution I tested, because the savings come from the kernel and the lack of Windows compositor overhead, not from anything distro specific. Pick the one whose trade offs match how you want to spend your time, and then get back to building the actual models.

If you want to see the full local AI workflow end to end, including the benchmark methodology behind these numbers, watch the original video here: Why Everyone’s Switching to Linux for Local AI.

And if you want to compare notes with other engineers building local AI home labs, swap GPU configurations, or get help when your nvidia driver decides to break on a Tuesday night, join us in the community at aiengineer.community/join. That is where the real conversations happen.

Zen van Riel

Zen van Riel

Senior AI Engineer | Ex-Microsoft, Ex-GitHub

I went from a $500/month internship to Senior AI Engineer. Now I teach 30,000+ engineers on YouTube and coach engineers toward six-figure AI careers in the AI Engineering community.

Blog last updated