.. _installing_libvirt: libvirt/QEMU Installation ######################### This article assumes you already have a fully functional `libvirt` domain with PCI passthrough working. If you use `virt-manager`, this guide also applies to you, since virt-manager uses `libvirt` as its back end. .. _libvirt_determining_memory: Determining memory ^^^^^^^^^^^^^^^^^^ You will first need to calculate the memory size to be suitable for your desired maximum resolution using the following formula: .. math:: \text{WIDTH} \times \text{HEIGHT} \times \text{BPP} \times 2 = \text{frame size in bytes} \text{frame size in bytes} \div 1024 \div 1024 = \text{ frame size in MiB} \text{frame size in MiB} + 10 = \text{ required size in MiB} 2^{\lceil \log_2(\text {required size in MiB}) \rceil} = \text{ total MiB} Where `BPP` is 4 for 32-bit RGB (SDR) or 8 for 64-bit (HDR :ref:`* `). .. hint:: The final step in this calculation is simply rounding the value up to the nearest power of two. For example, for a resolution of 1920x1080 (1080p) SDR: .. math:: 1920 \times 1080 \times 4 \times 2 = 16,588,800 \text{ bytes} 16,588,800 \div 1024 \div 1024 = 15.82 \text{ MiB} 15.82 \text{ MiB} + 10 \text{ MiB} = 25.82 \text{ MiB} 2^{\lceil \log_2(25.82) \rceil} = 32 \text { MiB} Failure to provide enough memory will cause Looking Glass to truncate the bottom of the screen and will trigger a message popup to inform you of the size you need to increase the value to. .. note:: Increasing this value beyond what you need does not yield any performance improvements, it simply will block access to that RAM making it unusable by your system. .. list-table:: Common Values :widths: 50 25 25 :header-rows: 1 * - Resolution - Standard Dynamic Range - High Dynamic Range (HDR) :ref:`* ` * - 1920x1080 (1080p) - 32 - 64 * - 1920x1200 (1200p) - 32 - 64 * - 2560x1440 (1440p) - 64 - 128 * - 3840x2160 (2160p/4K) - 128 - 256 .. _libvirt_determining_memory_hdr: .. warning:: While Looking Glass can capture and display HDR, at the time of writing neither Xorg or Wayland can make use of it and it will be converted by the GPU drivers/hardware to SDR. Additionally using HDR doubles the amount of memory, bandwidth, and CPU load and as such should generally not be used unless you have a special reason to do so. .. _libvirt_ivshmem: IVSHMEM ^^^^^^^ There are two methods of configuring IVSHMEM, using shared memory directly, or using the KVMFR kernel module. While the KVMFR module is slightly more complicated to configure, it substantially improves performace as it allows Looking Glass to use your GPUs DMA engine to transfer the frame data. .. toctree:: :maxdepth: 1 ivshmem_kvmfr ivshmem_shm .. _libvirt_spice_server: Keyboard/mouse/display/audio ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Looking Glass makes use of the SPICE protocol to provide keyboard and mouse input, audio input and output, and display fallback. .. note:: The default configuration that libvirt uses is not optimal and must be adjusted. Failure to perform these changes will cause input issues along with failure to support 5 button mice. If you would like to use SPICE to give you keyboard and mouse input along with clipboard sync support, make sure you have a ```` device, then: - Find your ``