Handle vkCreateInstance NCNN/VK error

This commit is contained in:
N00MKRAD
2021-05-04 14:39:11 +02:00
parent 747b5e3886
commit 570764d573
3 changed files with 6 additions and 6 deletions

View File

@@ -68,7 +68,6 @@ namespace Flowframes
{
try
{
//await Task.Delay(100);
Task.Run(() => Updater.UpdateModelList());
Task.Run(() => Updater.AsyncUpdateCheck());
Task.Run(() => GetWebInfo.LoadNews(newsLabel));

View File

@@ -478,6 +478,12 @@ namespace Flowframes
InterpolateUtils.ShowMessage($"Vulkan ran out of memory!\n\n{line}{msg}", "Error");
}
if (!hasShownError && err && line.Contains("vkCreateInstance failed"))
{
hasShownError = true;
InterpolateUtils.ShowMessage($"Vulkan failed to start up!\n\n{line}\n\nThis most likely means your GPU is not compatible.", "Error");
}
if (!hasShownError && err && line.Contains("invalid gpu device"))
{
hasShownError = true;

View File

@@ -36,13 +36,8 @@ namespace Flowframes
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Add the event handler for handling UI thread exceptions to the event.
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
// Set the unhandled exception mode to force all Windows Forms errors to go through our handler.
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
// Add the event handler for handling non-UI thread exceptions to the event.
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
mainForm = new Form1();