On 2026/1/7 15:36, Akihiko Odaki wrote:
On 2026/01/07 16:18, Honglei Huang wrote:
This patch series introduces enhancements to virtio-gpu to improve
memory management and GPU virtualization capabilities for ROCm workloads.

The series includes:

1. VIRTIO_GPU_BLOB_FLAG_USE_USERPTR support: Enables user pointer mapping
    for blob resources, allowing guest applications to use user-allocated
    memory for GPU resources more efficiently.

2. VIRTIO_GPU_F_RESOURCE_USERPTR feature support: Introduces a new virtio-gpu
    feature flag with configurable "userptr=on" device property to enable
    user pointer resources for enhanced memory management.

3. ROCm capability support: Adds native support for AMD's ROCm (Radeon Open
    Compute) platform through a new "rocm=on" device property and
    VIRTIO_GPU_CAPSET_ROCM capability. This enables GPU compute
    workloads using the ROCm stack through virtio-gpu.

Changes in v3:
- Renamed HSAKMT-related functionality to ROCm for better clarity and
   alignment with the ROCm ecosystem terminology
- Changed device property from "hsakmt=on" to "rocm=on"
- Changed flag from VIRTIO_GPU_FLAG_HSAKMT_ENABLED to
   VIRTIO_GPU_FLAG_ROCM_ENABLED
- Changed renderer flag from VIRGL_RENDER_USE_HSAKMT to
   VIRGL_RENDERER_USE_ROCM
- Updated capset handling to use VIRTIO_GPU_CAPSET_ROCM (8) instead of
   VIRTIO_GPU_CAPSET_HSAKMT (8)
- Removed the error handling fix from patch 1 (virtio-gpu-virgl.c) into
   another thread

These patches work together to provide more flexible and efficient memory
management between guest and host in GPU virtualization scenarios, with
enhanced support for AMD ROCm compute workloads. The changes are backward
compatible and controlled by new device properties.

Usage examples:
   -device virtio-gpu-gl,rocm=on,userptr=on

The series has been tested with ROCm GPU compute workloads requiring
advanced memory management capabilities.

TODO:
- Unify and simplify the handling path for userptr resources.
   This improvement requires coordinated changes across multiple components    (virglrenderer and virtio-gpu driver), and will be implemented once the
   approach is finalized with other component maintainers.

Apparently this series still does not explain the utility of
VIRTIO_GPU_BLOB_FLAG_USE_USERPTR, which I have a doubt about:
https://lore.kernel.org/qemu-devel/35a8add7-da49-4833-9e69- [email protected]/

I suspect this TODO points to that or maybe something else, but either way I think this should have a RFC tag for now. After all, the corresponding change of virglrenderer has not merged and there is no explicit agreement on the QEMU-facing interface yet.

Regards,
Akihiko Odaki

Hi Akihiko,

Thank you for the feedback. I agree with your points:

The utility of VIRTIO_GPU_BLOB_FLAG_USE_USERPTR needs better explanation,
you're right that this series should be marked as RFC.
I'll resend this as RFC v4 with.

Thanks for the review!

Regards,
Honglei


Reply via email to