From d5fd8e7be6af62e5e3671b9a07acbacbb5e97c87 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Thu, 9 Oct 2025 21:36:55 -0500 Subject: [PATCH] another attempt at fixing nvidia startup (#2506) * another attempt at fixing nvidia startup * update dependencies --- .../Capabilities/Nvidia/NvEncSharpRedirector.cs | 9 +-------- .../ErsatzTV.Infrastructure.MySql.csproj | 2 +- .../ErsatzTV.Infrastructure.Sqlite.csproj | 2 +- ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj | 4 ++-- ErsatzTV/ErsatzTV.csproj | 2 +- ErsatzTV/Services/RunOnce/PlatformSettingsService.cs | 9 ++++++++- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs b/ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs index 67ea7c978..3baf4e045 100644 --- a/ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs +++ b/ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs @@ -7,14 +7,7 @@ public static class NvEncSharpRedirector { static NvEncSharpRedirector() { - try - { - NativeLibrary.SetDllImportResolver(typeof(Lennox.NvEncSharp.LibCuda).Assembly, Resolver); - } - catch (DllNotFoundException) - { - // do nothing - } + NativeLibrary.SetDllImportResolver(typeof(Lennox.NvEncSharp.LibCuda).Assembly, Resolver); } private static IntPtr Resolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) diff --git a/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj b/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj index 5815d774f..999c7f966 100644 --- a/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj +++ b/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj @@ -16,7 +16,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj index f1db3552c..8515412ce 100644 --- a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj +++ b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj @@ -13,7 +13,7 @@ - + diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index 769363605..6bb166586 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index 19b190976..f59143075 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -57,7 +57,7 @@ - + diff --git a/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs b/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs index 73992954f..cd1bd4745 100644 --- a/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs +++ b/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs @@ -17,7 +17,14 @@ public class PlatformSettingsService(IServiceScopeFactory serviceScopeFactory) : IRuntimeInfo runtimeInfo = scope.ServiceProvider.GetRequiredService(); if (runtimeInfo != null && runtimeInfo.IsOSPlatform(OSPlatform.Linux)) { - NvEncSharpRedirector.Init(); + try + { + NvEncSharpRedirector.Init(); + } + catch (DllNotFoundException) + { + // do nothing + } if (Directory.Exists("/dev/dri")) {