From 37073f017d6cfa683817c8be9c84d2f555957336 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 7 Jun 2024 10:25:07 +0200 Subject: [PATCH] Add raccoon workstation with Nvidia GPU The raccoon workstation has a Nvidia GTX 960 GPU which will be used for CUDA experiments. The configuration uses the production Nvidia driver at version 550 which still supports the GPU. The current CUDA 12.2 version is also supported by the driver. The workstation has Internet access directly from the gateway, but name resolution via Google DNS servers seems to be blocked, so we use BSC servers for now. The NixOS system is installed in a partition alongside the old Debian system, until we decide that is no longer neccesary to keep both. The old /home partition is not used as we are using the same UIDs and groups from the xeon machines, which don't match the ones here. --- flake.nix | 15 ++++++++------- m/common/base/net.nix | 2 ++ m/common/base/users.nix | 2 +- m/raccoon/configuration.nix | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 m/raccoon/configuration.nix diff --git a/flake.nix b/flake.nix index 807721a2..9ff6538d 100644 --- a/flake.nix +++ b/flake.nix @@ -17,13 +17,14 @@ let in { nixosConfigurations = { - hut = mkConf "hut"; - owl1 = mkConf "owl1"; - owl2 = mkConf "owl2"; - eudy = mkConf "eudy"; - koro = mkConf "koro"; - bay = mkConf "bay"; - lake2 = mkConf "lake2"; + hut = mkConf "hut"; + owl1 = mkConf "owl1"; + owl2 = mkConf "owl2"; + eudy = mkConf "eudy"; + koro = mkConf "koro"; + bay = mkConf "bay"; + lake2 = mkConf "lake2"; + raccoon = mkConf "raccoon"; }; packages.x86_64-linux = self.nixosConfigurations.hut.pkgs // { diff --git a/m/common/base/net.nix b/m/common/base/net.nix index 0f575db1..6356ad32 100644 --- a/m/common/base/net.nix +++ b/m/common/base/net.nix @@ -12,6 +12,8 @@ hosts = { "84.88.53.236" = [ "ssfhead.bsc.es" "ssfhead" ]; + "84.88.51.152" = [ "knights3.bsc.es" "raccoon" ]; + "84.88.51.142" = [ "raccoon-ipmi" ]; }; }; } diff --git a/m/common/base/users.nix b/m/common/base/users.nix index a17969f2..71b9749e 100644 --- a/m/common/base/users.nix +++ b/m/common/base/users.nix @@ -68,7 +68,7 @@ home = "/home/Computational/anavarro"; description = "Antoni Navarro"; group = "Computational"; - hosts = [ "hut" ]; + hosts = [ "hut" "raccoon" ]; hashedPassword = "$6$QdNDsuLehoZTYZlb$CDhCouYDPrhoiB7/seu7RF.Gqg4zMQz0n5sA4U1KDgHaZOxy2as9pbIGeF8tOHJKRoZajk5GiaZv0rZMn7Oq31"; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILWjRSlKgzBPZQhIeEtk6Lvws2XNcYwHcwPv4osSgst5 anavarro@ssfhead" diff --git a/m/raccoon/configuration.nix b/m/raccoon/configuration.nix new file mode 100644 index 00000000..556e9ab5 --- /dev/null +++ b/m/raccoon/configuration.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, modulesPath, ... }: + +{ + imports = [ + ../common/base.nix + ]; + + # Don't install Grub on the disk yet + boot.loader.grub.device = "nodev"; + + networking = { + hostName = "raccoon"; + # Only BSC DNSs seem to be reachable from the office VLAN + nameservers = [ "84.88.52.35" "84.88.52.36" ]; + defaultGateway = "84.88.51.129"; + interfaces.eno0.ipv4.addresses = [ { + address = "84.88.51.152"; + prefixLength = 25; + } ]; + }; + + # Configure Nvidia driver to use with CUDA + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production; + hardware.opengl = { + enable = true; + driSupport = true; + setLdLibraryPath = true; + }; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.nvidia.acceptLicense = true; + services.xserver.videoDrivers = [ "nvidia" ]; +}