A J Greengrove

Resolving dynamic linker failures like libcublas.so.12 in containerized AI inference typically forces an unpalatable trade-off: bundle hundreds of un-cached C++ derivations via blanket CUDA flags, or accept opaque, non-reproducible container base images. Decoupling runtime user-space shared libraries from downstream compile-time toolchains in Nixpkgs eliminated dynamic linker aborts while dropping CI pipeline runtimes from 21m 54s to 2m 23s.

Executive Telemetry & Verification Proofs

Local Runner Emulation (act)

Remote GitHub Actions Telemetry

Symptoms, Root Causes and Remediations

Implementation Artifacts

 nixpkgs.legacyPackages.${system} = import nixpkgs {
   inherit system;
   config = {
     allowUnfree = true;
-    cudaSupport = true;
   };
 };
-pythonEnv = pkgs.python311.withPackages (ps: with ps; [ pip setuptools wheel pytest virtualenv ]);
+pythonEnv = pkgs.python3.withPackages (ps: [
+  (ps.buildPythonPackage {
+    pname = "faster-whisper";
+    version = "1.2.1";
+    src = ./.;
+    propagatedBuildInputs = with ps; [
+      ctranslate2
+      huggingface-hub
+      tokenizers
+      onnxruntime
+      av
+      tqdm
+    ];
+  })
+]);
 runtimeLibs = [
   pkgs.stdenv.cc.cc.lib
   pkgs.zlib
   pkgs.ffmpeg-headless
   pkgs.libsndfile
+  pkgs.cudaPackages.cudatoolkit
+  pkgs.cudaPackages.cudnn
+  pkgs.cudaPackages.libcublas
+  pkgs.cudaPackages.libcufft
+  pkgs.cudaPackages.libcurand
 ];

Platform Rules of Engagement

Local Reproduction Sequence

# Ensure .gitignore does not untrack flake.nix, source code, or required assets.
git add -N .
nix flake check
nix eval .#dockerImage.drvPath
nix develop --command python3 -c "import faster_whisper; print('Import OK:', faster_whisper.__file__)"
nix build .#dockerImage --dry-run
nix build .#dockerImage
docker load < result
docker run --rm faster-whisper:latest
act -j build-and-validate --container-architecture linux/amd64
gh repo set-default ajgreengrove/faster-whisper-ci-poc
gh run watch 35461703995

Reproduction Repository & Iteration Economics

A 19-minute delta on CI runs is rarely just a compute billing problem—it is a compounding tax on engineering focus, deployment frequency, and debugging cycles. Decoupling CUDA library ingestion from compilation inputs protects binary substituter cache hits while keeping container closures mathematically deterministic.