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

* chore: bump cortex to the latest version 1.0.10-rc1 to address hardware API issues

* fix: app crashes while reading properties from undefined value

* fix: cuda engine variant selection logic
This commit is contained in:
Louis 2025-02-11 10:24:47 +07:00 committed by GitHub
parent 386d41028a
commit ceb93cafef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 33 additions and 33 deletions

View File

@ -13,7 +13,7 @@ export type GpuAdditionalInformation = {
export type Gpu = { export type Gpu = {
activated: boolean activated: boolean
additional_information: GpuAdditionalInformation additional_information?: GpuAdditionalInformation
free_vram: number free_vram: number
id: string id: string
name: string name: string

View File

@ -1,4 +1,4 @@
import { GpuAdditionalInformation } from '../hardware'
export type SystemResourceInfo = { export type SystemResourceInfo = {
memAvailable: number memAvailable: number
@ -12,13 +12,14 @@ export type GpuSetting = {
} }
export type GpuSettingInfo = { export type GpuSettingInfo = {
activated: boolean; activated: boolean
free_vram: number; free_vram: number
id: string; id: string
name: string; name: string
total_vram: number; total_vram: number
uuid: string; uuid: string
version: string; version: string
additional_information?: GpuAdditionalInformation
} }
export type SystemInformation = { export type SystemInformation = {

View File

@ -1,8 +1,4 @@
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. * The GPU runMode that will be set - either 'vulkan', 'cuda', or empty for cpu.
@ -11,13 +7,14 @@ import {
*/ */
const gpuRunMode = (settings?: GpuSetting): string => { const gpuRunMode = (settings?: GpuSetting): string => {
return settings.gpus?.some(
if (!settings) return '' (gpu) =>
gpu.activated === true &&
return settings.vulkan === true || gpu.additional_information &&
settings.gpus?.some((gpu) => gpu.activated !== true) gpu.additional_information.driver_version
? '' )
: 'cuda' ? 'cuda'
: ''
} }
/** /**
@ -60,7 +57,9 @@ const cudaVersion = (settings?: GpuSetting): '12-0' | '11-7' | undefined => {
/** /**
* Find which variant to run based on the current platform. * 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 = [ let engineVariant = [
os(gpuSetting), os(gpuSetting),
gpuSetting?.vulkan gpuSetting?.vulkan

View File

@ -1 +1 @@
1.0.9-rc8 1.0.10-rc1

View File

@ -317,7 +317,7 @@ const Hardware = () => {
Compute Capability Compute Capability
</div> </div>
<span> <span>
{item.additional_information.compute_cap} {item.additional_information?.compute_cap}
</span> </span>
</div> </div>
</div> </div>