Skip to content

Commit

Permalink
fix: Revert drogon thread to 1 instead of CPU num
Browse files Browse the repository at this point in the history
  • Loading branch information
hiro-v committed Dec 12, 2023
1 parent 577921f commit 14f83dd
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions extensions/inference-nitro-extension/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,32 +179,24 @@ async function spawnNitroProcess(nitroResourceProbe: any): Promise<any> {
let binaryName;

if (process.platform === "win32") {
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "win-start.bat";
} else if (process.platform === "darwin") {
// Mac OS platform
if (process.arch === "arm64") {
binaryFolder = path.join(binaryFolder, "mac-arm64");
} else {
binaryFolder = path.join(binaryFolder, "mac-x64");
}
binaryName = "nitro";
} else {
// Linux
// Todo: Need to check for CUDA support to switch between CUDA and non-CUDA binaries
binaryName = "linux-start.sh"; // For other platforms
binaryName = "linux-start.sh";
}

const binaryPath = path.join(binaryFolder, binaryName);

// Execute the binary
subprocess = spawn(
binaryPath,
[nitroResourceProbe.numCpuPhysicalCore, "127.0.0.1", PORT],
{
cwd: binaryFolder,
}
);
subprocess = spawn(binaryPath, [1, LOCAL_HOST, PORT], {
cwd: binaryFolder,
});

// Handle subprocess output
subprocess.stdout.on("data", (data) => {
Expand Down Expand Up @@ -274,7 +266,6 @@ function validateModelVersion(): Promise<void> {
});
}


function dispose() {
// clean other registered resources here
killSubprocess();
Expand Down

0 comments on commit 14f83dd

Please sign in to comment.