dotnet/runtime · error · RuntimeError

Pass only one tiering option.

Error message

Pass only one tiering option.

What it means

Raised by SuperPMICollect.__init__ in superpmi.py when both --tiered_compilation and --tiered_pgo are passed. tiered_pgo already implies tiered compilation (it sets both DOTNET_TieredCompilation=1 and DOTNET_TieredPGO=1), so specifying both is ambiguous and rejected.

Solutions

  1. Use --tiered_pgo alone (it enables tiered compilation + PGO).
  2. Or use --tiered_compilation alone if you do not want PGO.

Example fix

// before
python superpmi.py collect 'cmd' --tiered_compilation --tiered_pgo   # 'Pass only one tiering option.'
// after
python superpmi.py collect 'cmd' --tiered_pgo
Defensive patterns

Strategy: validation

Validate before calling

if args.tiered_compilation and args.tiered_pgo:
    raise SystemExit("Pass only one of --tiered_compilation or --tiered_pgo (tiered_pgo implies tiered compilation)")

Prevention

When it happens

Trigger: Invoking `superpmi.py collect ... --tiered_compilation --tiered_pgo` (via command-based collection, since pmi/crossgen2/nativeaot raise their own errors first).

Common situations: Enabling all tiering knobs 'just in case'; not realizing --tiered_pgo is a superset of --tiered_compilation.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/b5957df24715acf7. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/superpmi.py:726

            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)

        if coreclr_args.crossgen2:
            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)

        if coreclr_args.pmi or coreclr_args.crossgen2:
            self.assemblies = coreclr_args.assemblies
            self.exclude = coreclr_args.exclude
            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:
               raise RuntimeError("Tiering options have no effect for pmi or crossgen2 collections.")

        if coreclr_args.nativeaot:
            self.ilc_rsps = coreclr_args.ilc_rsps
            self.exclude = coreclr_args.exclude
            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:
                raise RuntimeError("Tiering options have no effect for nativeaot collections.")

        if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:
            raise RuntimeError("Pass only one tiering option.")

        self.coreclr_args = coreclr_args

        self.temp_location = None

        # Pathname for a temporary .MCL file used for noticing SuperPMI replay failures against base MCH.
        self.base_fail_mcl_file = None

        # The base .MCH file path
        self.base_mch_file = None

        # Final .MCH file path
        if self.coreclr_args.output_mch_path is not None:
            self.final_mch_file = os.path.abspath(self.coreclr_args.output_mch_path)
            final_mch_dir = os.path.dirname(self.final_mch_file)
            if not os.path.isdir(final_mch_dir):
                os.makedirs(final_mch_dir)
        else:

View on GitHub (pinned to 60108ba66e)