summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/science/molecular-dynamics
diff options
context:
space:
mode:
authorSomeone Serge <sergei.kozlukov@aalto.fi>2023-11-28 00:12:07 +0000
committerSomeone Serge <sergei.kozlukov@aalto.fi>2023-12-04 20:24:32 +0000
commit31f1b517cdea429dc7a6c212ca650ea184c75a93 (patch)
tree9404f267ca573dd8fd8287a6efe36777109b4be4 /pkgs/applications/science/molecular-dynamics
parent58819d631edc8ffa5658ef025e1b1c04903cc43f (diff)
gromacs: drop cudatoolkit.run
Diffstat (limited to 'pkgs/applications/science/molecular-dynamics')
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix32
1 files changed, 27 insertions, 5 deletions
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index e669562c9cc7..1daeeb81410a 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -1,4 +1,14 @@
-{ lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, hwloc
+, fftw
+, perl
+, blas
+, lapack
+, mpi
+, cudaPackages
, plumed
, singlePrec ? true
, config
@@ -9,6 +19,8 @@
}:
let
+ inherit (cudaPackages.cudaFlags) cudaCapabilities dropDot;
+
# Select reasonable defaults for all major platforms
# The possible values are defined in CMakeLists.txt:
# AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256
@@ -52,7 +64,7 @@ in stdenv.mkDerivation rec {
nativeBuildInputs =
[ cmake ]
++ lib.optional enablePlumed plumed
- ;
+ ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
buildInputs = [
fftw
@@ -61,13 +73,17 @@ in stdenv.mkDerivation rec {
blas
lapack
] ++ lib.optional enableMpi mpi
- ++ lib.optional enableCuda cudatoolkit
- ;
+ ++ lib.optionals enableCuda [
+ cudaPackages.cuda_cudart
+ cudaPackages.libcufft
+ cudaPackages.cuda_profiler_api
+ ];
propagatedBuildInputs = lib.optional enableMpi mpi;
propagatedUserEnvPkgs = lib.optional enableMpi mpi;
cmakeFlags = [
+ (lib.cmakeBool "GMX_HWLOC" true)
"-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
"-DGMX_OPENMP:BOOL=TRUE"
"-DBUILD_SHARED_LIBS=ON"
@@ -87,7 +103,13 @@ in stdenv.mkDerivation rec {
else [
"-DGMX_MPI:BOOL=FALSE"
]
- ) ++ lib.optional enableCuda "-DGMX_GPU=CUDA";
+ ) ++ lib.optionals enableCuda [
+ "-DGMX_GPU=CUDA"
+ (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+
+ # Gromacs seems to ignore and override the normal variables, so we add this ad hoc:
+ (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+ ];
postInstall = ''
moveToOutput share/cmake $dev