automatic1111-webui-nix/impl.nix
Jari Vetoniemi a2e79fcaf7
feat: add CPU and Apple Silicon support
On Apple silicon, the CPU path is still hardware accelerated.
2023-11-21 05:39:36 +08:00

44 lines
1.1 KiB
Nix

{ pkgs, variant ? "CUDA", ... }:
let
hardware_deps = with pkgs;
if variant == "CUDA" then [
cudatoolkit
linuxPackages.nvidia_x11
xorg.libXi
xorg.libXmu
freeglut
xorg.libXext
xorg.libX11
xorg.libXv
xorg.libXrandr
zlib
# for xformers
gcc
] else if variant == "ROCM" then [
rocm-runtime
pciutils
] else [];
in
pkgs.mkShell rec {
name = "stable-diffusion-webui";
buildInputs = with pkgs;
hardware_deps ++ [
git # The program instantly crashes if git is not present, even if everything is already downloaded
python310
stdenv.cc.cc.lib
stdenv.cc
ncurses5
binutils
gitRepo gnupg autoconf curl
procps gnumake util-linux m4 gperf unzip
libGLU libGL
glib
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
CUDA_PATH = pkgs.lib.optionalString (variant == "CUDA") pkgs.cudatoolkit;
EXTRA_LDFLAGS = pkgs.lib.optionalString (variant == "CUDA") "-L${pkgs.linuxPackages.nvidia_x11}/lib";
}