SlideShare a Scribd company logo
1 of 22
Download to read offline
Making GPU resets less
painful on Linux
André Almeida @ Igalia
OSS NA 2023
1
Hi!
Kernel developer
Working in the Steam Deck
2
Oh no, my GPU hanged!
You are playing your game on Linux
Something wrong is sent to the device
???
Game over, reboot your machine
3
Modern GPUs are complex
Really complex
AMD Radeon RX 7900 XTX
96 Compute units, 384 texture units, 6 shader
engines, 58 B transistors...
Shaders are Turing Complete
4
Modern GPUs are complex
DCHUB
HUBP
(n)
DPP
(n)
MPC OPTC DIO
DCCG DMU AZ
MMHUBBUB
DWB
(n)
Global sync
Pixel data
Sideband signal
Config. Bus
SDP Monitor
OPP
dc_plane dc_stream
dc_state
Code struct
dc_link
Floating point
calculation
bit-depth
reduction/dither
}
Notes
5
Modern GPUs are complex
If you have an infinity loop in the CPU, it's not that
bad
CPU programs has virtual memory and virtual
processor
Things might be more barebone in the GPU
But in a GPU, the display won't be able to update
6
Detecting GPU hangs
From the hardware to the application
7
Detecting GPU hangs
Device to Kernel
Submit a job and wait until is done
Check fences
Or timeouts
The driver does a GPU reset
This can be "soft" resets, one hw engine reset or
full device reset
More complete resets are more destructive
Now, report to userspace
8
Reporting GPU hangs
Kernel to Mesa
DRM has no API for that
I915_GET_RESET_STATS
AMDGPU_CTX_OP_QUERY_STATE2
MSM_PARAM_FAULTS
Return -ERROR for ioctls
It's not really hw specific
9
Reporting GPU hangs
Mesa to application
APIs provide a way to tell apps that a reset
happened:
VK_ERROR_DEVICE_LOST
GL_ARB_robustness
Non-robust GL apps are just killed
Applications then can recreate the context
10
What happens in practice?
DRM <-> Mesa it's not really hw specific
How about we have a DRM_GET_RESET_STATE?
WIP: A DRM documentation explaining what DRM
drivers and usermode drivers (Mesa) should do when
a reset happens, with a DRM IOCTL to query the reset
11
What happens in practice?
Each vendor reacts differently to resets
My focus is on amdgpu
The state was that it would be unrecoverable for any
kind of reset
Just a black screen and not responsive. Access via
ssh/tty sometimes worked
Pierre-Eric (AMD) and I fixed this for KDE compositor
radeonsi wasn't following the spec
More testing is need for robustness
12
What happens in practice?
Other OSs have more control in the stack, so they can
be more reliable
In particular in the compositor side, so it's easier to
get in a standard behavior
13
Good reporting of GPU hangs
Apart from reporting to userspace that the GPU was
reset, would be nice to tell what happened
Currently Mesa developers have a hard time figuring
out what in the game caused the hang
14
Good reporting of GPU hangs
GPU hang have two main sources:
Hardware settings (voltage, frequency)
Application errors (infinite loops)
There's no way to distinguish this right now
15
Good reporting of GPU hangs
Ideally without overhead so can be enabled by default
WIP: AMDGPU_INFO_GUILTY_APP to capture data
about the hanged app (e.g. buffer in use)
This callbacks need to be platform specific
Reads some registers
16
Good reporting of GPU hangs
Challenge: when the GPU hangs the hardware state
can be a bit unreliable.
How to get the right info correctly?
Using the GPU in "debug" mode or inserting fences,
barrier and extra information causes overhead
No easy way to deploy to all users
17
Roadmap for better GPU resets
Standardization of how DRM reports GPU hangs to
userspace
of how usermode driver deals with a hang and with
the guilty application
what compositors should do after a hang
Better hang log
Show which buffer caused the hang
Dump hardware state reliably
devcoredump
18
Links
https://lore.kernel.org/lkml/20230501185747.3351
9-1-andrealmeid@igalia.com/
https://lore.kernel.org/lkml/20230424014324.2185
31-1-andrealmeid@igalia.com/
https://lore.kernel.org/lkml/20230227204000.567
87-1-andrealmeid@igalia.com/
https://gitlab.freedesktop.org/mesa/mesa/-/merge
_requests/22290
https://gitlab.freedesktop.org/mesa/mesa/-/merge
_requests/22253
19
Thanks!
andrealmeid@igalia.com
igalia.com/jobs
20
21
Making GPU resets less painful on Linux

More Related Content

Similar to Making GPU resets less painful on Linux

Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...freeassignmenthelp
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdfShubhamSinghRajput46
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Johan Andersson
 
Advanced Diagnostics 2
Advanced Diagnostics 2Advanced Diagnostics 2
Advanced Diagnostics 2Aero Plane
 
Nvidia (History, GPU Architecture and New Pascal Architecture)
Nvidia (History, GPU Architecture and New Pascal Architecture)Nvidia (History, GPU Architecture and New Pascal Architecture)
Nvidia (History, GPU Architecture and New Pascal Architecture)Saksham Tanwar
 
gpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsngpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsnARUNACHALAM468781
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Hardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdfHardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdfanjaniar7gallery
 
2013 Elite A-Series Launch
2013 Elite A-Series Launch2013 Elite A-Series Launch
2013 Elite A-Series LaunchAMD
 
Computação acelerada – a era das ap us roberto brandão, ciência
Computação acelerada – a era das ap us   roberto brandão,  ciênciaComputação acelerada – a era das ap us   roberto brandão,  ciência
Computação acelerada – a era das ap us roberto brandão, ciênciaCampus Party Brasil
 
Unified Memory on POWER9 + V100
Unified Memory on POWER9 + V100Unified Memory on POWER9 + V100
Unified Memory on POWER9 + V100inside-BigData.com
 
Architectural Analysis of Game Machines
Architectural Analysis of Game MachinesArchitectural Analysis of Game Machines
Architectural Analysis of Game MachinesPraveen AP
 
Cg 4278
Cg 4278Cg 4278
Cg 4278Abu85
 
GPGPU algorithms in games
GPGPU algorithms in gamesGPGPU algorithms in games
GPGPU algorithms in gameszlatan4177
 
Introduction to Computer Hardware
Introduction to Computer HardwareIntroduction to Computer Hardware
Introduction to Computer HardwareJoel Nelson
 
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driver
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driverKernel Recipes 2014 - The Linux graphics stack and Nouveau driver
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driverAnne Nicolas
 

Similar to Making GPU resets less painful on Linux (20)

Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdf
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)
 
Advanced Diagnostics 2
Advanced Diagnostics 2Advanced Diagnostics 2
Advanced Diagnostics 2
 
Nvidia (History, GPU Architecture and New Pascal Architecture)
Nvidia (History, GPU Architecture and New Pascal Architecture)Nvidia (History, GPU Architecture and New Pascal Architecture)
Nvidia (History, GPU Architecture and New Pascal Architecture)
 
gpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsngpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsn
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Hardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdfHardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdf
 
APU in nepal 2
APU in nepal 2APU in nepal 2
APU in nepal 2
 
2013 Elite A-Series Launch
2013 Elite A-Series Launch2013 Elite A-Series Launch
2013 Elite A-Series Launch
 
Computação acelerada – a era das ap us roberto brandão, ciência
Computação acelerada – a era das ap us   roberto brandão,  ciênciaComputação acelerada – a era das ap us   roberto brandão,  ciência
Computação acelerada – a era das ap us roberto brandão, ciência
 
Unified Memory on POWER9 + V100
Unified Memory on POWER9 + V100Unified Memory on POWER9 + V100
Unified Memory on POWER9 + V100
 
Architectural Analysis of Game Machines
Architectural Analysis of Game MachinesArchitectural Analysis of Game Machines
Architectural Analysis of Game Machines
 
Cg 4278
Cg 4278Cg 4278
Cg 4278
 
GPGPU algorithms in games
GPGPU algorithms in gamesGPGPU algorithms in games
GPGPU algorithms in games
 
Introduction to Computer Hardware
Introduction to Computer HardwareIntroduction to Computer Hardware
Introduction to Computer Hardware
 
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driver
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driverKernel Recipes 2014 - The Linux graphics stack and Nouveau driver
Kernel Recipes 2014 - The Linux graphics stack and Nouveau driver
 

More from Igalia

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEIgalia
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesIgalia
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceIgalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfIgalia
 
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
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerIgalia
 
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
 
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
 
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
 

More from Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
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!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
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
 
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
 
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
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingSelcen Ozturkcan
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

Making GPU resets less painful on Linux

  • 1. Making GPU resets less painful on Linux André Almeida @ Igalia OSS NA 2023 1
  • 3. Oh no, my GPU hanged! You are playing your game on Linux Something wrong is sent to the device ??? Game over, reboot your machine 3
  • 4. Modern GPUs are complex Really complex AMD Radeon RX 7900 XTX 96 Compute units, 384 texture units, 6 shader engines, 58 B transistors... Shaders are Turing Complete 4
  • 5. Modern GPUs are complex DCHUB HUBP (n) DPP (n) MPC OPTC DIO DCCG DMU AZ MMHUBBUB DWB (n) Global sync Pixel data Sideband signal Config. Bus SDP Monitor OPP dc_plane dc_stream dc_state Code struct dc_link Floating point calculation bit-depth reduction/dither } Notes 5
  • 6. Modern GPUs are complex If you have an infinity loop in the CPU, it's not that bad CPU programs has virtual memory and virtual processor Things might be more barebone in the GPU But in a GPU, the display won't be able to update 6
  • 7. Detecting GPU hangs From the hardware to the application 7
  • 8. Detecting GPU hangs Device to Kernel Submit a job and wait until is done Check fences Or timeouts The driver does a GPU reset This can be "soft" resets, one hw engine reset or full device reset More complete resets are more destructive Now, report to userspace 8
  • 9. Reporting GPU hangs Kernel to Mesa DRM has no API for that I915_GET_RESET_STATS AMDGPU_CTX_OP_QUERY_STATE2 MSM_PARAM_FAULTS Return -ERROR for ioctls It's not really hw specific 9
  • 10. Reporting GPU hangs Mesa to application APIs provide a way to tell apps that a reset happened: VK_ERROR_DEVICE_LOST GL_ARB_robustness Non-robust GL apps are just killed Applications then can recreate the context 10
  • 11. What happens in practice? DRM <-> Mesa it's not really hw specific How about we have a DRM_GET_RESET_STATE? WIP: A DRM documentation explaining what DRM drivers and usermode drivers (Mesa) should do when a reset happens, with a DRM IOCTL to query the reset 11
  • 12. What happens in practice? Each vendor reacts differently to resets My focus is on amdgpu The state was that it would be unrecoverable for any kind of reset Just a black screen and not responsive. Access via ssh/tty sometimes worked Pierre-Eric (AMD) and I fixed this for KDE compositor radeonsi wasn't following the spec More testing is need for robustness 12
  • 13. What happens in practice? Other OSs have more control in the stack, so they can be more reliable In particular in the compositor side, so it's easier to get in a standard behavior 13
  • 14. Good reporting of GPU hangs Apart from reporting to userspace that the GPU was reset, would be nice to tell what happened Currently Mesa developers have a hard time figuring out what in the game caused the hang 14
  • 15. Good reporting of GPU hangs GPU hang have two main sources: Hardware settings (voltage, frequency) Application errors (infinite loops) There's no way to distinguish this right now 15
  • 16. Good reporting of GPU hangs Ideally without overhead so can be enabled by default WIP: AMDGPU_INFO_GUILTY_APP to capture data about the hanged app (e.g. buffer in use) This callbacks need to be platform specific Reads some registers 16
  • 17. Good reporting of GPU hangs Challenge: when the GPU hangs the hardware state can be a bit unreliable. How to get the right info correctly? Using the GPU in "debug" mode or inserting fences, barrier and extra information causes overhead No easy way to deploy to all users 17
  • 18. Roadmap for better GPU resets Standardization of how DRM reports GPU hangs to userspace of how usermode driver deals with a hang and with the guilty application what compositors should do after a hang Better hang log Show which buffer caused the hang Dump hardware state reliably devcoredump 18
  • 21. 21