]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
ggml-virtgpu: improve the reliability of the code (llama/19846)
authorKevin Pouget <redacted>
Thu, 26 Feb 2026 12:00:57 +0000 (13:00 +0100)
committerGeorgi Gerganov <redacted>
Fri, 27 Feb 2026 10:04:54 +0000 (12:04 +0200)
commit7cfc6a52824c981f0a095bd7fc6f9daffb114df3
treea44ed83b8a0fd25e1b723bdf49a2d7cae2d9a731
parent4a7c7524e750955c6325cfaed5b15cb5a8163858
ggml-virtgpu: improve the reliability of the code (llama/19846)

* ggml-virtgpu-backend: validate the consistency of the received objects

This patch adds consistency checks in the
ggml-virtgpu-backend (running on the host side) to ensure that the
data received from the guest is consistent (valid pointers, valid
sizes and offsets).

* ggml-virtgpu-backend: add fallback/skips for optional ggml backend methods

```
  1. bck->iface.synchronize(bck)
  2. buft->iface.get_alloc_size(buft, op)
  3. buft->iface.get_max_size(buft)
```

these three methods are optional in the GGML interface. `get_max_size`
was already properly defaulted, but `backend sychronize` and `butf
get_max_size` would have segfaulted the backend if not implemented.

* ggml-virtgpu-backend: fix log format missing argument

* ggml-virtgpu-backend: improve the abort message

* ggml-virtgpu-backend: more safety checks

* ggml-virtgpu-backend: new error code

* ggml-virtgpu-backend: initialize all the error codes

* ggml-virtgpu: add a missing comment generated by the code generator

* ggml-virtgpu: add the '[virtgpu]' prefix to the device/buffer names

* ggml-virtgpu: apir_device_buffer_from_ptr: improve the error message

* ggml-virtgpu: shared: make it match the latest api_remoting.h of Virglrenderer APIR

(still unmerged)

* ggml-virtgpu: update the code generator to have dispatch_command_name in a host/guest shared file

* ggml-virtgpu: REMOTE_CALL: fail if the backend returns an error

* docs/backend/VirtGPU.md: indicate that the RAM+VRAM size is limed to 64 GB with libkrun

* ggml-virtgpu: turn off clang-format header ordering for some of the files

Compilation breaks when ordered alphabetically.

* ggml-virtgpu: clang-format

* ggml-virtgpu/backend/shared/api_remoting: better comments for the APIR return codes
29 files changed:
src/ggml-virtgpu/backend/backend-dispatched-backend.cpp
src/ggml-virtgpu/backend/backend-dispatched-buffer-type.cpp
src/ggml-virtgpu/backend/backend-dispatched-buffer.cpp
src/ggml-virtgpu/backend/backend-dispatched.cpp
src/ggml-virtgpu/backend/backend-dispatched.gen.h
src/ggml-virtgpu/backend/backend-dispatched.h
src/ggml-virtgpu/backend/backend-virgl-apir.h
src/ggml-virtgpu/backend/backend.cpp
src/ggml-virtgpu/backend/shared/api_remoting.h
src/ggml-virtgpu/backend/shared/apir_backend.gen.h
src/ggml-virtgpu/backend/shared/apir_backend.h
src/ggml-virtgpu/backend/shared/apir_cs.h
src/ggml-virtgpu/backend/shared/apir_cs_ggml.h
src/ggml-virtgpu/backend/shared/apir_cs_rpc.h
src/ggml-virtgpu/ggml-backend-buffer-type.cpp
src/ggml-virtgpu/ggml-backend-device.cpp
src/ggml-virtgpu/ggml-backend-reg.cpp
src/ggml-virtgpu/ggml-backend.cpp
src/ggml-virtgpu/ggml-remoting.h
src/ggml-virtgpu/include/apir_hw.h
src/ggml-virtgpu/regenerate_remoting.py
src/ggml-virtgpu/virtgpu-forward-backend.cpp
src/ggml-virtgpu/virtgpu-forward-buffer-type.cpp
src/ggml-virtgpu/virtgpu-forward-buffer.cpp
src/ggml-virtgpu/virtgpu-forward-device.cpp
src/ggml-virtgpu/virtgpu-forward-impl.h
src/ggml-virtgpu/virtgpu-forward.gen.h
src/ggml-virtgpu/virtgpu.cpp
src/ggml-virtgpu/virtgpu.h