Skip to content

Commit

Permalink
fix: blender runtime crash - NixOS/nixpkgs#340100
Browse files Browse the repository at this point in the history
fix:  advanced-scene-switcher failed to compile, persist blender user directory
  • Loading branch information
ryan4yin committed Sep 19, 2024
1 parent 9b9ad93 commit 19a917f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 29 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion home/linux/gui/base/creative.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
obs-command-source
obs-move-transition
obs-backgroundremoval
advanced-scene-switcher
# advanced-scene-switcher
obs-pipewire-audio-capture
];
};
Expand Down
22 changes: 1 addition & 21 deletions hosts/idols-ai/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ in {
./netdev-mount.nix
# Include the results of the hardware scan.
./hardware-configuration.nix
./nvidia.nix

./impermanence.nix
./secureboot.nix
Expand All @@ -28,27 +29,6 @@ in {
# conflict with feature: containerd-snapshotter
# virtualisation.docker.storageDriver = "btrfs";

# for Nvidia GPU
services.xserver.videoDrivers = ["nvidia"]; # will install nvidia-vaapi-driver by default
hardware.nvidia = {
open = false;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix
# package = config.boot.kernelPackages.nvidiaPackages.stable;

# required by most wayland compositors!
modesetting.enable = true;
powerManagement.enable = true;
};
hardware.nvidia-container-toolkit.enable = true;
hardware.graphics = {
enable = true;
# needed by nvidia-docker
enable32Bit = true;
};
# https://nixos.org/manual/nixpkgs/unstable/#opt-cudaSupport
nixpkgs.config.cudaSupport = true;

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
Expand Down
1 change: 0 additions & 1 deletion hosts/idols-ai/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; # kvm virtualization support
boot.extraModprobeConfig = "options kvm_intel nested=1"; # for intel cpu
boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
boot.extraModulePackages = [];
# clear /tmp on boot to get a stateless /tmp directory.
boot.tmp.cleanOnBoot = true;
Expand Down
3 changes: 3 additions & 0 deletions hosts/idols-ai/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
# neovim plugins(wakatime & copilot)
".wakatime"
".config/github-copilot"

# others
".config/blender"
];
files = [
".wakatime.cfg"
Expand Down
41 changes: 41 additions & 0 deletions hosts/idols-ai/nvidia.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{pkgs-unstable, ...}: {
# ===============================================================================================
# for Nvidia GPU
# ===============================================================================================

boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
services.xserver.videoDrivers = ["nvidia"]; # will install nvidia-vaapi-driver by default
hardware.nvidia = {
open = false;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix
# package = config.boot.kernelPackages.nvidiaPackages.stable;

# required by most wayland compositors!
modesetting.enable = true;
powerManagement.enable = true;
};
hardware.nvidia-container-toolkit.enable = true;
hardware.graphics = {
enable = true;
# needed by nvidia-docker
enable32Bit = true;
};
# disable cudasupport before this issue get fixed:
# https://github.com/NixOS/nixpkgs/issues/338315
nixpkgs.config.cudaSupport = false;

nixpkgs.overlays = [
(_: super: {
blender = super.blender.override {
# https://nixos.org/manual/nixpkgs/unstable/#opt-cudaSupport
cudaSupport = true;
waylandSupport = true;
};

# ffmpeg-full = super.ffmpeg-full.override {
# withNvcodec = true;
# };
})
];
}

0 comments on commit 19a917f

Please sign in to comment.