{"record":{"id":"4fabdce41ec8fc49","repo":"LykosAI/StabilityMatrix","slug":"could-not-find-visual-studio-2022-build-tools-please-install","errorCode":null,"errorMessage":"Could not find Visual Studio 2022 Build Tools. Please install them from the link below.","messagePattern":"Could not find Visual Studio 2022 Build Tools\\. Please install them from the link below\\.","errorType":"exception","errorClass":"MissingPrerequisiteException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs","lineNumber":142,"sourceCode":"        var pipArgs = new PipInstallArgs(\"triton-windows\");\n\n        if (!string.IsNullOrWhiteSpace(sageWheelUrl))\n        {\n            pipArgs = pipArgs.AddArg(sageWheelUrl);\n\n            progress?.Report(\n                new ProgressReport(-1f, message: \"Installing Triton & SageAttention\", isIndeterminate: true)\n            );\n\n            await venvRunner.PipInstall(pipArgs, progress.AsProcessOutputHandler()).ConfigureAwait(false);\n\n            return;\n        }\n\n        // no wheels, gotta build\n        if (!prerequisiteHelper.IsVcBuildToolsInstalled)\n        {\n            throw new MissingPrerequisiteException(\n                \"Visual Studio 2022 Build Tools\",\n                \"Could not find Visual Studio 2022 Build Tools. Please install them from the link below.\",\n                \"https://aka.ms/vs/17/release/vs_BuildTools.exe\"\n            );\n        }\n\n        var nvccPath = await Utilities.WhichAsync(\"nvcc\").ConfigureAwait(false);\n        if (string.IsNullOrWhiteSpace(nvccPath))\n        {\n            var cuda126ExpectedPath = new DirectoryPath(\n                @\"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\"\n            );\n            var cuda128ExpectedPath = new DirectoryPath(\n                @\"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.8\\bin\"\n            );\n\n            if (!cuda126ExpectedPath.Exists && !cuda128ExpectedPath.Exists)\n            {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs#L124-L160","documentation":"When no prebuilt wheels are available, InstallSageAttentionStep falls back to compiling from source, which requires Visual Studio 2022 Build Tools. If prerequisiteHelper.IsVcBuildToolsInstalled is false, MissingPrerequisiteException is thrown with the download link.","triggerScenarios":"ExecuteAsync on Windows with no matching prebuilt wheels and no VS2022 Build Tools installed, so compilation prerequisites are missing.","commonSituations":"Fresh Windows installs without development tools; users declined Build Tools during earlier setups; CUDA/torch source builds triggered by unusual Python versions lacking wheels.","solutions":["Install VS2022 Build Tools from https://aka.ms/vs/17/release/vs_BuildTools.exe (include C++ workload)","Rerun the install step after Build Tools are present","Use a Python version for which prebuilt SageAttention wheels exist to avoid compilation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!prerequisiteHelper.IsVcBuildToolsInstalled)\n    await installer.LaunchVsBuildToolsSetup();","typeGuard":null,"tryCatchPattern":"try { await step.ExecuteAsync(progress); } catch (MissingPrerequisiteException ex) { ui.ShowPrerequisiteDialog(ex.Name, ex.Message, ex.Url); }","preventionTips":["Run a prerequisite check (Build Tools, CUDA) before source builds","Prefer Python versions with prebuilt wheels to avoid compilation","Prompt users to install Build Tools early in setup"],"tags":["csharp","windows","build-tools","prerequisite"],"backgroundTag":"missing-dependency","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}