Return to

[SOLVED] Unable to increase ivshmem size for 1440p monitor

I’ve been using virt-manager to manage several windows 10 VM’s with PCI passthrough of a GTX 1070. I’ve installed looking-glass on several Windows guests. I was considering using the OBS looking-glass plugin on linux to record or stream gaming on my Windows VM, while still having a monitor plugged into the video card passed through to windows. I do not want to sacrifice input latency or video latency for gaming.

Now, I’ve created another windows VM where maybe I’ll game or not on it, but it’s acceptable to me to accept some input or frame lag in trading for the convenience of minimizing a looking-glass-client window and keeping the monitor available to my linux desktop.

I am following the directions at looking-glass #client-determining-memory .
My monitor is 2560x1440.
2560 x 1440 x 4 x 2 / 1024 / 1024 + 10 = 38.125
Rounding up gives 64M.

Because I am using virt-manager, I add the following to my XML:

  <shmem name="looking-glass">
    <model type="ivshmem-plain"/>
    <size unit="M">64</size>
    <address type="pci" domain="0x0000" bus="0x0a" slot="0x01" function="0x0"/>

By the way, the address type line was added by virt-manager after applying the changes.

I get the following error when trying to start the VM:

Error starting domain: internal error: qemu unexpectedly closed the monitor: 2021-08-02T17:52:25.005284Z qemu-system-x86_64: backing store size 0x2000000 does not match ‘size’ option 0x4000000

If I modify the xml back to using just 32M, then the VM will start fine.

    <size unit="M">32</size>

The solution was to shutdown the VM, then:

rm /dev/shm/looking-glass

Then changing the xml to 64. Then start the VM.

I’m posting this because a search of the discord for /dev/shm gave me the idea that /dev/shm/looking-glass could be deleted, after I discovered that it was only 32M.

Another quest for another day is to determine what the Video card memory sizes of 16M, 256M, and 32M mean and do they relate to the shared memory, shown below.

$ sudo lspci -s 09:00.0 -v
[sudo] password for user:
09:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. Device 8599
Flags: fast devsel, IRQ 105, IOMMU group 23
Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
Memory at b0000000 (64-bit, prefetchable) [size=256M]
Memory at c0000000 (64-bit, prefetchable) [size=32M]
I/O ports at f000 [size=128]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [60] Power Management version 3