<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw" -->

---
title: Profiling virtualized GPU acceleration with Perfetto
description: Collabora engineers added Perfetto instrumentation to VirGL renderer, Mesa, and Apitrace to profile virtualized GPU acceleration in crosvm. The setup captures...
canonical: https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Profiling virtualized GPU acceleration with Perfetto | daily.dev
og:description: Collabora engineers added Perfetto instrumentation to VirGL renderer, Mesa, and Apitrace to profile virtualized GPU acceleration in crosvm. The setup captures...
og:url: https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw
og:image: https://api.daily.dev/og/posts/8LsJBywGW.png
og:image:alt: Profiling virtualized GPU acceleration with Perfetto
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Profiling virtualized GPU acceleration with Perfetto

**[Collabora Blog](https://daily.dev/sources/collabora)** · 6 min read · 0 upvotes · 0 comments

## Summary

Collabora engineers added Perfetto instrumentation to VirGL renderer, Mesa, and Apitrace to profile virtualized GPU acceleration in crosvm. The setup captures GPU hardware counters via gfx-pps on the host and VirGL command traces on both host and guest sides. Using Perfetto's TraceViewer, the team identified that excessive glBindVertexBuffer calls consume ~7ms per frame, tracing the root cause to vbo_dirty flag management in vrend_renderer.c. A potential optimization is grouping draw calls by vertex buffer state to reduce redundant SET_VERTEX_BUFFERS commands. The post also points to ongoing work integrating Perfetto and gfx-pps directly into Mesa.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.collabora.com/news-and-blog/blog/2021/04/22/profiling-virtualized-gpu-acceleration-with-perfetto>

## Questions this post answers

### How do I enable Perfetto tracing in VirGL renderer?

Perfetto tracing in VirGL renderer is enabled by configuring the meson build with the -Dtracing=perfetto option. VirGL renderer uses vperfetto (a library that simplifies Perfetto trace processing in virtual machines) rather than the raw Perfetto SDK directly. Macros defined in virgl_util.h are used to generate trace events representing function execution time and specific scopes such as decode callbacks.

_Engineers optimizing VirGL GPU stacks track instrumentation techniques like this on daily.dev._

### How does VirGL renderer translate guest OpenGL calls to host GL calls and where is the overhead?

A VirGL guest driver converts OpenGL calls to VirtIO GPU commands, buffers them, and flushes them to the VirtIO GPU. On the host, VirGL renderer decodes those commands back into OpenGL calls via decode callbacks. Profiling with Perfetto revealed that glBindVertexBuffer calls alone can consume up to 7ms per frame, triggered whenever vbo_dirty is true in vrend_renderer.c, across three functions: vrend_set_single_vbo, vrend_set_num_vbo, and vrend_bind_vertex_elements_state.

_Developers working on GPU virtualization performance find analysis like this through daily.dev._

## Similar posts on daily.dev

- [RADV Adds Support For New Performance Counters To Help Game Developers](https://daily.dev/posts/radv-adds-support-for-new-performance-counters-to-help-game-developers-i6ovcuybs) · Phoronix · 0 upvotes · 0 comments
- [Perfetto: Swiss Army Knife for Linux Client Tracing](https://daily.dev/posts/perfetto-swiss-army-knife-for-linux-client-tracing-otagc06ya) · Lobsters · 1 upvotes · 0 comments
- [AMD GPU Debugger · Abdelhadi](https://daily.dev/posts/amd-gpu-debugger-abdelhadi-w0hrtlkje) · Hacker News · 0 upvotes · 0 comments
- [Using Perfetto in ZJIT](https://daily.dev/posts/using-perfetto-in-zjit-gpz7qjln5) · RUBYLAND · 0 upvotes · 0 comments

---

Tags: [#infrastructure](https://daily.dev/tags/infrastructure), [#mesa](https://daily.dev/tags/mesa)

[View this post on daily.dev](https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Profiling virtualized GPU acceleration with Perfetto","url":"https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw"},"datePublished":"2026-08-11T08:53:36.637Z","dateModified":"2026-08-11T09:08:16.045Z","description":"Collabora engineers added Perfetto instrumentation to VirGL renderer, Mesa, and Apitrace to profile virtualized GPU acceleration in crosvm. The setup captures...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/44bc429645b6b85af069a6d04ee636c1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/44bc429645b6b85af069a6d04ee636c1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collabora Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collabora Blog","logo":"https://media.daily.dev/image/upload/s--ZGZ0FjqS--/f_auto,q_auto/v1786438306/logos/collabora?_a=BAMAMicg0","url":"https://daily.dev/sources/collabora"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"infrastructure,mesa","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collabora Blog","item":"https://daily.dev/sources/collabora"},{"@type":"ListItem","position":3,"name":"Profiling virtualized GPU acceleration with Perfetto"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/profiling-virtualized-gpu-acceleration-with-perfetto-8lsjbywgw#faq","mainEntity":[{"@type":"Question","name":"How do I enable Perfetto tracing in VirGL renderer?","acceptedAnswer":{"@type":"Answer","text":"Perfetto tracing in VirGL renderer is enabled by configuring the meson build with the -Dtracing=perfetto option. VirGL renderer uses vperfetto (a library that simplifies Perfetto trace processing in virtual machines) rather than the raw Perfetto SDK directly. Macros defined in virgl_util.h are used to generate trace events representing function execution time and specific scopes such as decode callbacks. Engineers optimizing VirGL GPU stacks track instrumentation techniques like this on daily.dev."}},{"@type":"Question","name":"How does VirGL renderer translate guest OpenGL calls to host GL calls and where is the overhead?","acceptedAnswer":{"@type":"Answer","text":"A VirGL guest driver converts OpenGL calls to VirtIO GPU commands, buffers them, and flushes them to the VirtIO GPU. On the host, VirGL renderer decodes those commands back into OpenGL calls via decode callbacks. Profiling with Perfetto revealed that glBindVertexBuffer calls alone can consume up to 7ms per frame, triggered whenever vbo_dirty is true in vrend_renderer.c, across three functions: vrend_set_single_vbo, vrend_set_num_vbo, and vrend_bind_vertex_elements_state. Developers working on GPU virtualization performance find analysis like this through daily.dev."}}]}
```

