Configure, build, and run benchmarks reproducibly.
I like the Determinate Systems installer, as well as their Zero to Nix guide.
Each configuration for a run should have its own config file. For example,
specrate_gcc.nix
contains a basic configuration that runs all
of the specrate
suite with Rivos's GCC.
For a SPEC config, there are a number of buildable attributes.
runsetup
: Results ofruncpu --action=runsetup
, which builds and creates run dirs.icount
: Runs the benchmark under qemu and collects instruction counts
NOTE: All examples below be run from this directory.
To get icounts for all of specrate:
# for GCC
nix build '.#specrate_gcc.icount' --max-jobs 32
If you're interested in just a single benchmark, there's no need to edit the config file. Just build the benchmark attributes directly!
nix build '.#gcc.config.icount.pkgs."525.x264_r"' # The quotes are necessary!
If you'd like to override the compiler, provide the --override-input
flag to nix build
.
This uses flake reference syntax; see examples below.
Example:
# Use a local git checkout
nix build --override-input rvv-gcc /path/to/gcc \
'.#specrate_rvv_gcc.config.icount.pkgs."525.x264_r"'