galadriel uncommited changes ai stuff

This commit is contained in:
Adrian Gunnar Lauterer 2024-12-07 14:34:16 +01:00
parent 9fec5b56e8
commit a7277567d4
9 changed files with 37 additions and 39 deletions

6
home/common/unfree.nix Normal file
View File

@ -0,0 +1,6 @@
{ pkgs, lib, config, ... }:
{
imports = [
];
nixpkgs.config.allowUnfree = true;
}

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
../common/sshconfig.nix ../common/sshconfig.nix
../common/unfree.nix
]; ];
programs.nix-index = { programs.nix-index = {

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
../common/sshconfig.nix ../common/sshconfig.nix
../common/unfree.nix
]; ];
programs.nix-index = { programs.nix-index = {

View File

@ -70,12 +70,11 @@
jftui jftui
sonixd sonixd
unpackerr unpackerr
qbittorrent-nox
python3 python3
python3Packages.torchWithCuda python3Packages.torchWithCuda
ollama ollama
unstable.qbittorrent-nox
]; ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;

View File

@ -9,45 +9,36 @@
# Load nvidia driver for Xorg and Wayland # Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["nvidia"];
#boot with nvidia kernel module
boot.initrd.kernelModules = [ "nvidia" ]; boot.initrd.kernelModules = [ "nvidia" ];
hardware.nvidia = { hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true; modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
#powerManagement.enable = true; #powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use. # Fine-grained power management. Turns off GPU when not in use. Experimental and only works on modern Nvidia GPUs (Turing or newer).
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
#powerManagement.finegrained = true; #powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the independent third-party "nouveau" open source driver).
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting. # Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false; open = false;
# Enable the Nvidia settings menu, # Enable the Nvidia settings menu, accessible via `nvidia-settings`.
# accessible via `nvidia-settings`.
#nvidiaSettings = true; #nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU. # Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
# Enable the CUDA toolkit # Enable the CUDA toolkit
#install packages #install packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
#cudaPackages.cudnn cudaPackages.cudnn
#cudaPackages.cudatoolkit cudaPackages.cudatoolkit
nvtopPackages.nvidia nvtopPackages.nvidia
#cudaPackages.tensorrt_8_6_0 #needs to be added manually, to the store and is a pain because of the license agreement and garbage collection #cudaPackages.tensorrt_8_6_0 #needs to be added manually, to the store and is a pain because of the license agreement and garbage collection
]; ];
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"cuda_cudart"
];
} }

View File

@ -29,7 +29,7 @@
# python3Packages.scikit-image # python3Packages.scikit-image
# python3Packages.traittypes # python3Packages.traittypes
# python3Packages.statsmodels # python3Packages.statsmodels
python3Packages.scikits-odes # python3Packages.scikits-odes
python3Packages.sympy python3Packages.sympy
python3Packages.numpy python3Packages.numpy
python3Packages.pandas python3Packages.pandas

View File

@ -1,10 +1,11 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
environment.systemPackages = [ environment.systemPackages = [
pkgs.ollama pkgs.unstable.ollama
]; ];
services.ollama.enable = true; services.ollama.enable = true;
services.ollama.package = pkgs.unstable.ollama;
services.ollama.listenAddress = "0.0.0.0:11434"; services.ollama.listenAddress = "0.0.0.0:11434";
services.ollama.models = "/var/lib/ollama/models"; services.ollama.models = "/var/lib/ollama/models";
services.ollama.home = "/var/lib/ollama"; services.ollama.home = "/var/lib/ollama";
@ -14,7 +15,6 @@
hostname = config.networking.hostName; hostname = config.networking.hostName;
in in
if hostname == "galadriel" then "cuda" if hostname == "galadriel" then "cuda"
else if hostname == "boromir" then "cuda"
else if hostname == "aragorn" then "rocm" else if hostname == "aragorn" then "rocm"
else null); else null);

View File

@ -118,7 +118,7 @@ in
serviceConfig = { serviceConfig = {
ExecStartPre = "${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/mkdir -p ${path} && ${pkgs.coreutils}/bin/chmod -R 755 ${path} && ${pkgs.coreutils}/bin/cp ${config.sops.templates."qbittorrent/configuration".path} ${path}/.config/qBittorrent/qBittorrent.conf'"; ExecStartPre = "${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/mkdir -p ${path} && ${pkgs.coreutils}/bin/chmod -R 755 ${path} && ${pkgs.coreutils}/bin/cp ${config.sops.templates."qbittorrent/configuration".path} ${path}/.config/qBittorrent/qBittorrent.conf'";
ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox"; ExecStart = "${pkgs.unstable.qbittorrent-nox}/bin/qbittorrent-nox";
User = "qbittorrent"; User = "qbittorrent";
Group = "media"; Group = "media";
Restart = "on-failure"; Restart = "on-failure";