Skip to content

Commit 626f9c7

Browse files
author
Mohammed Abdi
authored
Merge pull request #41 from project-codeflare/gpu-bug
GPU bug fix
2 parents 13d1773 + 8682d11 commit 626f9c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/pages/MCADashboard/Metrics/api/metricsData.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const getMetricData = async (query: string) => {
1010
try {
1111
const body = { query: query };
1212
const res: { data: { value: [string, number] }[] } = await axios.post('/api/metrics-data', body);
13-
if (query === utilizedGPUQuery) { // since vector(0) in query, even if no gpu returns 0
13+
if (query === utilizedGPUQuery) { // since vector(0) in query, even if no gpu in cluster returns 0
1414
const gpubody = { query: utilizedGPUMemoryQuery }; // use the utilizedGPUMemoryQuery to verify gpu is present in the cluster
1515
const gpures: { data: { value: [string, number] }[] } = await axios.post('/api/metrics-data', gpubody);
1616
if (gpures.data && gpures.data[0] && gpures.data[0].value && gpures.data[0].value[1] !== undefined) {
@@ -22,7 +22,11 @@ export const getMetricData = async (query: string) => {
2222
if (res.data && res.data[0] && res.data[0].value && res.data[0].value[1] !== undefined) {
2323
return res.data[0].value[1];
2424
} else {
25-
return noGpu;
25+
if (query === utilizedGPUMemoryQuery) {
26+
return noGpu;
27+
} else {
28+
return 0;
29+
}
2630
}
2731
}
2832
} catch (error) {

0 commit comments

Comments
 (0)