forked from rarias/bscpkgs
Rename xeon08 to eudy
From Eudyptula, a little penguin.
This commit is contained in:
37
m/eudy/configuration.nix
Normal file
37
m/eudy/configuration.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ config, pkgs, lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../common/main.nix
|
||||
#(modulesPath + "/installer/netboot/netboot-minimal.nix")
|
||||
|
||||
./kernel/kernel.nix
|
||||
./cpufreq.nix
|
||||
./fs.nix
|
||||
./users.nix
|
||||
./slurm.nix
|
||||
];
|
||||
|
||||
# Select this using the ID to avoid mismatches
|
||||
boot.loader.grub.device = "/dev/disk/by-id/wwn-0x55cd2e414d53564b";
|
||||
|
||||
# disable automatic garbage collector
|
||||
nix.gc.automatic = lib.mkForce false;
|
||||
|
||||
# members of the tracing group can use the lttng-provided kernel events
|
||||
# without root permissions
|
||||
users.groups.tracing.members = [ "arocanon" ];
|
||||
|
||||
# set up both ethernet and infiniband ips
|
||||
networking = {
|
||||
hostName = "eudy";
|
||||
interfaces.eno1.ipv4.addresses = [ {
|
||||
address = "10.0.40.8";
|
||||
prefixLength = 24;
|
||||
} ];
|
||||
interfaces.ibp5s0.ipv4.addresses = [ {
|
||||
address = "10.0.42.8";
|
||||
prefixLength = 24;
|
||||
} ];
|
||||
};
|
||||
}
|
||||
40
m/eudy/cpufreq.nix
Normal file
40
m/eudy/cpufreq.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
# Disable frequency boost by default. Use the intel_pstate driver instead of
|
||||
# acpi_cpufreq driver because the acpi_cpufreq driver does not read the
|
||||
# complete range of P-States [1]. Use the intel_pstate passive mode [2] to
|
||||
# disable HWP, which allows a core to "select P-states by itself". Also, this
|
||||
# disables intel governors, which confusingly, have the same names as the
|
||||
# generic ones but behave differently [3].
|
||||
|
||||
# Essentially, we use the generic governors, but use the intel driver to read
|
||||
# the P-state list.
|
||||
|
||||
# [1] - https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_pstate.html#intel-pstate-vs-acpi-cpufreq
|
||||
# [2] - https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_pstate.html#passive-mode
|
||||
# [3] - https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_pstate.html#active-mode
|
||||
# https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html
|
||||
|
||||
# set intel_pstate to passive mode
|
||||
boot.kernelParams = [
|
||||
"intel_pstate=passive"
|
||||
];
|
||||
# Disable frequency boost
|
||||
system.activationScripts = {
|
||||
disableFrequencyBoost.text = ''
|
||||
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
|
||||
'';
|
||||
};
|
||||
|
||||
## disable intel_pstate
|
||||
#boot.kernelParams = [
|
||||
# "intel_pstate=disable"
|
||||
#];
|
||||
## Disable frequency boost
|
||||
#system.activationScripts = {
|
||||
# disableFrequencyBoost.text = ''
|
||||
# echo 0 > /sys/devices/system/cpu/cpufreq/boost
|
||||
# '';
|
||||
#};
|
||||
}
|
||||
13
m/eudy/fs.nix
Normal file
13
m/eudy/fs.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-label/optane";
|
||||
fsType = "ext4";
|
||||
neededForBoot = true;
|
||||
};
|
||||
fileSystems."/mnt/data" = {
|
||||
device = "/dev/disk/by-label/data";
|
||||
fsType = "ext4";
|
||||
};
|
||||
}
|
||||
68
m/eudy/kernel/kernel.nix
Normal file
68
m/eudy/kernel/kernel.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
#fcs-devel = pkgs.linuxPackages_custom {
|
||||
# version = "6.2.8";
|
||||
# src = /mnt/data/kernel/fcs/kernel/src;
|
||||
# configfile = /mnt/data/kernel/fcs/kernel/configs/defconfig;
|
||||
#};
|
||||
|
||||
#fcsv1 = fcs-kernel "bc11660676d3d68ce2459b9fb5d5e654e3f413be" false;
|
||||
#fcsv2 = fcs-kernel "db0f2eca0cd57a58bf456d7d2c7d5d8fdb25dfb1" false;
|
||||
#fcsv1-lockdep = fcs-kernel "bc11660676d3d68ce2459b9fb5d5e654e3f413be" true;
|
||||
#fcsv2-lockdep = fcs-kernel "db0f2eca0cd57a58bf456d7d2c7d5d8fdb25dfb1" true;
|
||||
#fcs-kernel = gitCommit: lockdep: pkgs.linuxPackages_custom {
|
||||
# version = "6.2.8";
|
||||
# src = builtins.fetchGit {
|
||||
# url = "git@bscpm03.bsc.es:ompss-kernel/linux.git";
|
||||
# rev = gitCommit;
|
||||
# ref = "fcs";
|
||||
# };
|
||||
# configfile = if lockdep then ./configs/lockdep else ./configs/defconfig;
|
||||
#};
|
||||
|
||||
kernel = nixos-fcsv2;
|
||||
|
||||
nixos-fcs-kernel = {gitCommit, lockStat ? false, preempt ? false}: pkgs.linuxPackagesFor (pkgs.buildLinux rec {
|
||||
version = "6.2.8";
|
||||
src = builtins.fetchGit {
|
||||
url = "git@bscpm03.bsc.es:ompss-kernel/linux.git";
|
||||
rev = gitCommit;
|
||||
ref = "fcs";
|
||||
};
|
||||
structuredExtraConfig = with lib.kernel; {
|
||||
# add general custom kernel options here
|
||||
} // lib.optionalAttrs lockStat {
|
||||
LOCK_STAT = yes;
|
||||
} // lib.optionalAttrs preempt {
|
||||
PREEMPT = lib.mkForce yes;
|
||||
PREEMPT_VOLUNTARY = lib.mkForce no;
|
||||
};
|
||||
kernelPatches = [];
|
||||
extraMeta.branch = lib.versions.majorMinor version;
|
||||
});
|
||||
|
||||
nixos-fcsv1 = nixos-fcs-kernel {gitCommit = "bc11660676d3d68ce2459b9fb5d5e654e3f413be";};
|
||||
nixos-fcsv2 = nixos-fcs-kernel {gitCommit = "db0f2eca0cd57a58bf456d7d2c7d5d8fdb25dfb1";};
|
||||
nixos-fcsv1-lockstat = nixos-fcs-kernel {
|
||||
gitCommit = "bc11660676d3d68ce2459b9fb5d5e654e3f413be";
|
||||
lockStat = true;
|
||||
};
|
||||
nixos-fcsv2-lockstat = nixos-fcs-kernel {
|
||||
gitCommit = "db0f2eca0cd57a58bf456d7d2c7d5d8fdb25dfb1";
|
||||
lockStat = true;
|
||||
};
|
||||
nixos-fcsv2-lockstat-preempt = nixos-fcs-kernel {
|
||||
gitCommit = "db0f2eca0cd57a58bf456d7d2c7d5d8fdb25dfb1";
|
||||
lockStat = true;
|
||||
preempt = true;
|
||||
};
|
||||
latest = pkgs.linuxPackages_latest;
|
||||
|
||||
in {
|
||||
imports = [
|
||||
./lttng.nix
|
||||
./perf.nix
|
||||
];
|
||||
boot.kernelPackages = lib.mkForce kernel;
|
||||
}
|
||||
43
m/eudy/kernel/lttng.nix
Normal file
43
m/eudy/kernel/lttng.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
|
||||
# The lttng btrfs probe crashes at compile time because of an undefined
|
||||
# function. This disables the btrfs tracepoints to avoid the issue.
|
||||
|
||||
# Also enable lockdep tracepoints, this is disabled by default because it
|
||||
# does not work well on architectures other than x86_64 (i think that arm) as
|
||||
# I was told on the mailing list.
|
||||
lttng-modules-fixed = config.boot.kernelPackages.lttng-modules.overrideAttrs (finalAttrs: previousAttrs: {
|
||||
patchPhase = (lib.optionalString (previousAttrs ? patchPhase) previousAttrs.patchPhase) + ''
|
||||
# disable btrfs
|
||||
substituteInPlace src/probes/Kbuild \
|
||||
--replace " obj-\$(CONFIG_LTTNG) += lttng-probe-btrfs.o" " #obj-\$(CONFIG_LTTNG) += lttng-probe-btrfs.o"
|
||||
|
||||
# enable lockdep tracepoints
|
||||
substituteInPlace src/probes/Kbuild \
|
||||
--replace "#ifneq (\$(CONFIG_LOCKDEP),)" "ifneq (\$(CONFIG_LOCKDEP),)" \
|
||||
--replace "# obj-\$(CONFIG_LTTNG) += lttng-probe-lock.o" " obj-\$(CONFIG_LTTNG) += lttng-probe-lock.o" \
|
||||
--replace "#endif # CONFIG_LOCKDEP" "endif # CONFIG_LOCKDEP"
|
||||
'';
|
||||
});
|
||||
in {
|
||||
|
||||
# add the lttng tools and modules to the system environment
|
||||
boot.extraModulePackages = [ lttng-modules-fixed ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
lttng-tools lttng-ust babeltrace
|
||||
];
|
||||
|
||||
# start the lttng root daemon to manage kernel events
|
||||
systemd.services.lttng-sessiond = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "LTTng session daemon for the root user";
|
||||
serviceConfig = {
|
||||
User = "root";
|
||||
ExecStart = ''
|
||||
${pkgs.lttng-tools}/bin/lttng-sessiond
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
22
m/eudy/kernel/perf.nix
Normal file
22
m/eudy/kernel/perf.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# add the perf tool
|
||||
environment.systemPackages = with pkgs; [
|
||||
config.boot.kernelPackages.perf
|
||||
];
|
||||
|
||||
# allow non-root users to read tracing data from the kernel
|
||||
boot.kernel.sysctl."kernel.perf_event_paranoid" = -2;
|
||||
boot.kernel.sysctl."kernel.kptr_restrict" = 0;
|
||||
|
||||
# specify additionl options to the tracefs directory to allow members of the
|
||||
# tracing group to access tracefs.
|
||||
fileSystems."/sys/kernel/tracing" = {
|
||||
options = [
|
||||
"mode=755"
|
||||
"gid=tracing"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
7
m/eudy/slurm.nix
Normal file
7
m/eudy/slurm.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
services.slurm = {
|
||||
client.enable = lib.mkForce false;
|
||||
};
|
||||
}
|
||||
11
m/eudy/users.nix
Normal file
11
m/eudy/users.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
security.sudo.extraRules= [{
|
||||
users = [ "arocanon" ];
|
||||
commands = [{
|
||||
command = "ALL" ;
|
||||
options= [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
|
||||
}];
|
||||
}];
|
||||
}
|
||||
Reference in New Issue
Block a user