Change to load nitron on windows and linux from bash/shell script
This commit is contained in:
parent
ca0c5f571f
commit
1575406d9f
@ -34,14 +34,14 @@ const initModel = (fileName) => {
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
|
||||
binaryName = "nitro_windows_amd64_cuda.exe";
|
||||
binaryName = "nitro_start_windows.bat";
|
||||
} else if (process.platform === "darwin") {
|
||||
// Mac OS platform
|
||||
binaryName = process.arch === "arm64" ? "nitro_mac_arm64" : "nitro_mac_intel";
|
||||
} else {
|
||||
// Linux
|
||||
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
|
||||
binaryName = "nitro_linux_amd64_cuda"; // For other platforms
|
||||
binaryName = "nitro_start_linux.sh"; // For other platforms
|
||||
}
|
||||
|
||||
const binaryPath = path.join(binaryFolder, binaryName);
|
||||
|
||||
6
plugins/inference-plugin/nitro/nitro_start_linux.sh
Executable file
6
plugins/inference-plugin/nitro/nitro_start_linux.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# Attempt to run the nitro_linux_amd64_cuda file and if it fails, run nitro_linux_amd64
|
||||
./nitro_linux_amd64_cuda || (echo "nitro_linux_amd64_cuda encountered an error, attempting to run nitro_linux_amd64..." && ./nitro_linux_amd64)
|
||||
10
plugins/inference-plugin/nitro/nitro_start_windows.bat
Executable file
10
plugins/inference-plugin/nitro/nitro_start_windows.bat
Executable file
@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
|
||||
rem Attempt to run nitro_windows_amd64_cuda.exe
|
||||
nitro_windows_amd64_cuda.exe
|
||||
|
||||
rem Check the exit code of the previous command
|
||||
if %errorlevel% neq 0 (
|
||||
echo nitro_windows_amd64_cuda.exe encountered an error, attempting to run nitro_windows_amd64.exe...
|
||||
nitro_windows_amd64.exe
|
||||
)
|
||||
Loading…
x
Reference in New Issue
Block a user