Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
};
};