Skip to content

Commit 4f5ecb3

Browse files
authored
Merge pull request LykosAI#1190 from ionite34/backport/main/pr-1189
[dev to main] backport: Add warnings for legacy Python in InvokeAI and NVIDIA driver versions… (1189)
2 parents 482a748 + 5907005 commit 4f5ecb3

File tree

6 files changed

+146
-6
lines changed

6 files changed

+146
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.15.6
9+
### Added
10+
- Added NVIDIA driver version warning when launching ComfyUI with CUDA 13.0 (cu130) and driver versions below 580.x
11+
- Added legacy Python warning when launching InvokeAI installations using Python 3.10.11
12+
### Changed
13+
- Disabled update checking for legacy InvokeAI installations using Python 3.10.11
14+
### Fixed
15+
- Hide rating stars in the Civitai browser page if no rating is available
16+
817
## v2.15.5
918
### Added
1019
- Added new package - [Wan2GP](https://github.com/deepbeepmeep/Wan2GP)

StabilityMatrix.Avalonia/Views/CivitAiBrowserPage.axaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@
351351
<Grid ColumnDefinitions="*, Auto">
352352
<StackPanel
353353
Grid.Row="0"
354-
Grid.Column="0"
354+
Grid.Column="1"
355+
IsVisible="{Binding CivitModel.ModelVersionStats.RatingCount, FallbackValue=False, TargetNullValue=False}"
355356
Orientation="Horizontal">
356357
<controls:StarsRating
357358
Margin="8,8,0,8"
@@ -368,9 +369,9 @@
368369

369370
<StackPanel
370371
Grid.Row="0"
371-
Grid.Column="1"
372-
Margin="0,0,8,0"
373-
HorizontalAlignment="Right"
372+
Grid.Column="0"
373+
Margin="8"
374+
HorizontalAlignment="Left"
374375
Orientation="Horizontal">
375376
<fa:Icon Value="fa-solid fa-heart" />
376377
<TextBlock

StabilityMatrix.Core/Helper/HardwareInfo/HardwareHelper.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,41 @@ public static IEnumerable<GpuInfo> IterGpuInfo(bool forceRefresh = false)
247247
return gpuInfos;
248248
}
249249

250+
/// <summary>
251+
/// Gets the NVIDIA driver version using nvidia-smi.
252+
/// Returns null if nvidia-smi is not available or fails.
253+
/// </summary>
254+
public static Version? GetNvidiaDriverVersion()
255+
{
256+
try
257+
{
258+
var psi = new ProcessStartInfo
259+
{
260+
FileName = "nvidia-smi",
261+
UseShellExecute = false,
262+
Arguments = "--query-gpu=driver_version --format=csv,noheader",
263+
RedirectStandardOutput = true,
264+
CreateNoWindow = true,
265+
};
266+
267+
var process = Process.Start(psi);
268+
process?.WaitForExit();
269+
var stdout = process?.StandardOutput.ReadToEnd()?.Trim();
270+
271+
if (string.IsNullOrEmpty(stdout))
272+
return null;
273+
274+
// Driver version is typically in the format "xxx.xx" (e.g., "591.59")
275+
// We'll parse it as a Version object
276+
return Version.TryParse(stdout, out var version) ? version : null;
277+
}
278+
catch (Exception e)
279+
{
280+
Logger.Warn(e, "Failed to get NVIDIA driver version from nvidia-smi");
281+
return null;
282+
}
283+
}
284+
250285
/// <summary>
251286
/// Return true if the system has at least one Nvidia GPU.
252287
/// </summary>

StabilityMatrix.Core/Models/Packages/ComfyUI.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,59 @@ await SetupVenv(installLocation, pythonVersion: PyVersion.Parse(installedPackage
491491

492492
VenvRunner.UpdateEnvironmentVariables(GetEnvVars);
493493

494+
// Check for old NVIDIA driver version with cu130 installations
495+
var isNvidia = SettingsManager.Settings.PreferredGpu?.IsNvidia ?? HardwareHelper.HasNvidiaGpu();
496+
var isLegacyNvidia =
497+
SettingsManager.Settings.PreferredGpu?.IsLegacyNvidiaGpu() ?? HardwareHelper.HasLegacyNvidiaGpu();
498+
499+
if (isNvidia && !isLegacyNvidia)
500+
{
501+
var driverVersion = HardwareHelper.GetNvidiaDriverVersion();
502+
if (driverVersion is not null && driverVersion.Major < 580)
503+
{
504+
// Check if torch is installed with cu130 index
505+
var torchInfo = await VenvRunner.PipShow("torch").ConfigureAwait(false);
506+
if (torchInfo is not null)
507+
{
508+
var version = torchInfo.Version;
509+
var plusPos = version.IndexOf('+');
510+
var torchIndex = plusPos >= 0 ? version[(plusPos + 1)..] : string.Empty;
511+
512+
// Only warn if using cu130 (which requires driver 580+)
513+
if (torchIndex.Equals("cu130", StringComparison.OrdinalIgnoreCase))
514+
{
515+
var warningMessage = $"""
516+
517+
============================================================
518+
NVIDIA DRIVER WARNING
519+
============================================================
520+
521+
Your NVIDIA driver version ({driverVersion}) is older than
522+
the minimum required version (580.x) for CUDA 13.0 (cu130).
523+
524+
This may cause ComfyUI to fail to start or experience issues.
525+
526+
Recommended actions:
527+
1. Update your NVIDIA driver to version 580 or newer
528+
2. Or manually downgrade your torch version to use an
529+
older torch index (e.g. cu128)
530+
531+
============================================================
532+
533+
""";
534+
535+
Logger.Warn(
536+
"NVIDIA driver version {DriverVersion} is below 580.x minimum for cu130 (torch index: {TorchIndex})",
537+
driverVersion,
538+
torchIndex
539+
);
540+
onConsoleOutput?.Invoke(ProcessOutput.FromStdErrLine(warningMessage));
541+
return;
542+
}
543+
}
544+
}
545+
}
546+
494547
VenvRunner.RunDetached(
495548
[Path.Combine(installLocation, options.Command ?? LaunchCommand), .. options.Arguments],
496549
HandleConsoleOutput,

StabilityMatrix.Core/Models/Packages/FluxGym.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ IPyInstallationManager pyInstallationManager
3030
public override string LicenseUrl => "";
3131
public override string LaunchCommand => "app.py";
3232

33-
public override Uri PreviewImageUri =>
34-
new("https://raw.githubusercontent.com/cocktailpeanut/fluxgym/main/screenshot.png");
33+
public override Uri PreviewImageUri => new("https://cdn.lykos.ai/sm/packages/fluxgym/fluxgym.webp");
3534

3635
public override List<LaunchOptionDefinition> LaunchOptions => [LaunchOptionDefinition.Extras];
3736

StabilityMatrix.Core/Models/Packages/InvokeAI.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ public override Task DownloadPackage(
122122
return Task.CompletedTask;
123123
}
124124

125+
public override Task<bool> CheckForUpdates(InstalledPackage package) =>
126+
package.PythonVersion == Python.PyInstallationManager.Python_3_10_11.ToString()
127+
? Task.FromResult(false)
128+
: base.CheckForUpdates(package);
129+
125130
public override async Task InstallPackage(
126131
string installLocation,
127132
InstalledPackage installedPackage,
@@ -291,6 +296,44 @@ await SetupVenv(installedPackagePath, pythonVersion: PyVersion.Parse(installedPa
291296

292297
VenvRunner.UpdateEnvironmentVariables(env => GetEnvVars(env, installedPackagePath));
293298

299+
// Check for legacy Python 3.10.11 installations
300+
if (installedPackage.PythonVersion == Python.PyInstallationManager.Python_3_10_11.ToString())
301+
{
302+
var warningMessage = """
303+
304+
============================================================
305+
LEGACY INVOKEAI INSTALLATION
306+
============================================================
307+
308+
This InvokeAI installation is using Python 3.10.11, which
309+
is no longer supported by InvokeAI.
310+
311+
Automatic updates have been disabled for this installation
312+
to prevent compatibility issues.
313+
314+
Your current installation will continue to work, but will
315+
not receive updates.
316+
317+
Recommended actions:
318+
1. Install a new InvokeAI instance with Python 3.12+
319+
2. Copy your settings and data from this installation
320+
to the new one
321+
3. Once verified, you can delete this old installation
322+
323+
Note: You can run both installations side-by-side during
324+
the migration.
325+
326+
============================================================
327+
328+
""";
329+
330+
Logger.Warn(
331+
"InvokeAI installation using legacy Python {PythonVersion} - updates disabled",
332+
installedPackage.PythonVersion
333+
);
334+
onConsoleOutput?.Invoke(ProcessOutput.FromStdErrLine(warningMessage));
335+
}
336+
294337
// Launch command is for a console entry point, and not a direct script
295338
var entryPoint = await VenvRunner.GetEntryPoint(command).ConfigureAwait(false);
296339

0 commit comments

Comments
 (0)