I run the AI for Fring, a free wardrobe app, on a second-hand Tesla P40 in my homelab. The virtual try-on uses Leffa, a diffusion model. For a month every render took about 21 minutes, and I assumed that was just what a 2016 card could do. It wasn't.
The model was loaded in fp16, because "use half precision to save VRAM" is the default advice everywhere. It is right on almost every recent card. It is wrong on consumer Pascal: the P40 (GP102, compute capability 6.1) runs fp16 at roughly 1/64 of fp32 throughput. The code had said fp16 since day one; the warning had been sitting in a ticket for a month. Nobody had read the two together.
Measured on 23 September 2026, on the same 20-step render.
fp16 — 63.8 s per diffusion step, 6.6 GB of VRAM, 1241 s for the full render.
fp32 — 4.7 s per step, 9.8 GB of VRAM, 85 s for the full render.
The images were practically identical (mean difference 0.77/255 per pixel). And the card never needed the VRAM savings: the model used 6.4 GB out of 23. The saving fp16 bought was worth nothing, and it cost a factor of 14.
A CPU-only torch wheel. The Dockerfile installed torch from the CPU index, inherited from an older server whose 4 GB card could not hold the model. On the P40, `nvidia-smi` saw the GPU while `torch.cuda.is_available()` returned False, and renders took hours on the CPU. Check inside the container, not on the host.
An unpinned dependency. A mediapipe upgrade removed `mediapipe.solutions`. The health check only tested the import, so it kept reporting pose estimation as healthy while the service silently fell back to a centred paste. A probe must test the attribute actually used, not the package.
The service now picks fp16 only when the GPU actually accelerates it (Volta and newer, or P100), or when fp32 would not fit in VRAM — on a 4 GB card, fp16 is still what makes the model fit. An environment variable can force either. A virtual try-on now takes one to two minutes, queue included.
The same P40 also serves a vision model (Qwen3-VL-8B-Instruct) that recognises garments and writes the stylist's advice. It used to run under Ollama; on this machine (Debian 13, driver 550), Ollama turned out to be a dead end, for three reasons measured on 29 September 2026.
A version frozen by the driver. From 0.13 on, Ollama needs a 570 driver to run a Pascal card, and versions 0.30 to 0.32 load everything on the CPU when a P40 is present (a regression reported on Ollama's repository, issue 17290). That left 0.12.11, too old for recent models.
A forced context. With qwen3-vl, Ollama 0.12 sets the context to 8192 whatever `num_ctx` says: 12 GB of VRAM for an 8-billion-parameter model.
A misleading tag. The `qwen3-vl:8b` tag is the "thinking" variant, which returned empty answers to our JSON requests; you need the instruct variant.
Ollama embeds llama.cpp. Replacing it with `llama-server` (llama.cpp built for CUDA 12, GGUF Q4_K_M weights plus the mmproj projector) fixes all three: a context that really stays at 4096, any recent model, an OpenAI-compatible API. On a bench of 26 garment photos, Qwen3-VL under llama-server recognises as well as the old Ollama + Qwen2.5-VL pair (type 26/26, colour 22/26), in 1.3 s instead of 2.9 s and with 6.4 GB instead of 7.6. One detail: llama-server does not read WebP, so images go out as JPEG.
The other engines are not an option on this card: vLLM needs compute capability 7.0 at least, so do SGLang and TGI, TensorRT-LLM starts at Ampere, and ExLlamaV2 computes in fp16, hence at 1/64 of the throughput. KoboldCpp, LocalAI and LM Studio do run, but they are layers on top of llama.cpp.
A second-hand P40 is a frozen target, not a machine to keep up to date.
Driver: the R580 branch is the last one to support Pascal. A 590 or newer branch will no longer recognise it.
CUDA: CUDA 13 dropped Pascal. llama.cpp and Ollama run as CUDA 12 builds.
PyTorch: the cu128 and cu129 wheels no longer ship sm_61 kernels; cu126 is the last official wheel that has them. Our try-on service stays on torch 2.1.2 cu118, and any model that requires a recent torch or bf16 is ruled out from the start.
Memory: the card permanently holds the language model (6.4 GB) and Leffa with background removal (8.8 GB), about 15 GB out of 23 at rest. A budget is counted at the peak: BiRefNet background removal at 1024×1024 alone costs ~6 GB of activations, and the full version made every cut-out fail until we switched to the "lite" one.
For anyone reviving an old datacenter card: measure before applying the usual advice. A five-minute measurement would have saved a month of 21-minute renders. And for language models, go to the engine (llama.cpp) rather than the wrapper: on a card vendors are abandoning, it is the one that keeps up longest.
Fring is a free digital wardrobe: photograph a garment, the AI fills in the details, the app builds outfits from what you own and tracks each piece's cost per wear.