mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
List all GPU IDs in settings with names on tooltip, sort NvGpus by VRAM
This commit is contained in:
1780
CodeLegacy/Forms/SettingsForm.Designer.cs
generated
1780
CodeLegacy/Forms/SettingsForm.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -31,13 +31,35 @@ namespace Flowframes.Forms
|
|||||||
MinimumSize = new Size(Width, Height);
|
MinimumSize = new Size(Width, Height);
|
||||||
MaximumSize = new Size(Width, (Height * 1.5f).RoundToInt());
|
MaximumSize = new Size(Width, (Height * 1.5f).RoundToInt());
|
||||||
|
|
||||||
|
InitGpus();
|
||||||
InitServers();
|
InitServers();
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
Task.Run(() => CheckModelCacheSize());
|
Task.Run(() => CheckModelCacheSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitServers()
|
private void InitGpus ()
|
||||||
|
{
|
||||||
|
string tooltipTorch = "";
|
||||||
|
string tooltipNcnn = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < NvApi.NvGpus.Count; i++)
|
||||||
|
{
|
||||||
|
torchGpus.Items.Add(i);
|
||||||
|
tooltipTorch += $"{i} = {NvApi.NvGpus[i].FullName} ({NvApi.NvGpus[i].GetVramGb().ToString("0.")} GB)\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(var vkGpu in VulkanUtils.VkDevices)
|
||||||
|
{
|
||||||
|
ncnnGpus.Items.Add(vkGpu.Id);
|
||||||
|
tooltipNcnn += $"{vkGpu.Id} = {vkGpu.Name}\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
toolTip1.SetToolTip(tooltipTorchGpu, tooltipTorch.Trim());
|
||||||
|
toolTip1.SetToolTip(tooltipNcnnGpu, tooltipNcnn.Trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitServers()
|
||||||
{
|
{
|
||||||
serverCombox.Items.Clear();
|
serverCombox.Items.Clear();
|
||||||
serverCombox.Items.Add($"Automatic (Closest)");
|
serverCombox.Items.Add($"Automatic (Closest)");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Flowframes.IO
|
|||||||
switch (stringMode)
|
switch (stringMode)
|
||||||
{
|
{
|
||||||
case StringMode.Any: Config.Set(comboBox.Name, comboBox.Text); break;
|
case StringMode.Any: Config.Set(comboBox.Name, comboBox.Text); break;
|
||||||
case StringMode.Int: Config.Set(comboBox.Name, comboBox.Text.GetInt().ToString()); break;
|
case StringMode.Int: Config.Set(comboBox.Name, comboBox.Text.Split('(')[0].GetInt().ToString()); break;
|
||||||
case StringMode.Float: Config.Set(comboBox.Name, comboBox.Text.GetFloat().ToString().Replace(",", ".")); break;
|
case StringMode.Float: Config.Set(comboBox.Name, comboBox.Text.GetFloat().ToString().Replace(",", ".")); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Flowframes.Os
|
|||||||
if (gpus.Length == 0)
|
if (gpus.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NvGpus = gpus.ToList();
|
NvGpus = gpus.OrderByDescending(g => g.GetVramGb()).ThenBy(g => g.FullName).ToList();
|
||||||
float mostVram = -1f;
|
float mostVram = -1f;
|
||||||
|
|
||||||
foreach (PhysicalGPU gpu in gpus)
|
foreach (PhysicalGPU gpu in gpus)
|
||||||
|
|||||||
Reference in New Issue
Block a user