stride3d/stride · error · InvalidOperationException

No PIX installation found.

Error message

No PIX installation found.

What it means

Thrown by WinPixNative.LoadPixGpuCapturer when the "Microsoft PIX" directory exists but contains no versioned subdirectories, so no WinPixGpuCapturer.dll path can be produced. It indicates a broken or partial PIX installation.

Solutions

  1. Reinstall/repair Microsoft PIX so at least one versioned folder containing WinPixGpuCapturer.dll exists.
  2. Delete the leftover empty "Microsoft PIX" folder and reinstall cleanly.
  3. Guard the PIX capture init with try/catch on InvalidOperationException and continue without GPU capture.

Example fix

// before
PixNative.Initialize();
// after
try { PixNative.Initialize(); }
catch (InvalidOperationException ex) { log.Warn("PIX capture unavailable: " + ex.Message); }
Defensive patterns

Strategy: fallback

Validate before calling

var pixDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft PIX");
var hasVersion = Directory.Exists(pixDir) && Directory.EnumerateDirectories(pixDir).Any();
if (!hasVersion) { log.Warn("No usable PIX version found; capture disabled"); return; }

Type guard

bool HasPixVersion() =>
    Directory.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft PIX"))
    && Directory.EnumerateDirectories(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft PIX")).Any();

Try / catch

try { WinPixNative.Initialize(); }
catch (InvalidOperationException ex) { log.Warn("PIX install broken: " + ex.Message); }

Prevention

When it happens

Trigger: PIX directory exists under Program Files but is empty or contains only non-versioned folders/files — e.g. leftover folder after uninstall, partially completed install, or manually created directory.

Common situations: Manual cleanup/rollback of PIX installations; disk cleanup tools removing version folders; enterprise images with stub directories.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/74048b9770ed6bfd. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Graphics/Direct3D12/WinPixNative.cs:106

                throw new DirectoryNotFoundException($"Microsoft PIX not found under \"{programFilesPath}\".");

            string newestVersionFound = null;

            // Enumerate all subdirectories, looking for the one with the highest version number
            foreach (var dir in Directory.EnumerateDirectories(pixInstallationPath))
            {
                var dirName = Path.GetFileName(dir);
                if (string.IsNullOrEmpty(dirName))
                    continue;

                if (newestVersionFound is null || string.CompareOrdinal(newestVersionFound, dirName) < 0)
                {
                    newestVersionFound = dirName;
                }
            }

            if (string.IsNullOrEmpty(newestVersionFound))
                throw new InvalidOperationException("No PIX installation found.");

            // Return full path to WinPixGpuCapturer.dll
            string dllPath = Path.Combine(pixInstallationPath, newestVersionFound, CapturerDllName);
            return dllPath;
        }
    }


    /// <summary>
    ///   Ends the current PIX event on the specified Direct3D 12 Command List.
    /// </summary>
    /// <param name="commandList">
    ///   The Direct3D 12 Command List on which to end the PIX event. Must not be <see langword="null"/>.
    /// </param>
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    internal static unsafe void PIXEndEventOnCommandList(ComPtr<ID3D12GraphicsCommandList7> commandList)
    {
        PIXEndEventOnCommandList((nint) commandList.Handle);

View on GitHub (pinned to 96fad776d2)