Skip to content

Commit 2fe1114

Browse files
committed
ggml: src: ggml-remotingfrontend/virtgpu: correctly fail when the virtgpu device cannot be open
1 parent f5b6bd2 commit 2fe1114

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ggml/src/ggml-remotingfrontend/virtgpu.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ create_virtgpu() {
6262
1024);
6363

6464
virt_gpu_result_t result = virtgpu_open(gpu);
65-
assert(result == APIR_SUCCESS);
65+
if (result != APIR_SUCCESS) {
66+
FATAL("%s: failed to create the open the virtgpu device :/", __func__);
67+
return NULL;
68+
}
6669

6770
result = virtgpu_init_params(gpu);
6871
assert(result == APIR_SUCCESS);
@@ -126,7 +129,7 @@ virtgpu_open(struct virtgpu *gpu)
126129
drmDevicePtr devs[8];
127130
int count = drmGetDevices2(0, devs, ARRAY_SIZE(devs));
128131
if (count < 0) {
129-
ERROR("failed to enumerate DRM devices");
132+
ERROR("%s: failed to enumerate DRM devices", __func__);
130133
return APIR_ERROR_INITIALIZATION_FAILED;
131134
}
132135

0 commit comments

Comments
 (0)