MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / remote_call

Function remote_call

ggml/src/ggml-virtgpu/virtgpu.cpp:434–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434uint32_t remote_call(virtgpu * gpu,
435 apir_encoder * encoder,
436 apir_decoder ** decoder,
437 float max_wait_ms,
438 long long * call_duration_ns) {
439 /*
440 * Prepare the reply notification pointer
441 */
442
443 volatile std::atomic_uint * atomic_reply_notif = (volatile std::atomic_uint *) gpu->reply_shmem.mmap_ptr;
444 *atomic_reply_notif = 0;
445
446 /*
447 * Trigger the execbuf ioctl
448 */
449
450 drm_virtgpu_execbuffer args = {
451 .flags = VIRTGPU_EXECBUF_RING_IDX,
452 .size = (uint32_t) (encoder->cur - encoder->start),
453 .command = (uintptr_t) encoder->start,
454
455 .bo_handles = 0,
456 .num_bo_handles = 0,
457
458 .fence_fd = 0,
459 .ring_idx = 0,
460 .syncobj_stride = 0,
461 .num_in_syncobjs = 0,
462 .num_out_syncobjs = 0,
463 .in_syncobjs = 0,
464 .out_syncobjs = 0,
465 };
466
467 *decoder = NULL;
468
469 int ret = drmIoctl(gpu->fd, DRM_IOCTL_VIRTGPU_EXECBUFFER, &args);
470
471 if (ret != 0) {
472 GGML_ABORT(GGML_VIRTGPU "%s: the virtgpu EXECBUFFER ioctl failed (%d)", __func__, ret);
473 }
474
475 /*
476 * Wait for the response notification
477 */
478 timer_data wait_host_reply_timer = { 0, 0, 0 };
479
480 start_timer(&wait_host_reply_timer);
481
482 timespec ts_start, ts_end;
483 clock_gettime(CLOCK_MONOTONIC, &ts_start);
484 long long start_time = (long long) ts_start.tv_sec * 1000000000LL + ts_start.tv_nsec;
485
486 bool timedout = false;
487 uint32_t notif_value = 0;
488 while (true) {
489 notif_value = std::atomic_load_explicit(atomic_reply_notif, std::memory_order_acquire);
490
491 if (notif_value != 0) {

Callers 2

virtgpu_handshakeFunction · 0.85
virtgpu_load_libraryFunction · 0.85

Calls 4

start_timerFunction · 0.85
atomic_load_explicitFunction · 0.85
os_time_sleepFunction · 0.85
stop_timerFunction · 0.85

Tested by

no test coverage detected