mirror of
https://github.com/virchau13/automatic1111-webui-nix.git
synced 2024-10-05 20:08:25 +03:00
a2e79fcaf7
On Apple silicon, the CPU path is still hardware accelerated.
44 lines
1.1 KiB
Nix
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";
|
|
}
|