services.slurm: fix

This commit is contained in:
2024-03-12 23:57:59 +08:00
parent 9de690ef37
commit d44c026ab4
3 changed files with 7 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ inputs:
wireguardIp = "192.168.83.3";
};
gamemode = { enable = true; drmDevice = 1; };
slurm = { enable = true; cpu = { cores = 16; threads = 2; }; memoryMB = 94208; gpus."4060" = 1; };
slurm = { enable = true; cpu = { cores = 16; threads = 2; }; memoryMB = 90112; gpus."4060" = 1; };
xrdp =
{
enable = true;

View File

@@ -54,6 +54,11 @@ let
module use ${oneapi}/share/intel/modulefiles
module load tbb compiler-rt oclfpga # dependencies
module load mpi mkl compiler
# if SLURM_CPUS_PER_TASK and SLURM_THREADS_PER_CPU are set, use them to set OMP_NUM_THREADS
if [ -n "''${SLURM_CPUS_PER_TASK-}" ] && [ -n "''${SLURM_THREADS_PER_CPU-}" ]; then
export OMP_NUM_THREADS=$(( SLURM_CPUS_PER_TASK * SLURM_THREADS_PER_CPU ))
fi
exec "$@"
'';
runEnv = version: buildFHSEnv

View File

@@ -61,6 +61,7 @@ inputs:
''
echo export CUDA_DEVICE_ORDER=PCI_BUS_ID
echo export SLURM_THREADS_PER_CPU=${builtins.toString slurm.cpu.threads}
echo export I_MPI_PMI_LIBRARY=${inputs.config.services.slurm.package}/lib/slurm/mpi_pmi2.so
'';
in
''