{"record":{"id":"8771fbb5186d7ac2","repo":"LykosAI/StabilityMatrix","slug":"could-not-find-cuda-toolkit-please-install-version-12-6-or","errorCode":null,"errorMessage":"Could not find CUDA Toolkit. Please install version 12.6 or newer from the link below.","messagePattern":"Could not find CUDA Toolkit\\. Please install version 12\\.6 or newer from the link below\\.","errorType":"exception","errorClass":"MissingPrerequisiteException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs","lineNumber":161,"sourceCode":"                \"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            {\n                throw new MissingPrerequisiteException(\n                    \"CUDA Toolkit\",\n                    \"Could not find CUDA Toolkit. Please install version 12.6 or newer from the link below.\",\n                    \"https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64\"\n                );\n            }\n\n            nvccPath = cuda128ExpectedPath.Exists\n                ? cuda128ExpectedPath.JoinFile(\"nvcc.exe\").ToString()\n                : cuda126ExpectedPath.JoinFile(\"nvcc.exe\").ToString();\n        }\n\n        venvRunner.UpdateEnvironmentVariables(env =>\n        {\n            var cudaBinPath = Path.GetDirectoryName(nvccPath)!;\n            var cudaHome = Path.GetDirectoryName(cudaBinPath)!;\n\n            env = env.TryGetValue(\"PATH\", out var pathValue)\n                ? env.SetItem(\"PATH\", $\"{cudaBinPath}{Path.PathSeparator}{pathValue}\")","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs#L143-L179","documentation":"Compiling Triton/SageAttention from source requires the NVIDIA CUDA Toolkit; the step checks the standard v12.6 and v12.8 install paths and throws MissingPrerequisiteException if neither exists.","triggerScenarios":"ExecuteAsync reaches the source-build path on Windows and neither C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin nor v12.8\\bin exists.","commonSituations":"CUDA Toolkit not installed; CUDA installed in a non-default directory (so the path check misses it); a CUDA version outside 12.6/12.8 (e.g. 11.x or 13.x) installed at a different path.","solutions":["Install CUDA Toolkit 12.6+ from https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64 to the default path","If CUDA is already installed elsewhere, add/verify the standard path or update the expected paths in the step","Ensure the installed CUDA major.minor is 12.6 or 12.8 which the step recognizes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool cudaOk = Directory.Exists(@\"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\")\n           || Directory.Exists(@\"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.8\\bin\");\nif (!cudaOk) promptCudaInstall();","typeGuard":null,"tryCatchPattern":"try { await step.ExecuteAsync(progress); } catch (MissingPrerequisiteException ex) { ui.ShowPrerequisiteDialog(ex.Name, ex.Message, ex.Url); }","preventionTips":["Install CUDA Toolkit 12.6+ to the default path before source builds","Verify CUDA install location matches expected standard paths","Run prerequisite detection before offering Triton/SageAttention"],"tags":["csharp","cuda","windows","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"}