Skip to content

Commit 7a83c6a

Browse files
committed
Fix VIRTUAL_ENV not set during ComfyUI-Zluda installation
The install-sm.bat script requires VIRTUAL_ENV to be set for ZLUDA DLL patching to work correctly. Without this, the DLL copy commands fail silently, leaving original NVIDIA libraries unchanged and causing cublas errors during generation. This fix adds VIRTUAL_ENV=venv to the environment variables passed to the installation batch script.
1 parent df1a3ac commit 7a83c6a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

StabilityMatrix.Core/Models/Packages/ComfyZluda.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ await newInstallBatPath
109109
[],
110110
installLocation,
111111
onConsoleOutput,
112-
GetEnvVars(true)
112+
GetEnvVars(true, installLocation)
113113
);
114114
await installProcess.WaitForExitAsync(cancellationToken).ConfigureAwait(false);
115115

@@ -141,7 +141,7 @@ await SetupVenv(installLocation, pythonVersion: PyVersion.Parse(installedPackage
141141
args,
142142
installLocation,
143143
HandleConsoleOutput,
144-
GetEnvVars(false)
144+
GetEnvVars(false, installLocation)
145145
);
146146

147147
return;
@@ -184,7 +184,7 @@ await zludaProcess
184184
GC.SuppressFinalize(this);
185185
}
186186

187-
private Dictionary<string, string> GetEnvVars(bool isInstall)
187+
private Dictionary<string, string> GetEnvVars(bool isInstall, string installLocation)
188188
{
189189
var portableGitBin = new DirectoryPath(PrerequisiteHelper.GitBinPath);
190190
var hipPath = Path.Combine(
@@ -202,6 +202,11 @@ private Dictionary<string, string> GetEnvVars(bool isInstall)
202202
["GIT"] = portableGitBin.JoinFile("git.exe"),
203203
};
204204

205+
if (isInstall)
206+
{
207+
envVars["VIRTUAL_ENV"] = "venv";
208+
}
209+
205210
if (envVars.TryGetValue("PATH", out var pathValue))
206211
{
207212
envVars["PATH"] = Compat.GetEnvPathWithExtensions(hipBinPath, portableGitBin, pathValue);

0 commit comments

Comments
 (0)