mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-23 03:39:26 +01:00
Select first NCNN by default if CUDA is not detected
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Flowframes.Data;
|
using Flowframes.Data;
|
||||||
using Flowframes.IO;
|
using Flowframes.IO;
|
||||||
|
using Flowframes.OS;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -59,6 +60,8 @@ namespace Flowframes.UI
|
|||||||
|
|
||||||
if (combox.SelectedIndex < 0)
|
if (combox.SelectedIndex < 0)
|
||||||
combox.SelectedIndex = 0;
|
combox.SelectedIndex = 0;
|
||||||
|
|
||||||
|
SelectNcnnIfNoCudaAvail(combox);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -67,5 +70,17 @@ namespace Flowframes.UI
|
|||||||
|
|
||||||
return combox;
|
return combox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SelectNcnnIfNoCudaAvail (ComboBox combox)
|
||||||
|
{
|
||||||
|
if(NvApi.gpuList.Count < 1)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < combox.Items.Count; i++)
|
||||||
|
{
|
||||||
|
if (((string)combox.Items[i]).ToUpper().Contains("NCNN"))
|
||||||
|
combox.SelectedIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user