spice: an open remote computing solution€¦ · spice server – graphic commands processing (3)...
TRANSCRIPT
![Page 1: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/1.jpg)
Red Hat Summit 2009 | Arnon Gilboa1
SPICE: An Open Remote
Computing Solution
Presenter: Arnon Gilboa
Project Leader: Yaniv Kamay
Red Hat Israel
September 4, 2009
![Page 2: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/2.jpg)
Red Hat Summit 2009 | Arnon Gilboa2
Agenda
Why Spice?
Architecture
Spice Optimizations
Future Developments
Q&A
![Page 3: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/3.jpg)
Red Hat Summit 2009 | Arnon Gilboa3
Why Spice?
Open remote computing solution
Client access to remote machine display & devices
Emphasize on virtual machines environment
No need for guest networking
User experience similar to local machine
High quality video & audio
Offload intensive CPU & GPU tasks to client
Suitable for both LAN & WAN usage
![Page 4: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/4.jpg)
Red Hat Summit 2009 | Arnon Gilboa4
How Spice?
Transfer graphic commands/objects (currently 2D)
Other solutions use frame buffer updates
Fill, copy, stretch, path stroke, text, pointer shape etc.
Generic & platform-independent
Lossless images, lossy video & audio
![Page 5: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/5.jpg)
Red Hat Summit 2009 | Arnon Gilboa5
ARCHITECTURE
![Page 6: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/6.jpg)
Red Hat Summit 2009 | Arnon Gilboa6
Spice Architecture
Spice
Protocol
Devices(QXL, VDIPort)
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
Host
Spice Agent
Drivers(QXL, VDIPort)
![Page 7: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/7.jpg)
Red Hat Summit 2009 | Arnon Gilboa7
Spice Protocol
Spice
Protocol Devices
Spice
Protocol
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
Host
![Page 8: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/8.jpg)
Red Hat Summit 2009 | Arnon Gilboa8
Spice Protocol
Client-server communication
Set of messages for interaction with remote devices
Graphic commands, keyboard & mouse events, audio streams etc.
Secure authentication – ticketing (OTP) with expiration
Connection establishment and control (e.g., migration)
Flow control using window-acks
![Page 9: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/9.jpg)
Red Hat Summit 2009 | Arnon Gilboa9
Client-Server Communication: Channels
Client & server communicate via channels
TCP connections
Each Channel dedicated to a specific type of data
Channel can be secured using SSL or unsecured
In the client, each channel has a dedicated thread
Different QoS can be given per channel
![Page 10: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/10.jpg)
Red Hat Summit 2009 | Arnon Gilboa10
Channels
Main - control and configuration and agent communication
Display - handles graphic commands, images and video streams
Inputs - keyboard and mouse inputs
Cursor - pointer device position, visibility and cursor shape
Playback - audio received from the server to be played by the client
Record - audio capture on the client side
![Page 11: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/11.jpg)
Red Hat Summit 2009 | Arnon Gilboa11
Spice Server
Spice
Protocol Devices
Spice
Protocol
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
Devices
Host
![Page 12: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/12.jpg)
Red Hat Summit 2009 | Arnon Gilboa12
Spice Server – a pluggable library
Virtual Device Interface (VDI)
Defines a set of interfaces
Publishes virtual devices (e.g., display, keyboard, mouse)
Enables interaction with devices
libspice – the server, a VDI-pluggable library
Interacts with VDI host application (e.g., QEMU)
Communicates with client using Spice protocol
![Page 13: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/13.jpg)
Red Hat Summit 2009 | Arnon Gilboa13
Spice Server – Interfaces
QEMU
Playback ChannelPlaybackInterface
Record ChannelRecord
Interface
Main ChannelAgent
Interface
Inputs Channelkbd, mouse
& tabletInterfaces
Dispatcher
Worker Thread
Display Channel
Cursor Channel
QXLInterface
Spice Server
![Page 14: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/14.jpg)
Red Hat Summit 2009 | Arnon Gilboa14
Spice Server – Graphic Commands Processing (1)
Graphic Commands Tree
Contains the set of commands, whose execution will reproduce the display content
Used to optimize commands transmission to the client by dropping commands hidden by others
Command Pipe
Commands to be sent to the client, for updating its display
![Page 15: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/15.jpg)
Red Hat Summit 2009 | Arnon Gilboa15
Spice Server – Graphic Commands Processing (2)
Command Ring (IN)
Expected Display
Graphic CommandTree
Command Pipe (OUT)
![Page 16: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/16.jpg)
Red Hat Summit 2009 | Arnon Gilboa16
Spice Server – Graphic Commands Processing (3)
Attempt to pass the rendering job to the client, leveraging its hardware acceleration abilities
Rendering on the host side by software or GPU is done as a last resort
Release a command only when
Completely covered by other commands and there are no dependencies on it
Running out of resources, the command is rendered to the frame buffer
When the guest needs to read from the frame buffer
Command rendered to frame buffer & deleted from tree
![Page 17: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/17.jpg)
Red Hat Summit 2009 | Arnon Gilboa17
Spice Client
Spice
Protocol Devices
Spice
Protocol
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
Host
![Page 18: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/18.jpg)
Red Hat Summit 2009 | Arnon Gilboa18
Spice Client
End-user interface
Cross-platform
Linux & Windows
Generic classes & interfaces
Parallel implementation of platform-specific areas
Does not require any codecs
![Page 19: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/19.jpg)
Red Hat Summit 2009 | Arnon Gilboa19
SPICE FRIENDS &
FAMILY
![Page 20: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/20.jpg)
Red Hat Summit 2009 | Arnon Gilboa20
QXL Device & Driver
Spice
Protocol
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
QXL Device(s)
Host
Graphic Engine
QXL Drivers
![Page 21: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/21.jpg)
Red Hat Summit 2009 | Arnon Gilboa21
QXL Device & Driver
Transparent remote display
Specific QEMU PCI display deviceParavirtual device for enhanced performance
Transfer generic graphic commands to serverPixmap hashing & cache hintCursor support
Windows driver & beta X11 driver already implemented
Support standard VGA mode as well
No drivers requiredBoot stage display
![Page 22: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/22.jpg)
Red Hat Summit 2009 | Arnon Gilboa22
VDIPort Device & Driver
Spice
Protocol
Guest
QEMU/KVM
Spice Server(libspice) Spice Client
Client
VDIPort Device
Host
Spice Agent
VDIPort Driver
![Page 23: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/23.jpg)
Red Hat Summit 2009 | Arnon Gilboa23
VDIPort Device
VDI port - QEMU PCI device used for communication with guest agent
Agent communicates with both client & server using agent-dedicated protocol
Windows guest driver already implemented
![Page 24: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/24.jpg)
Red Hat Summit 2009 | Arnon Gilboa24
Optional component
Enhances user experience
Performs guest-oriented tasks
Injects mouse position and state
Display settings configuration
Spice Agent
![Page 25: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/25.jpg)
Red Hat Summit 2009 | Arnon Gilboa25
SPICE
OPTIMIZATIONS
![Page 26: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/26.jpg)
Red Hat Summit 2009 | Arnon Gilboa26
Image Caching
Client image caching: pixmaps, palettes and cursors
Eliminates sending redundant instances of an image
Image arrives from driver with unique id & cache hint
Pixmap cache is shared among all the displays
Synchronized between the server and client
Server manages cache
![Page 27: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/27.jpg)
Red Hat Summit 2009 | Arnon Gilboa27
Image Compression
Lossless - commands dependency, prevents artifacts
Image-based
Quic - based on SFALIC
LZ - LZSS adjusted to images
Global LZ (GLZ)
LZ with a history-based global dictionary
Takes advantage of repeating patterns among images
Auto - Heuristic compression choice per image
Synthetic images - LZ/GLZ
Photos - Quic
![Page 28: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/28.jpg)
Red Hat Summit 2009 | Arnon Gilboa28
Video Compression
Server heuristically identifies video streams
Using the commands tree
Areas constantly updated for a period of time
Send them as video stream coded using M-JPEG
Saves a lot of traffic, improving Spice performance, especially in WAN
Reduces client & server CPU consumption
Does not require any codecs
![Page 29: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/29.jpg)
Red Hat Summit 2009 | Arnon Gilboa29
Hardware Acceleration
Basic client rendering - using Cairo
Cross-platform, device-independent 2D library
Client HW acceleration
GDI in Windows
OpenGL in Linux (experimental)
Rendering by the client GPU instead of CPU
High performance rendering
Better client CPU utilization
Server HW acceleration uses OpenGL
Sharing code with the Linux client
![Page 30: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/30.jpg)
Red Hat Summit 2009 | Arnon Gilboa30
Mouse modes
Client mode
Client mouse used as the effective pointing device
Guest agent used for cursor position injection
Cursor shape & visibility - updated in a dedicated channel
Smooth cursor motion and responsiveness
Appropriate for WAN
Server mode
Server controls mouse position
Always synchronized
![Page 31: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/31.jpg)
Red Hat Summit 2009 | Arnon Gilboa31
Other Features
Multiple Monitors - tested on 4, no real limit
Automatic configuration of guest displays
2-way Audio and Lip-sync
Audio playback and recording
Playback compressed using CELT
Lip-sync using video frames time-stamping
Hardware Cursor
Separated from display, reduces network traffic
Enables prioritizing for better responsiveness
Live Migration - seamless to a connected client
![Page 32: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/32.jpg)
Red Hat Summit 2009 | Arnon Gilboa32
FUTURE
DEVELOPMENTS
![Page 33: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/33.jpg)
Red Hat Summit 2009 | Arnon Gilboa33
Future Features
Off-screen surfaces
Direct Draw
Video acceleration (DXVA)
3D acceleration
Aero (new drivers model)
Network tunneling
Client network printer redirection
Generic Resource sharing
![Page 34: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/34.jpg)
Red Hat Summit 2009 | Arnon Gilboa34
Future Features - cont.
Client GUI, preferences and window management
USB device redirection
Clipboard sharing
CD-ROM redirection
![Page 35: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/35.jpg)
Red Hat Summit 2009 | Arnon Gilboa35
QUESTIONS?
![Page 36: SPICE: An Open Remote Computing Solution€¦ · Spice Server – Graphic Commands Processing (3) Attempt to pass the rendering job to the client, leveraging its hardware acceleration](https://reader033.vdocuments.site/reader033/viewer/2022050403/5f80d632e1034f1cbc77f18f/html5/thumbnails/36.jpg)
Red Hat Summit 2009 | Arnon Gilboa36
Additional Information
http://www.spice-space.org (soon to come...)
Spice documentation effort
User manual
Spice remote computing protocol definition
Spice VD Interfaces documentation
spice-space-list
Contact: