dotnet/runtime · error · RuntimeError

Tiering options have no effect for pmi or crossgen2…

Error message

Tiering options have no effect for pmi or crossgen2 collections.

What it means

Raised by SuperPMICollect.__init__ in superpmi.py when (--pmi or --crossgen2) is combined with (--tiered_compilation or --tiered_pgo). PMI and crossgen2 perform single-shot compilation, so tiered compilation / tiered PGO do not apply; the script rejects the combination outright.

Solutions

  1. Remove the tiering flags (--tiered_compilation / --tiered_pgo) when using --pmi or --crossgen2.
  2. If you need tiered behavior, collect via the command-based path (collection_command) instead of --pmi/--crossgen2.

Example fix

// before
python superpmi.py collect --pmi -assemblies <dir> --tiered_pgo   # 'Tiering options have no effect for pmi or crossgen2 collections.'
// after
python superpmi.py collect --pmi -assemblies <dir>
Defensive patterns

Strategy: validation

Validate before calling

if (args.pmi or args.crossgen2) and (args.tiered_compilation or args.tiered_pgo):
    raise SystemExit("--pmi/--crossgen2 cannot be combined with --tiered_compilation/--tiered_pgo")

Prevention

When it happens

Trigger: Invoking `superpmi.py collect --pmi --tiered_compilation ...` or `... --crossgen2 --tiered_pgo ...`.

Common situations: Copy-pasting a tiered collection invocation and adding --pmi/--crossgen2; misunderstanding that PMI/crossgen2 are ahead-of-time style single compilations where tiering is meaningless.

Related errors


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

Appendix: source

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

        self.superpmi_path = determine_superpmi_tool_path(coreclr_args)
        self.mcs_path = determine_mcs_tool_path(coreclr_args)

        self.collection_command = coreclr_args.collection_command
        self.collection_args = coreclr_args.collection_args

        if coreclr_args.pmi:
            self.pmi_location = determine_pmi_location(coreclr_args)
            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

View on GitHub (pinned to 60108ba66e)