From f26b5ac8a25cb1a3eb2991a1ffb7c24b9aab65fb Mon Sep 17 00:00:00 2001 From: Alex Bezdieniezhnykh Date: Sun, 9 Mar 2025 11:22:11 +0200 Subject: [PATCH] update installer --- Azaion.Common/DTO/Label.cs | 4 +- Azaion.Common/Services/FailsafeProducer.cs | 1 - README.md | 3 +- build/installer.iss | 181 --------------------- build/publish.cmd | 8 +- 5 files changed, 11 insertions(+), 186 deletions(-) diff --git a/Azaion.Common/DTO/Label.cs b/Azaion.Common/DTO/Label.cs index 546154d..011e839 100644 --- a/Azaion.Common/DTO/Label.cs +++ b/Azaion.Common/DTO/Label.cs @@ -188,8 +188,8 @@ public class YoloLabel : Label [MessagePackObject] public class Detection : YoloLabel { - [Key("an")] public string AnnotationName { get; set; } = null!; - [Key("p")] public double? Probability { get; set; } + [JsonProperty(PropertyName = "an")][Key("an")] public string AnnotationName { get; set; } = null!; + [JsonProperty(PropertyName = "p")][Key("p")] public double? Probability { get; set; } //For db & serialization public Detection(){} diff --git a/Azaion.Common/Services/FailsafeProducer.cs b/Azaion.Common/Services/FailsafeProducer.cs index 92f8ada..6a8bc90 100644 --- a/Azaion.Common/Services/FailsafeProducer.cs +++ b/Azaion.Common/Services/FailsafeProducer.cs @@ -1,7 +1,6 @@ using System.IO; using System.Net; using Azaion.Common.Database; -using Azaion.Common.DTO; using Azaion.Common.DTO.Config; using Azaion.Common.DTO.Queue; using LinqToDB; diff --git a/README.md b/README.md index a80b86e..e918202 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,5 @@ Works on Windows only for now Install: 1. C# dotnet with wpf -2. [CUDNN](https://developer.nvidia.com/cudnn) \ No newline at end of file +2. [CUDNN](https://developer.nvidia.com/cudnn) +Check in cmd: where cudnn* and update folder with cudnn*.dll libs in build\publish.cmd \ No newline at end of file diff --git a/build/installer.iss b/build/installer.iss index db5f985..4e3b62d 100644 --- a/build/installer.iss +++ b/build/installer.iss @@ -24,185 +24,4 @@ Source: "..\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs creat Name: "{group}\Azaion Suite"; Filename: "{app}\Azaion.Suite.exe" Name: "{commondesktop}\Azaion Suite"; Filename: "{app}\Azaion.Suite.exe"; Tasks: desktopicon -[Constants] -CUDA12_URL=https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_571.96_windows.exe -CUDNN9_URL=https://developer.download.nvidia.com/compute/cudnn/9.7.1/local_installers/cudnn_9.7.1_windows.exe - -function GetEnvironmentVariable(const Name: string): string; -var - Buffer: array[0..2047] of Char; - Size: DWORD; -begin - Size := SizeOf(Buffer) - 1; - if GetEnvironmentVariableW(PChar(Name), Buffer, Size) = 0 then - Result := '' - else - Result := Buffer; -end; - -function CheckCUDAGPU(): Boolean; -var - ResultCode: Integer; - Output: string; - GPUInfo: string; -begin - Result := False; - if not Exec('wmic', 'path win32_VideoController get name, caption', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then - begin - MsgBox('Error checking GPU information.', mbError, MB_OK); - Exit; - end; - - Output := GetShellOutput('wmic path win32_VideoController get name, caption'); - Output := LowerCase(Output); - - if (Pos('nvidia', Output) > 0) or (Pos('amd', Output) > 0) then - Result := True - else - MsgBox('No CUDA-compatible GPU detected. This application requires a CUDA-capable GPU to run.', mbError, MB_OK); -end; - -function CheckCUDA12(): Boolean; -var - CUDA_PATH: string; -begin - Result := False; - CUDA_PATH := GetEnvironmentVariable('CUDA_PATH'); - if CUDA_PATH <> '' then - Result := True - else - MsgBox('CUDA 12.x is not detected. Please ensure CUDA Toolkit 12.x is installed and CUDA_PATH environment variable is set.', mbError, MB_OK); -end; - -function CheckcuDNN9(): Boolean; -var - ResultCode: Integer; - Output: string; -begin - Result := False; - if not Exec('where', 'cudnn*', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then - begin - MsgBox('Error checking for cuDNN.', mbError, MB_OK); - Exit; - end; - - Output := GetShellOutput('where cudnn*'); - Output := LowerCase(Output); - - if Pos('v9', Output) > 0 then - Result := True - else - MsgBox('cuDNN 9.x is not detected. Please ensure cuDNN 9.x is installed and accessible in your system path.', mbError, MB_OK); -end; - -function DownloadFileSilent(const URL, LocalFile: string): Boolean; -var - ResultCode: Integer; -begin - Result := URLDownloadToFile(nil, PChar(URL), PChar(LocalFile), 0, nil) = 0; - if not Result then - MsgBox('Error downloading file from: ' + URL, mbError, MB_OK); -end; - -function InstallExecutableSilent(const ExecutablePath: string; const Parameters: string): Boolean; -var - ResultCode: Integer; -begin - Result := Exec(ExecutablePath, Parameters, '', SW_HIDE, ewWaitUntilTerminated, ResultCode); - if not Result then - MsgBox('Error executing: ' + ExecutablePath, mbError, MB_OK); -end; - -procedure CurStepChanged(CurStep: TSetupStep); -var - NeedsCUDA12, NeedscuDNN9: Boolean; - CUDA12InstallerURL, cuDNN9InstallerURL, CUDA12InstallerLocal, cuDNN9InstallerLocal: string; - DownloadSuccess, InstallSuccess: Boolean; -begin - if CurStep = ssInstall then - begin - if not CheckCUDAGPU() then - begin - Abort(); - Exit; - end; - - NeedsCUDA12 := not CheckCUDA12(); - NeedscuDNN9 := not CheckcuDNN9(); - - if NeedsCUDA12 or NeedscuDNN9 then - begin - SuppressMessages(True); - SuppressMovieModalMessages(True); - - MsgBox('Required dependencies (CUDA and/or cuDNN) are missing. Installer will attempt to download and install them silently.', mbInformation, MB_OK); - - CUDA12InstallerURL := '{const:CUDA12_URL}'; - cuDNN9InstallerURL := '{const:CUDNN9_URL}'; - CUDA12InstallerLocal := ExpandConstant('{tmp}\cuda_installer.exe'); - cuDNN9InstallerLocal := ExpandConstant('{tmp}\cudnn_installer.exe'); - - if NeedsCUDA12 then - begin - Log('Downloading CUDA 12 installer...'); - if DownloadFileSilent(CUDA12InstallerURL, CUDA12InstallerLocal) then - begin - Log('Installing CUDA 12 silently...'); - if InstallExecutableSilent(CUDA12InstallerLocal, '-s') then - Log('CUDA 12 installed successfully.') - else - begin - Log('CUDA 12 installation failed.'); - MsgBox('CUDA 12 installation failed. Please install CUDA Toolkit 12.x manually and restart the installer.', mbCriticalError, MB_OK); - Abort(); - Exit; - end; - else - begin - MsgBox('Failed to download CUDA 12 installer. Please download and install CUDA Toolkit 12.x manually and restart the installer.', mbCriticalError, MB_OK); - Abort(); - Exit; - end; - end; - - if NeedscuDNN9 then - begin - Log('Downloading cuDNN 9 installer...'); - if DownloadFileSilent(cuDNN9InstallerURL, cuDNN9InstallerLocal) then - begin - Log('Installing cuDNN 9 silently...'); - if InstallExecutableSilent(cuDNN9InstallerLocal, '-s') then - Log('cuDNN 9 installed successfully.') - else - begin - Log('cuDNN 9 installation failed.'); - MsgBox('cuDNN 9 installation failed. Please install cuDNN 9.x manually and restart the installer.', mbCriticalError, MB_OK); - Abort(); - Exit; - end; - else - begin - MsgBox('Failed to download cuDNN 9 installer. Please download and install cuDNN 9.x manually and restart the installer.', mbCriticalError, MB_OK); - Abort(); - Exit; - end; - end; - - SuppressMessages(False); - SuppressMovieModalMessages(False); - - if NeedsCUDA12 or NeedscuDNN9 then - begin - MsgBox('CUDA and cuDNN dependencies installation completed.', mbInformation, MB_OK); - if not CheckCUDA12() or not CheckcuDNN9() then - MsgBox('Dependencies installation finished, but still not detected correctly. Please verify your CUDA and cuDNN installation.', mbWarning, MB_OK); - end; - end; - end; -end; - -procedure InitializeSetup(); -begin -end; - [UninstallRun] \ No newline at end of file diff --git a/build/publish.cmd b/build/publish.cmd index 2f81a46..3940206 100644 --- a/build/publish.cmd +++ b/build/publish.cmd @@ -58,9 +58,15 @@ cd.. echo Copy ico copy logo.ico dist\ +echo Copying cudnn files +set cudnn-folder="C:\Program Files\NVIDIA\CUDNN\v9.4\bin\12.6" +copy %cudnn-folder%\* dist\* +@REM dont need +del dist\cudnn_adv64_9.dll + + echo building installer... iscc build\installer.iss cd build\ - echo uploading installer... call .\cdn_manager.exe upload suite AzaionSuiteInstaller.exe ..\AzaionSuiteInstaller.exe \ No newline at end of file