Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump cortex to the latest version 1.0.10-rc1 to address hardware UI issues #4622

Merged
merged 3 commits into from
Feb 11, 2025
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
2 changes: 1 addition & 1 deletion core/src/types/hardware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type GpuAdditionalInformation = {

export type Gpu = {
activated: boolean
additional_information: GpuAdditionalInformation
additional_information?: GpuAdditionalInformation
free_vram: number
id: string
name: string
Expand Down
17 changes: 9 additions & 8 deletions core/src/types/miscellaneous/systemResourceInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import { GpuAdditionalInformation } from '../hardware'

export type SystemResourceInfo = {
memAvailable: number
Expand All @@ -12,13 +12,14 @@ export type GpuSetting = {
}

export type GpuSettingInfo = {
activated: boolean;
free_vram: number;
id: string;
name: string;
total_vram: number;
uuid: string;
version: string;
activated: boolean
free_vram: number
id: string
name: string
total_vram: number
uuid: string
version: string
additional_information?: GpuAdditionalInformation
}

export type SystemInformation = {
Expand Down
43 changes: 21 additions & 22 deletions extensions/engine-management-extension/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@

import {
GpuSetting,
log,
} from '@janhq/core'
import { GpuSetting, log } from '@janhq/core'

/**
* The GPU runMode that will be set - either 'vulkan', 'cuda', or empty for cpu.
* @param settings
* @returns
*/

const gpuRunMode = (settings?: GpuSetting): string => {

if (!settings) return ''

return settings.vulkan === true ||
settings.gpus?.some((gpu) => gpu.activated !== true)
? ''
: 'cuda'
const gpuRunMode = (settings?: GpuSetting): string => {
return settings.gpus?.some(
(gpu) =>
gpu.activated === true &&
gpu.additional_information &&
gpu.additional_information.driver_version
)
? 'cuda'
: ''
}

/**
Expand All @@ -28,10 +25,10 @@ const os = (settings?: GpuSetting): string => {
return PLATFORM === 'win32'
? 'windows-amd64'
: PLATFORM === 'darwin'
? settings?.cpu?.arch === 'arm64'
? 'mac-arm64'
: 'mac-amd64'
: 'linux-amd64'
? settings?.cpu?.arch === 'arm64'
? 'mac-arm64'
: 'mac-amd64'
: 'linux-amd64'
}

/**
Expand Down Expand Up @@ -60,16 +57,18 @@ const cudaVersion = (settings?: GpuSetting): '12-0' | '11-7' | undefined => {
/**
* Find which variant to run based on the current platform.
*/
export const engineVariant = async (gpuSetting?: GpuSetting): Promise<string> => {
export const engineVariant = async (
gpuSetting?: GpuSetting
): Promise<string> => {
let engineVariant = [
os(gpuSetting),
gpuSetting?.vulkan
? 'vulkan'
: (gpuRunMode(gpuSetting) === 'cuda' && // GPU mode - packaged CUDA variants of avx2 and noavx
gpuSetting.cpu.instructions.some((inst) => inst === 'avx2')) ||
gpuSetting.cpu.instructions.some((inst) => inst === 'avx512')
? 'avx2'
: 'noavx',
gpuSetting.cpu.instructions.some((inst) => inst === 'avx2')) ||
gpuSetting.cpu.instructions.some((inst) => inst === 'avx512')
? 'avx2'
: 'noavx',
gpuRunMode(gpuSetting),
cudaVersion(gpuSetting),
]
Expand Down
2 changes: 1 addition & 1 deletion extensions/inference-cortex-extension/bin/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.9-rc8
1.0.10-rc1
2 changes: 1 addition & 1 deletion web/screens/Settings/Hardware/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const Hardware = () => {
Compute Capability
</div>
<span>
{item.additional_information.compute_cap}
{item.additional_information?.compute_cap}
</span>
</div>
</div>
Expand Down
Loading