SlideShare a Scribd company logo
1 of 33
Download to read offline
A Vulkan Video Encoder
from Mesa to GStreamer
Hyunjun Ko / Stéphane Cerveau
2024-01-06
1
2
Agenda
1. Vulkan Video
2. Mesa - driver
3. GStreamer - application
4. Demos
3
Vulkan Video
Stateless codecs using GPU hardware acceleration
Supported codecs: H.264, H.265, AV1
Closer integration with Graphics and Displays.
Cross-platform and vendor-neutral low-level HW state(-
less) video codecs API
Each driver can operate differently depending on its
capabilities with a common API.
4
Vulkan Video Timeline
March 2018: TSG was created and driven by IHVs such
as AMD/Intel/Nvidia and open source operators
April 2021: including
the Video Decode and Encode extensions
January 2023: Video Extensions for Accelerated H.264
and H.265 Decode
December 2023: Khronos Vulkan Video
Extensions for Accelerated H.264 and H.265 Encode
Provisional extensions released
released
finalized
5
Encoding basics
6
Vulkan Video Encoding
7
The status of
Vulkan Video Encoder Support
in Mesa project
8
Contents
What is Mesa?
History of Vulkan Video development in Mesa
Drivers supporting Vulkan Video in Mesa
Development of Vulkan Video Encoding on Intel GPUs
Challenges
Plan
9
What is Mesa?
Began as an open source implementation of the
OpenGL.
Now actively implementing Vulkan specification on
various GPUs.
Intel, AMD, Qualcomm Adreno(R/E), Raspberry PI, etc..
Contributors: Igalia, Intel, Google, Collabora, Mesa
community.
https://mesa3d.org/
https://gitlab.freedesktop.org/mesa/mesa
10
History of Vulkan Video development in
Mesa
Dave Airlie started in 2022 on AMD and Intel GPU(RADV
and ANV)
With on FFmpeg.
Igalia joined on GStreamer later.
Hyunjun joined in 2023, started working on Intel
GPU(ANV)
So Dave fully dedicated to AMD GPU(RADV).
Dave's blog post
Lynne
11
The status of Vulkan Video development
in Mesa
Implemented and landed decoder first for h264 and
h265.
Now MR for h264/5 encoding are almost ready.
ANV H264 MR #20782
ANV H265 MR #22202
RADV H264/265 MR #20388
RADV MR
ANV Branch
12
Drivers supporting Vulkan
Video in Mesa
GPU H264 dec H265 dec H264 enc H265 enc
Intel(ANV) O O WIP WIP
AMD (RADV) O O Ready Ready
13
Working on Intel GPUs (1)
Dived into Intel Vulkan driver(ANV) in 2023.
Started working on H265 decoding first.
Tons of documents and source code of Intel VAAPI
drivers.
Exhausted to learn lots of Video commands.
But better than nothing :)
14
Working on Intel GPUs (2)
H265 Encoding Sequnce
15
Working on Intel GPUs (3)
Complete each command very carefully.
Otherwise you got a GPU hang or even whole system
down.
When you get a GPU hang and don't see any clue.
Dumping whole video commands encoding a frame(by
VAAPI Driver) into a file.
Compare to commands that you created
16
Working on Intel GPUs (4)
Thanks to the existing infrastrutures of ANV
Easy to handle memories and images.
Thanks to ANV maintainers.
They actively reviewed relevant merge requests.
17
Co-working with
Applications
GStreamer, VK CTS, FFMpeg...
Each uses different parameters and makes it find bugs
easily.
Different resolution, profile, SPS, PPS parameters.
18
Challenges
GPU hang.
Not enough useful tools to investigate.
Lots of generations of Intel GPUs.
Different commands, parameters, memory size,
alignment, etc...
19
Plan 2024
Land h264/h265 encoding support.
AV1 support.
Support other GPUs?
20
a 20-year-old framework for streaming media
applications.
Black boxes interconnection system
Native, multiplatform, highly-optimized framework
21
GStreamer pipeline
22
Vulkan Video support
Follow
Vulkan H.264 decoder in December 2023
Vulkan H.264/H.265 encoder .
Vulkan Video Status
merged
under review
23
State machine
24
Challenges
25
Cross platform API
Hardware crashes, Thanks Validation Layers!
Exact behavior varies by hardware vendor
Rate control and quality issues
26
Synchronization
Major issues with both decoder and encoder
Old memories from Vulkanised 2023, green screen...
Rework of GStreamer state machine with memory
barriers, fences.
GstVulkanOperation to handle commands
synchronization.
27
DPB management
Understand the correct use of Begin and Encode
reference slots.
Need to declare the reference within Begin command
and use it during the Encode command.
Various crashes in drivers not detected by the Validation
Layers when the standard H.26x parameters (SPS, slice
header) were not filled properly.
Vulkan reference slots management.
28
Vulkan tooling
Validation Layers:
Help validate we understand the specifications correctly
Do not prevent a misconfiguration of the std parameters
Mesa drivers helped to understand driver's pitfalls when
VL was clear.
GFXReconstruct, VK_LAYER_LUNARG_api_dump layer.
CTS: Help with a reference design reviewed by IHVs.
29
Demos
30
Questions ?
31
Thanks
Join us!
https://www.igalia.com/jobs
32
33

More Related Content

Similar to Implementing a Vulkan Video Encoder From Mesa to GStreamer

turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsIgalia
 
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...IMTC
 
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...Edge AI and Vision Alliance
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boardsLF Events
 
CUDA by Example : Getting Started : Notes
CUDA by Example : Getting Started : NotesCUDA by Example : Getting Started : Notes
CUDA by Example : Getting Started : NotesSubhajit Sahu
 
Reaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitReaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitIgalia
 
DCC Labs Company Presentation
DCC Labs Company PresentationDCC Labs Company Presentation
DCC Labs Company PresentationDCC Labs
 
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsightlaparuma
 
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono..."The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...Edge AI and Vision Alliance
 
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDocker, Inc.
 
Windows7: Video Improvements
Windows7: Video ImprovementsWindows7: Video Improvements
Windows7: Video Improvementswonderu
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Intel® Software
 
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyPT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyAMD Developer Central
 
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs from fiction t...
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs   from fiction t...Embedded Recipes 2018 - Upstream multimedia on amlogic so cs   from fiction t...
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs from fiction t...Anne Nicolas
 
ScalaMatrix gpu accelerated video display
ScalaMatrix gpu accelerated video displayScalaMatrix gpu accelerated video display
ScalaMatrix gpu accelerated video displayscalawox
 
3D Video Programming for Android
3D Video Programming for Android3D Video Programming for Android
3D Video Programming for AndroidYoss Cohen
 

Similar to Implementing a Vulkan Video Encoder From Mesa to GStreamer (20)

turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
Development of a 4K Main 10 Profile HEVC Encoder for Great Improvements in Co...
 
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
 
Linxu conj2016 96boards
Linxu conj2016 96boardsLinxu conj2016 96boards
Linxu conj2016 96boards
 
CUDA by Example : Getting Started : Notes
CUDA by Example : Getting Started : NotesCUDA by Example : Getting Started : Notes
CUDA by Example : Getting Started : Notes
 
Reaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkitReaching the multimedia web from embedded platforms with WPEWebkit
Reaching the multimedia web from embedded platforms with WPEWebkit
 
Google tv
Google tvGoogle tv
Google tv
 
DCC Labs Company Presentation
DCC Labs Company PresentationDCC Labs Company Presentation
DCC Labs Company Presentation
 
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
[03 2][gpu용 개발자 도구 - parallel nsight 및 axe] gateau parallel-nsight
 
Video cards
Video cardsVideo cards
Video cards
 
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono..."The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
 
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
 
DRIVE PX 2
DRIVE PX 2DRIVE PX 2
DRIVE PX 2
 
Windows7: Video Improvements
Windows7: Video ImprovementsWindows7: Video Improvements
Windows7: Video Improvements
 
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
 
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon SelleyPT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
PT-4052, Introduction to AMD Developer Tools, by Yaki Tebeka and Gordon Selley
 
Arm
ArmArm
Arm
 
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs from fiction t...
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs   from fiction t...Embedded Recipes 2018 - Upstream multimedia on amlogic so cs   from fiction t...
Embedded Recipes 2018 - Upstream multimedia on amlogic so cs from fiction t...
 
ScalaMatrix gpu accelerated video display
ScalaMatrix gpu accelerated video displayScalaMatrix gpu accelerated video display
ScalaMatrix gpu accelerated video display
 
3D Video Programming for Android
3D Video Programming for Android3D Video Programming for Android
3D Video Programming for Android
 

More from Igalia

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JITIgalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!Igalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in MesaIgalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesIgalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSIgalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webIgalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersIgalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on RaspberryIgalia
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Igalia
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic APIIgalia
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepIgalia
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESMIgalia
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...Igalia
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023Igalia
 
On-going challenges in the Raspberry Pi driver stack – XDC 2023
On-going challenges in the Raspberry Pi driver stack – XDC 2023On-going challenges in the Raspberry Pi driver stack – XDC 2023
On-going challenges in the Raspberry Pi driver stack – XDC 2023Igalia
 
Status Update of the VKMS DRM driver – XDC 2023
Status Update of the VKMS DRM driver – XDC 2023Status Update of the VKMS DRM driver – XDC 2023
Status Update of the VKMS DRM driver – XDC 2023Igalia
 

More from Igalia (20)

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic API
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by Step
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESM
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
 
On-going challenges in the Raspberry Pi driver stack – XDC 2023
On-going challenges in the Raspberry Pi driver stack – XDC 2023On-going challenges in the Raspberry Pi driver stack – XDC 2023
On-going challenges in the Raspberry Pi driver stack – XDC 2023
 
Status Update of the VKMS DRM driver – XDC 2023
Status Update of the VKMS DRM driver – XDC 2023Status Update of the VKMS DRM driver – XDC 2023
Status Update of the VKMS DRM driver – XDC 2023
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Implementing a Vulkan Video Encoder From Mesa to GStreamer

  • 1. A Vulkan Video Encoder from Mesa to GStreamer Hyunjun Ko / Stéphane Cerveau 2024-01-06 1
  • 2. 2
  • 3. Agenda 1. Vulkan Video 2. Mesa - driver 3. GStreamer - application 4. Demos 3
  • 4. Vulkan Video Stateless codecs using GPU hardware acceleration Supported codecs: H.264, H.265, AV1 Closer integration with Graphics and Displays. Cross-platform and vendor-neutral low-level HW state(- less) video codecs API Each driver can operate differently depending on its capabilities with a common API. 4
  • 5. Vulkan Video Timeline March 2018: TSG was created and driven by IHVs such as AMD/Intel/Nvidia and open source operators April 2021: including the Video Decode and Encode extensions January 2023: Video Extensions for Accelerated H.264 and H.265 Decode December 2023: Khronos Vulkan Video Extensions for Accelerated H.264 and H.265 Encode Provisional extensions released released finalized 5
  • 8. The status of Vulkan Video Encoder Support in Mesa project 8
  • 9. Contents What is Mesa? History of Vulkan Video development in Mesa Drivers supporting Vulkan Video in Mesa Development of Vulkan Video Encoding on Intel GPUs Challenges Plan 9
  • 10. What is Mesa? Began as an open source implementation of the OpenGL. Now actively implementing Vulkan specification on various GPUs. Intel, AMD, Qualcomm Adreno(R/E), Raspberry PI, etc.. Contributors: Igalia, Intel, Google, Collabora, Mesa community. https://mesa3d.org/ https://gitlab.freedesktop.org/mesa/mesa 10
  • 11. History of Vulkan Video development in Mesa Dave Airlie started in 2022 on AMD and Intel GPU(RADV and ANV) With on FFmpeg. Igalia joined on GStreamer later. Hyunjun joined in 2023, started working on Intel GPU(ANV) So Dave fully dedicated to AMD GPU(RADV). Dave's blog post Lynne 11
  • 12. The status of Vulkan Video development in Mesa Implemented and landed decoder first for h264 and h265. Now MR for h264/5 encoding are almost ready. ANV H264 MR #20782 ANV H265 MR #22202 RADV H264/265 MR #20388 RADV MR ANV Branch 12
  • 13. Drivers supporting Vulkan Video in Mesa GPU H264 dec H265 dec H264 enc H265 enc Intel(ANV) O O WIP WIP AMD (RADV) O O Ready Ready 13
  • 14. Working on Intel GPUs (1) Dived into Intel Vulkan driver(ANV) in 2023. Started working on H265 decoding first. Tons of documents and source code of Intel VAAPI drivers. Exhausted to learn lots of Video commands. But better than nothing :) 14
  • 15. Working on Intel GPUs (2) H265 Encoding Sequnce 15
  • 16. Working on Intel GPUs (3) Complete each command very carefully. Otherwise you got a GPU hang or even whole system down. When you get a GPU hang and don't see any clue. Dumping whole video commands encoding a frame(by VAAPI Driver) into a file. Compare to commands that you created 16
  • 17. Working on Intel GPUs (4) Thanks to the existing infrastrutures of ANV Easy to handle memories and images. Thanks to ANV maintainers. They actively reviewed relevant merge requests. 17
  • 18. Co-working with Applications GStreamer, VK CTS, FFMpeg... Each uses different parameters and makes it find bugs easily. Different resolution, profile, SPS, PPS parameters. 18
  • 19. Challenges GPU hang. Not enough useful tools to investigate. Lots of generations of Intel GPUs. Different commands, parameters, memory size, alignment, etc... 19
  • 20. Plan 2024 Land h264/h265 encoding support. AV1 support. Support other GPUs? 20
  • 21. a 20-year-old framework for streaming media applications. Black boxes interconnection system Native, multiplatform, highly-optimized framework 21
  • 23. Vulkan Video support Follow Vulkan H.264 decoder in December 2023 Vulkan H.264/H.265 encoder . Vulkan Video Status merged under review 23
  • 26. Cross platform API Hardware crashes, Thanks Validation Layers! Exact behavior varies by hardware vendor Rate control and quality issues 26
  • 27. Synchronization Major issues with both decoder and encoder Old memories from Vulkanised 2023, green screen... Rework of GStreamer state machine with memory barriers, fences. GstVulkanOperation to handle commands synchronization. 27
  • 28. DPB management Understand the correct use of Begin and Encode reference slots. Need to declare the reference within Begin command and use it during the Encode command. Various crashes in drivers not detected by the Validation Layers when the standard H.26x parameters (SPS, slice header) were not filled properly. Vulkan reference slots management. 28
  • 29. Vulkan tooling Validation Layers: Help validate we understand the specifications correctly Do not prevent a misconfiguration of the std parameters Mesa drivers helped to understand driver's pitfalls when VL was clear. GFXReconstruct, VK_LAYER_LUNARG_api_dump layer. CTS: Help with a reference design reviewed by IHVs. 29
  • 33. 33