gnif / LookingGlass

An extremely low latency KVMFR (KVM FrameRelay) implementation for guests with VGA PCI Passthrough.
GNU General Public License v2.0
4.64k stars 257 forks source link

SPICE input broken in B7-rc1 #1120

Closed bandithedoge closed 4 months ago

bandithedoge commented 4 months ago

2024-04-29_21:54:09

This happened after updating both the host and client applications to B7-rc1. B6 did not have this issue on the exact same VM. I tried manually specifying the SPICE address and port and that didn't help. I have the virtio-win drivers and SPICE guest tools installed.

00:00:00.000 [I]              main.c:1859 | main                           | Looking Glass (B7-rc1)                                                                                                              
00:00:00.000 [I]              main.c:1860 | main                           | Locking Method: Atomic                                                                                                              
00:00:00.000 [I]           cpuinfo.c:38   | cpuInfo_log                    | CPU Model: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz                                                                                  
00:00:00.000 [I]           cpuinfo.c:39   | cpuInfo_log                    | CPU: 1 sockets, 4 cores, 8 threads                                                                                                  
00:00:00.002 [I]            config.c:608  | config_load                    | Loading config from: /home/bandithedoge/.config/looking-glass/client.ini                                                            
00:00:00.010 [I]              main.c:1185 | lg_run                         | Using font: /nix/store/5hh21ilnpkqmsg9c0iigxmbi08pbswcn-roboto-2.138/share/fonts/truetype/RobotoCondensed-Regular.ttf               
00:00:00.010 [I]           ivshmem.c:128  | ivshmemOpenDev                 | KVMFR Device     : /dev/shm/looking-glass                                                                                           
00:00:00.013 [I]             audio.c:159  | audio_init                     | Using AudioDev: PipeWire                                                                                                            
00:00:00.013 [I]                ps.c:245  | purespice_connect              | Connecting to socket 127.0.0.1:5900                                                                                                 
00:00:00.084 [I]               rsa.c:178  | rsa_encryptPassword            | Using Nettle                                                                                                                        
00:00:00.086 [I]                ps.c:268  | purespice_connect              | Connected                                                                                                                           
00:00:00.086 [I]      channel_main.c:167  | onMessage_mainName             | Guest name: win10                                                                                                                   
00:00:00.086 [I]      channel_main.c:183  | onMessage_mainUUID             | Guest UUID: f669939d-8f52-41f9-9230-df00d73b497d                                                                                    
00:00:00.258 [I]                ps.c:644  | ps_connectChannel              | RECORD channel connected                                                                                                            
00:00:00.269 [I]                ps.c:644  | ps_connectChannel              | PLAYBACK channel connected                                                                                                          
00:00:00.277 [I]                ps.c:644  | ps_connectChannel              | INPUTS channel connected                                                                                                            
00:00:00.277 [I]           channel.c:323  | onMessage_notify               | [notify] keyboard channel is insecure                                                                                               
00:00:00.278 [I]               egl.c:289  | egl_initialize                 | Double buffering is off                                                                                                             
00:00:00.278 [I]              main.c:1139 | tryRenderer                    | Using Renderer: EGL                                                                                                                 
00:00:00.278 [I]           wayland.c:120  | waylandInit                    | Compositor: .Hyprland-wrapp                                                                                                         
00:00:00.278 [I]           wayland.c:130  | waylandInit                    | Selected  : xdg                                                                                                                     
00:00:00.318 [I]              main.c:1398 | lg_run                         | Using JIT render mode                                                                                                               
00:00:00.318 [I]                gl.c:58   | waylandGetEGLDisplay           | Using eglGetPlatformDisplay
00:00:00.347 [I]               egl.c:856  | egl_renderStartup              | Single buffer mode                                                                                                                  
00:00:00.349 [I]               egl.c:883  | egl_renderStartup              | EGL     : 1.5                                                                                                                       
00:00:00.349 [I]               egl.c:884  | egl_renderStartup              | Vendor  : AMD                                                                                                                       
00:00:00.349 [I]               egl.c:885  | egl_renderStartup              | Renderer: AMD Radeon RX 580 Series (radeonsi, polaris10, LLVM 17.0.6, DRM 3.57, 6.8.8-cachyos)                                      
00:00:00.349 [I]               egl.c:886  | egl_renderStartup              | Version : OpenGL ES 3.2 Mesa 24.2.0-devel                                                                                           
00:00:00.349 [I]               egl.c:887  | egl_renderStartup              | EGL APIs: OpenGL OpenGL_ES                                                                                                          
00:00:00.349 [I]               egl.c:958  | egl_renderStartup              | Debug messages disabled, enable with egl:debug=true                                                                                 
00:00:00.574 [I]              main.c:1491 | lg_run                         | ================================================================================                                                    
00:00:00.574 [I]              main.c:1492 | lg_run                         | The host application seems to not be running                                                                                        
00:00:00.574 [I]              main.c:1493 | lg_run                         | Waiting for the host application to start...                                                                                        
00:00:01.442 [I]           eglutil.c:35   | swapWithDamageInit             | Using EGL_KHR_swap_buffers_with_damage                                                                                              
00:00:01.798 [I]                ps.c:644  | ps_connectChannel              | DISPLAY channel connected                                                                                                           
00:00:01.800 [I]              main.c:919  | spice_surfaceCreate            | Create SPICE surface: id: 0, size: 640x480                                                                                          
00:00:01.810 [I]                ps.c:644  | ps_connectChannel              | CURSOR channel connected                                                                                                            
00:00:01.836 [I]              main.c:1498 | lg_run                         | ================================================================================                                                    
00:00:01.836 [I]              main.c:1512 | lg_run                         | Check the host log in your guest at %ProgramData%\Looking Glass (host)\looking-glass-host.txt                                       
00:00:01.836 [I]              main.c:1513 | lg_run                         | Continuing to wait...                                                                                                               
00:00:15.828 [I]             agent.c:103  | agent_connect                  | Connected to the spice guest agent                                                                                                  
00:00:16.803 [I]              main.c:1590 | lg_run                         | Guest Information:                                                                                                                  
00:00:16.803 [I]              main.c:1591 | lg_run                         | Version  : B7-rc1                                                                                                                   
00:00:16.803 [I]              main.c:1612 | lg_run                         | UUID     : 00000000-0101-0001-0000-000000000000                                                                                     
00:00:16.803 [I]              main.c:1621 | lg_run                         | CPU Model: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz                                                                                  
00:00:16.803 [I]              main.c:1622 | lg_run                         | CPU      : 4 sockets, 4 cores, 4 threads                                                                                            
00:00:16.803 [I]              main.c:1624 | lg_run                         | Using    : DXGI Direct3D 11                                                                                                         
00:00:16.803 [I]              main.c:1651 | lg_run                         | ================================================================================                                                    
00:00:16.803 [W]              main.c:1652 | lg_run                         | I have detected you have a CPU with hyperthreads but your guest is not aware of this                                                
00:00:16.803 [W]              main.c:1655 | lg_run                         | This will result in a degredation of latency sensitive tasks including the use of Looking Glass                                     
00:00:16.803 [I]              main.c:1662 | lg_run                         | ================================================================================                                                    
00:00:16.803 [I]              main.c:1710 | lg_run                         | OS       : Windows                                                                                                                  
00:00:16.803 [I]              main.c:1712 | lg_run                         | OS Name  : Windows 10 IoT Enterprise LTSC 2021 (Build: 19044)                                                                       
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | CURSOR channel disconnected                                                                                                         
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | DISPLAY channel disconnected                                                                                                        
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | RECORD channel disconnected                                                                                                         
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | PLAYBACK channel disconnected                                                                                                       
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | INPUTS channel disconnected                                                                                                         
00:00:16.804 [I]           channel.c:269  | channel_internal_disconnect    | MAIN channel disconnected                                                                                                           
00:00:16.804 [I]                ps.c:330  | purespice_disconnect           | Disconnected                                                                                                                        
00:00:16.804 [I]              main.c:1734 | lg_run                         | Starting session                                                                                                                    
00:00:16.859 [I]                ps.c:350  | purespice_process              | Shutdown                                                                                                                            
00:00:16.892 [I]              main.c:710  | main_frameThread               | Format: FRAME_TYPE_BGR_32 1920x1080 (1472x1080) stride:1472 pitch:5888 rotation:0 hdr:0 pq:0
00:00:00.533 [I]              time.c:85   | windowsSetTimerResolution      | System timer resolution: 488.2 μs
00:00:00.535 [I]               app.c:861  | app_main                       | Looking Glass Host (B7-rc1)
00:00:00.536 [I]           cpuinfo.c:38   | cpuInfo_log                    | CPU Model: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
00:00:00.537 [I]           cpuinfo.c:39   | cpuInfo_log                    | CPU: 4 sockets, 4 cores, 4 threads
00:00:00.539 [I]           ivshmem.c:132  | ivshmemInit                    | IVSHMEM 0* on bus 0x0, device 0x9, function 0x0
00:00:00.544 [I]               app.c:879  | app_main                       | IVSHMEM Size     : 32 MiB
00:00:00.544 [I]               app.c:880  | app_main                       | IVSHMEM Address  : 0x16961F30000
00:00:00.544 [I]               app.c:881  | app_main                       | Max Pointer Size : 1024 KiB
00:00:00.545 [I]               app.c:882  | app_main                       | KVMFR Version    : 20
00:00:00.545 [I]               app.c:901  | app_main                       | Trying           : D12
00:00:00.545 [I]               d12.c:185  | d12_create                     | debug:0 trackDamage:1
00:00:00.549 [I]               d12.c:905  | d12_enumerateDevices           | Device Name       : \\.\DISPLAY2
00:00:00.550 [I]               d12.c:906  | d12_enumerateDevices           | Device Description: Intel(R) HD Graphics 4600
00:00:00.550 [I]               d12.c:907  | d12_enumerateDevices           | Device Vendor ID  : 0x8086
00:00:00.551 [I]               d12.c:908  | d12_enumerateDevices           | Device Device ID  : 0x412
00:00:00.551 [I]               d12.c:909  | d12_enumerateDevices           | Device Video Mem  : 112 MiB
00:00:00.551 [I]               d12.c:911  | d12_enumerateDevices           | Device Sys Mem    : 0 MiB
00:00:00.552 [I]               d12.c:913  | d12_enumerateDevices           | Shared Sys Mem    : 2048 MiB
    13929511 [E]                d12.c:290  | d12_init                       | Failed to create the DirectX12 device: 0x887a0004 (The specified device interface or feature level is not supported on this system.)
00:00:00.567 [E]               app.c:435  | captureStart                   | Failed to initialize the capture device
00:00:00.568 [I]               app.c:901  | app_main                       | Trying           : DXGI
00:00:00.569 [I]              dxgi.c:506  | dxgi_init                      | Device Name       : \\.\DISPLAY2
00:00:00.569 [I]              dxgi.c:507  | dxgi_init                      | Device Description: Intel(R) HD Graphics 4600
00:00:00.570 [I]              dxgi.c:508  | dxgi_init                      | Device Vendor ID  : 0x8086
00:00:00.571 [I]              dxgi.c:509  | dxgi_init                      | Device Device ID  : 0x412
00:00:00.571 [I]              dxgi.c:510  | dxgi_init                      | Device Video Mem  : 112 MiB
00:00:00.572 [I]              dxgi.c:511  | dxgi_init                      | Device Sys Mem    : 0 MiB
00:00:00.572 [I]              dxgi.c:512  | dxgi_init                      | Shared Sys Mem    : 2048 MiB
00:00:00.582 [I]              dxgi.c:624  | dxgi_init                      | Feature Level     : 0xb100
00:00:00.582 [I]              dxgi.c:625  | dxgi_init                      | Capture Size      : 1920 x 1080
00:00:00.583 [I]              dxgi.c:626  | dxgi_init                      | AcquireLock       : enabled
00:00:00.584 [I]              dxgi.c:627  | dxgi_init                      | Debug mode        : disabled
00:00:00.585 [I]              dxgi.c:730  | dxgi_init                      | Bits Per Color    : 8
00:00:00.586 [I]              dxgi.c:731  | dxgi_init                      | Color Space       : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
00:00:00.586 [I]              dxgi.c:732  | dxgi_init                      | Min/Max Luminance : 0.500000/270.000000
00:00:00.587 [I]              dxgi.c:733  | dxgi_init                      | Frame Luminance   : 270.000000
00:00:00.587 [I]              dxgi.c:740  | dxgi_init                      | Source Format     : DXGI_FORMAT_B8G8R8A8_UNORM
00:00:00.613 [I]              dxgi.c:766  | dxgi_init                      | Capture Format    : DXGI_FORMAT_B8G8R8A8_UNORM
00:00:00.614 [I]              dxgi.c:813  | dxgi_init                      | Output Size       : 1920 x 1080
00:00:00.615 [I]              dxgi.c:814  | dxgi_init                      | Copy backend      : Direct3D 11
00:00:00.615 [I]              dxgi.c:815  | dxgi_init                      | Damage-aware copy : enabled
00:00:00.628 [I]               app.c:445  | captureStart                   | ==== [ Capture Start ] ====
00:00:00.628 [I]               app.c:932  | app_main                       | Using            : DXGI Direct3D 11
00:00:00.629 [I]               app.c:933  | app_main                       | Capture Method   : Asynchronous
00:00:00.631 [I]               app.c:768  | lgmpSetup                      | Max Frame Size   : 14 MiB
00:00:00.632 [I]               app.c:455  | captureStop                    | ==== [ Capture Stop ] ====
00:00:01.041 [I]              dxgi.c:506  | dxgi_init                      | Device Name       : \\.\DISPLAY2
00:00:01.042 [I]              dxgi.c:507  | dxgi_init                      | Device Description: Intel(R) HD Graphics 4600
00:00:01.043 [I]              dxgi.c:508  | dxgi_init                      | Device Vendor ID  : 0x8086
00:00:01.043 [I]              dxgi.c:509  | dxgi_init                      | Device Device ID  : 0x412
00:00:01.044 [I]              dxgi.c:510  | dxgi_init                      | Device Video Mem  : 112 MiB
00:00:01.044 [I]              dxgi.c:511  | dxgi_init                      | Device Sys Mem    : 0 MiB
00:00:01.045 [I]              dxgi.c:512  | dxgi_init                      | Shared Sys Mem    : 2048 MiB
00:00:01.053 [I]              dxgi.c:624  | dxgi_init                      | Feature Level     : 0xb100
00:00:01.054 [I]              dxgi.c:625  | dxgi_init                      | Capture Size      : 1920 x 1080
00:00:01.054 [I]              dxgi.c:626  | dxgi_init                      | AcquireLock       : enabled
00:00:01.055 [I]              dxgi.c:627  | dxgi_init                      | Debug mode        : disabled
00:00:01.056 [I]              dxgi.c:730  | dxgi_init                      | Bits Per Color    : 8
00:00:01.056 [I]              dxgi.c:731  | dxgi_init                      | Color Space       : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
00:00:01.057 [I]              dxgi.c:732  | dxgi_init                      | Min/Max Luminance : 0.500000/270.000000
00:00:01.057 [I]              dxgi.c:733  | dxgi_init                      | Frame Luminance   : 270.000000
00:00:01.058 [I]              dxgi.c:740  | dxgi_init                      | Source Format     : DXGI_FORMAT_B8G8R8A8_UNORM
00:00:01.061 [I]              dxgi.c:766  | dxgi_init                      | Capture Format    : DXGI_FORMAT_B8G8R8A8_UNORM
00:00:01.062 [I]              dxgi.c:813  | dxgi_init                      | Output Size       : 1920 x 1080
00:00:01.062 [I]              dxgi.c:814  | dxgi_init                      | Copy backend      : Direct3D 11
00:00:01.064 [I]              dxgi.c:815  | dxgi_init                      | Damage-aware copy : enabled
00:00:01.071 [I]               app.c:445  | captureStart                   | ==== [ Capture Start ] ====
00:00:01.073 [I]               app.c:373  | frameThread                    | Frame thread started
00:00:01.083 [I]             rgb24.c:158  | rgb24_configure                | RGBA to RGB packing enabled, 1.85 MiB per frame saved
00:00:01.084 [I]             rgb24.c:161  | rgb24_configure                | Packed size: 1472x1080
00:01:46.703 [I]               app.c:385  | frameThread                    | Frame thread stopped
00:01:46.703 [I]               app.c:455  | captureStop                    | ==== [ Capture Stop ] ====
00:02:40.713 [I]              dxgi.c:506  | dxgi_init                      | Device Name       : \\.\DISPLAY2
00:02:40.714 [I]              dxgi.c:507  | dxgi_init                      | Device Description: Intel(R) HD Graphics 4600
00:02:40.715 [I]              dxgi.c:508  | dxgi_init                      | Device Vendor ID  : 0x8086
00:02:40.715 [I]              dxgi.c:509  | dxgi_init                      | Device Device ID  : 0x412
00:02:40.716 [I]              dxgi.c:510  | dxgi_init                      | Device Video Mem  : 112 MiB
00:02:40.717 [I]              dxgi.c:511  | dxgi_init                      | Device Sys Mem    : 0 MiB
00:02:40.717 [I]              dxgi.c:512  | dxgi_init                      | Shared Sys Mem    : 2048 MiB
00:02:40.771 [I]              dxgi.c:624  | dxgi_init                      | Feature Level     : 0xb100
00:02:40.772 [I]              dxgi.c:625  | dxgi_init                      | Capture Size      : 1920 x 1080
00:02:40.772 [I]              dxgi.c:626  | dxgi_init                      | AcquireLock       : enabled
00:02:40.773 [I]              dxgi.c:627  | dxgi_init                      | Debug mode        : disabled
00:02:40.774 [I]              dxgi.c:730  | dxgi_init                      | Bits Per Color    : 8
00:02:40.774 [I]              dxgi.c:731  | dxgi_init                      | Color Space       : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
00:02:40.775 [I]              dxgi.c:732  | dxgi_init                      | Min/Max Luminance : 0.500000/270.000000
00:02:40.776 [I]              dxgi.c:733  | dxgi_init                      | Frame Luminance   : 270.000000
00:02:40.776 [I]              dxgi.c:740  | dxgi_init                      | Source Format     : DXGI_FORMAT_B8G8R8A8_UNORM
00:02:40.778 [I]              dxgi.c:766  | dxgi_init                      | Capture Format    : DXGI_FORMAT_B8G8R8A8_UNORM
00:02:40.778 [I]              dxgi.c:813  | dxgi_init                      | Output Size       : 1920 x 1080
00:02:40.779 [I]              dxgi.c:814  | dxgi_init                      | Copy backend      : Direct3D 11
00:02:40.779 [I]              dxgi.c:815  | dxgi_init                      | Damage-aware copy : enabled
00:02:40.785 [I]               app.c:445  | captureStart                   | ==== [ Capture Start ] ====
00:02:40.786 [I]               app.c:373  | frameThread                    | Frame thread started
00:02:44.786 [I]               app.c:385  | frameThread                    | Frame thread stopped
00:02:44.787 [I]               app.c:455  | captureStop                    | ==== [ Capture Stop ] ====

(before you ask, yes, that's a Haswell IGPU passed through, it worked perfectly fine in B6)

netboy3 commented 4 months ago

This is not a bug but a user error. You have another SPICE server listening on localhost:5900 that the LG client is connecting to. It can be another application or maybe another VM. That part of the code hasn't changed for more than 3 years so there's no chance of a regression here.

Also, please note that, as was quoted in the issue opening message you filled, support issues should be reported on LG's primary support channels (the forum and/or the Discord LG channel) and not this GitHub repo issue tracker. The issue tracker should only be used to report bugs in the code itself.

netboy3 commented 4 months ago

Also, please note that your VM is badly configured: 00:00:16.803 [I] main.c:1622 | lg_run | CPU : 4 sockets, 4 cores, 4 threads

You do not have 4 single thread 4 core sockets.

And

00:00:16.803 [W]              main.c:1652 | lg_run      | I have detected you have a CPU with hyperthreads but your guest is not aware of this                                                
00:00:16.803 [W]              main.c:1655 | lg_run      | This will result in a degredation of latency sensitive tasks including the use of Looking Glass

Consider visiting the VFIO support channels on the forum and/or Discord to get assistance in configuring your VM properly.

bandithedoge commented 4 months ago

This is not a bug but a user error. You have another SPICE server listening on localhost:5900 that the LG client is connecting to. It can be another application or maybe another VM. That part of the code hasn't changed for more than 3 years so there's no chance of a regression here.

Also, please note that, as was quoted in the issue opening message you filled, support issues should be reported on LG's primary support channels (the forum and/or the Discord LG channel).

I have no other VM running. The only thing that could interfere with it could be the virt-manager window, although disabling the Autoconnect option to make sure it doesn't grab SPICE input doesn't help. This didn't matter on B6 as opening LG would simply disconnect it and vice versa.

Also, please note that your VM is badly configured: 00:00:16.803 [I] main.c:1622 | lg_run | CPU : 4 sockets, 4 cores, 4 threads

You do not have 4 single thread 4 core sockets.

And

00:00:16.803 [W]              main.c:1652 | lg_run      | I have detected you have a CPU with hyperthreads but your guest is not aware of this                                                
00:00:16.803 [W]              main.c:1655 | lg_run      | This will result in a degredation of latency sensitive tasks including the use of Looking Glass

Thank you, I didn't catch that. I thought that simply setting vCPU allocation in the CPUs tab to match Logical host CPUs would copy the host CPU topology.

gnif commented 4 months ago

libvirt reports the guest ID is f669939d-8f52-41f9-9230-df00d73b497d, your VM report's its ID is 00000000-0101-0001-0000-000000000000. This is not a Looking Glass issue, you have done something to prevent windows reporting it's proper ID.

bandithedoge commented 4 months ago

I just downgraded to B6 and everything works fine. Maybe there is a regression after all.

gnif commented 4 months ago

There is no regression, B6 didn't check the guest UUID matched the UUID reported by spice. You need to fix your VM, this is not a bug.