Skip to content

Commit

Permalink
chore: fallback noavx binary (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Aug 13, 2024
1 parent 84e1e19 commit 2562ac8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion cortex-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"class-validator": "^0.14.1",
"cli-progress": "^3.12.0",
"cortex-cpp": "0.5.0-40",
"cpu-instructions": "^0.0.11",
"decompress": "^4.2.1",
"hyllama": "^0.2.2",
"js-yaml": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions cortex-js/src/usecases/engines/engines.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export class EnginesUsecases {
? '-mac'
: '-linux',
// CPU Instructions - CPU | GPU Non-Vulkan
options?.instructions && !isVulkan
? `-${options?.instructions?.toLowerCase()}`
!isVulkan
? `-noavx`
: '',
// Cuda
options?.runMode === 'GPU' &&
Expand Down
13 changes: 1 addition & 12 deletions cortex-js/src/utils/init.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { InitOptions } from '@/infrastructure/commanders/types/init-options.interface';
import { cpuInfo } from 'cpu-instructions';
import { checkNvidiaGPUExist } from './cuda';

/**
Expand All @@ -16,15 +15,5 @@ export const defaultInstallationOptions = async (): Promise<InitOptions> => {
// If Nvidia Driver is installed -> GPU
options.runMode = (await checkNvidiaGPUExist()) ? 'GPU' : 'CPU';
options.gpuType = 'Nvidia';
//CPU Instructions detection
options.instructions = await detectInstructions();
return options;
};

const detectInstructions = (): Promise<
'AVX' | 'AVX2' | 'AVX512' | undefined
> => {
const cpuInstruction = cpuInfo.cpuInfo()[0] ?? 'AVX';
console.log(cpuInstruction, 'CPU instructions detected');
return Promise.resolve(cpuInstruction);
};
};

0 comments on commit 2562ac8

Please sign in to comment.