fix: wrong monitoring system information type (#2679)
This commit is contained in:
parent
ddb73d8131
commit
065ed03099
@ -13,7 +13,7 @@ export abstract class MonitoringExtension extends BaseExtension implements Monit
|
|||||||
return ExtensionTypeEnum.SystemMonitoring
|
return ExtensionTypeEnum.SystemMonitoring
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract getGpuSetting(): Promise<GpuSetting>
|
abstract getGpuSetting(): Promise<GpuSetting | undefined>
|
||||||
abstract getResourcesInfo(): Promise<any>
|
abstract getResourcesInfo(): Promise<any>
|
||||||
abstract getCurrentLoad(): Promise<any>
|
abstract getCurrentLoad(): Promise<any>
|
||||||
abstract getOsInfo(): Promise<OperatingSystemInfo>
|
abstract getOsInfo(): Promise<OperatingSystemInfo>
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export type GpuSettingInfo = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type SystemInformation = {
|
export type SystemInformation = {
|
||||||
gpuSetting: GpuSetting
|
gpuSetting?: GpuSetting
|
||||||
osInfo?: OperatingSystemInfo
|
osInfo?: OperatingSystemInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export interface MonitoringInterface {
|
|||||||
/**
|
/**
|
||||||
* Returns the GPU configuration.
|
* Returns the GPU configuration.
|
||||||
*/
|
*/
|
||||||
getGpuSetting(): Promise<GpuSetting>
|
getGpuSetting(): Promise<GpuSetting | undefined>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns information about the operating system.
|
* Returns information about the operating system.
|
||||||
|
|||||||
@ -120,7 +120,7 @@ export default class JanInferenceNitroExtension extends LocalOAIEngine {
|
|||||||
const downloadUrl = CUDA_DOWNLOAD_URL
|
const downloadUrl = CUDA_DOWNLOAD_URL
|
||||||
|
|
||||||
const url = downloadUrl
|
const url = downloadUrl
|
||||||
.replace('<version>', info.gpuSetting.cuda?.version ?? '12.4')
|
.replace('<version>', info.gpuSetting?.cuda?.version ?? '12.4')
|
||||||
.replace('<platform>', platform)
|
.replace('<platform>', platform)
|
||||||
|
|
||||||
console.debug('Downloading Cuda Toolkit Dependency: ', url)
|
console.debug('Downloading Cuda Toolkit Dependency: ', url)
|
||||||
@ -168,11 +168,11 @@ export default class JanInferenceNitroExtension extends LocalOAIEngine {
|
|||||||
override async installationState(): Promise<InstallationState> {
|
override async installationState(): Promise<InstallationState> {
|
||||||
const info = await systemInformation()
|
const info = await systemInformation()
|
||||||
if (
|
if (
|
||||||
info.gpuSetting.run_mode === 'gpu' &&
|
info.gpuSetting?.run_mode === 'gpu' &&
|
||||||
!info.gpuSetting.vulkan &&
|
!info.gpuSetting?.vulkan &&
|
||||||
info.osInfo &&
|
info.osInfo &&
|
||||||
info.osInfo.platform !== 'darwin' &&
|
info.osInfo.platform !== 'darwin' &&
|
||||||
!info.gpuSetting.cuda?.exist
|
!info.gpuSetting?.cuda?.exist
|
||||||
) {
|
) {
|
||||||
const janDataFolderPath = await getJanDataFolderPath()
|
const janDataFolderPath = await getJanDataFolderPath()
|
||||||
|
|
||||||
|
|||||||
@ -16,10 +16,7 @@ enum Settings {
|
|||||||
* JanMonitoringExtension is a extension that provides system monitoring functionality.
|
* JanMonitoringExtension is a extension that provides system monitoring functionality.
|
||||||
* It implements the MonitoringExtension interface from the @janhq/core package.
|
* It implements the MonitoringExtension interface from the @janhq/core package.
|
||||||
*/
|
*/
|
||||||
export default class JanMonitoringExtension
|
export default class JanMonitoringExtension extends MonitoringExtension {
|
||||||
extends MonitoringExtension
|
|
||||||
implements MonitoringInterface
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Called when the extension is loaded.
|
* Called when the extension is loaded.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
|
|||||||
'engines',
|
'engines',
|
||||||
this.provider,
|
this.provider,
|
||||||
engineVersion,
|
engineVersion,
|
||||||
info.gpuSetting.gpus[0].arch,
|
info.gpuSetting?.gpus[0].arch,
|
||||||
])
|
])
|
||||||
|
|
||||||
if (!(await fs.existsSync(executableFolderPath))) {
|
if (!(await fs.existsSync(executableFolderPath))) {
|
||||||
@ -148,7 +148,7 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
|
|||||||
const info = await systemInformation()
|
const info = await systemInformation()
|
||||||
|
|
||||||
if (!this.isCompatible(info)) return 'NotCompatible'
|
if (!this.isCompatible(info)) return 'NotCompatible'
|
||||||
const firstGpu = info.gpuSetting.gpus[0]
|
const firstGpu = info.gpuSetting?.gpus[0]
|
||||||
const janDataFolderPath = await getJanDataFolderPath()
|
const janDataFolderPath = await getJanDataFolderPath()
|
||||||
const engineVersion = TENSORRT_VERSION
|
const engineVersion = TENSORRT_VERSION
|
||||||
|
|
||||||
@ -184,12 +184,13 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
|
|||||||
isCompatible(info: SystemInformation): info is Required<SystemInformation> & {
|
isCompatible(info: SystemInformation): info is Required<SystemInformation> & {
|
||||||
gpuSetting: { gpus: { arch: string }[] }
|
gpuSetting: { gpus: { arch: string }[] }
|
||||||
} {
|
} {
|
||||||
const firstGpu = info.gpuSetting.gpus[0]
|
const firstGpu = info.gpuSetting?.gpus[0]
|
||||||
return (
|
return (
|
||||||
!!info.osInfo &&
|
!!info.osInfo &&
|
||||||
info.gpuSetting?.gpus?.length > 0 &&
|
!!info.gpuSetting &&
|
||||||
this.supportedPlatform.includes(info.osInfo.platform) &&
|
|
||||||
!!firstGpu &&
|
!!firstGpu &&
|
||||||
|
info.gpuSetting.gpus.length > 0 &&
|
||||||
|
this.supportedPlatform.includes(info.osInfo.platform) &&
|
||||||
!!firstGpu.arch &&
|
!!firstGpu.arch &&
|
||||||
firstGpu.name.toLowerCase().includes('nvidia') &&
|
firstGpu.name.toLowerCase().includes('nvidia') &&
|
||||||
this.supportedGpuArch.includes(firstGpu.arch)
|
this.supportedGpuArch.includes(firstGpu.arch)
|
||||||
|
|||||||
@ -148,7 +148,7 @@ async function runEngine(systemInfo: SystemInformation): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (systemInfo.gpuSetting.gpus.length === 0) {
|
if (systemInfo.gpuSetting?.gpus.length === 0) {
|
||||||
return Promise.reject('No GPU found. Please check your GPU setting.')
|
return Promise.reject('No GPU found. Please check your GPU setting.')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ async function runEngine(systemInfo: SystemInformation): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const gpu = systemInfo.gpuSetting.gpus[0]
|
const gpu = systemInfo.gpuSetting?.gpus[0]
|
||||||
if (gpu.name.toLowerCase().includes('nvidia') === false) {
|
if (gpu.name.toLowerCase().includes('nvidia') === false) {
|
||||||
return Promise.reject('No Nvidia GPU found. Please check your GPU setting.')
|
return Promise.reject('No Nvidia GPU found. Please check your GPU setting.')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,17 +94,15 @@ const ExtensionItem: React.FC<Props> = ({ item }) => {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(!compatibility || compatibility['platform']?.includes(PLATFORM)) && (
|
<div className="flex min-w-[150px] flex-row justify-end">
|
||||||
<div className="flex min-w-[150px] flex-row justify-end">
|
<InstallStateIndicator
|
||||||
<InstallStateIndicator
|
installProgress={progress}
|
||||||
installProgress={progress}
|
installState={installState}
|
||||||
installState={installState}
|
compatibility={compatibility}
|
||||||
compatibility={compatibility}
|
onInstallClick={onInstallClick}
|
||||||
onInstallClick={onInstallClick}
|
onCancelClick={onCancelInstallingClick}
|
||||||
onCancelClick={onCancelInstallingClick}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,8 +8,6 @@ import Loader from '@/containers/Loader'
|
|||||||
|
|
||||||
import { formatExtensionsName } from '@/utils/converter'
|
import { formatExtensionsName } from '@/utils/converter'
|
||||||
|
|
||||||
import ExtensionItem from './ExtensionItem'
|
|
||||||
|
|
||||||
import { extensionManager } from '@/extension'
|
import { extensionManager } from '@/extension'
|
||||||
import Extension from '@/extension/Extension'
|
import Extension from '@/extension/Extension'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user