Bug 488216 - NVidia fallback to software rendering not working
Summary: NVidia fallback to software rendering not working
Status: REPORTED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: NixOS Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-08 16:22 UTC by Sandro
Modified: 2024-07-26 22:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandro 2024-06-08 16:22:07 UTC
SUMMARY

I am on NixOS Plasma 6.1 Beta and when trying to connect to my compuer with a NVidia graphics card, the fallback to software rendering is not working and instead things just kinda crash and then are in some limbo state where I only see a few pixel in the RDP session.

```
Jun 07 15:01:16 carbon krdpserver[2797]: [15:01:16:079] [2797:38230] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_CONTINUE_NEEDED [0x00090312]
Jun 07 15:01:16 carbon krdpserver[2797]: [15:01:16:082] [2797:38230] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_COMPLETE_NEEDED [0x00090313]
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp: New client connected:  UNIX platform Unspecified version
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp: Video stream initialized
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp: Received caps:
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_8 AVC: false YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_81 AVC: true YUV420: true
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_10 AVC: true YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_101 AVC: true YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_102 AVC: true YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_103 AVC: true YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_104 AVC: true YUV420: true
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_105 AVC: true YUV420: true
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_106 AVC: true YUV420: true
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   UNKNOWN_VERSION AVC: false YUV420: false
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp:   RDPGFX_CAPVERSION_107 AVC: true YUV420: true
Jun 07 15:01:16 carbon krdpserver[2797]: org.kde.krdp: Selected caps: RDPGFX_CAPVERSION_107
Jun 07 15:01:16 carbon krdpserver[2797]: [Parsed_scale_vaapi_1 @ 0x7fec0c044b00] Failed to create processing pipeline config: 12 (the requested VAProfile is not supported).
Jun 07 15:01:16 carbon krdpserver[2797]: [Parsed_scale_vaapi_1 @ 0x7fec0c044b00] Failed to configure output pad on Parsed_scale_vaapi_1
Jun 07 15:01:16 carbon krdpserver[2797]: kpipewire_record_logging: Failed configuring filter graph
Jun 07 15:01:16 carbon krdpserver[2797]: [libx264 @ 0x7fec0c910100] -qscale is ignored, -crf is recommended.
Jun 07 15:01:16 carbon krdpserver[2797]: [libx264 @ 0x7fec0c910100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
Jun 07 15:01:16 carbon krdpserver[2797]: [libx264 @ 0x7fec0c910100] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon krdpserver[2797]: QObject: Cannot create children for a parent that is in a different thread.
                                         (Parent is QApplication(0x7ffddf2afd00), parent's thread is QThread(0x11cb930), current thread is QThread(0x7fec34044510)
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:16 carbon kwin_wayland[2646]: kwin_screencast: "0,0 3840x1080" Failed to record frame: invalid buffer type
Jun 07 15:01:41 carbon krdpserver[2797]: [15:01:41:121] [2797:38230] [ERROR][com.freerdp.core.peer] - peer_recv_callback: CONNECTION_STATE_ACTIVE - peer_recv_pdu() fail
Jun 07 15:01:41 carbon krdpserver[2797]: [15:01:41:121] [2797:38230] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1
Jun 07 15:01:41 carbon krdpserver[2797]: org.kde.krdp: Unable to check file descriptor
Jun 07 15:01:41 carbon krdpserver[2797]: org.kde.krdp: Closing session
Jun 07 15:01:41 carbon krdpserver[2797]: *** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
Jun 07 15:01:41 carbon krdpserver[2797]: *** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
Jun 07 15:01:41 carbon krdpserver[2797]: 'pthread_equal(impl->thread, thread_id)' failed at ../spa/plugins/support/loop.c:363 loop_leave()
Jun 07 15:02:41 carbon krdpserver[2797]: org.kde.krdp: Initializing Freedesktop Portal Session
Jun 07 15:02:41 carbon krdpserver[2797]: org.kde.krdp: Session setup completed, start processing...
Jun 07 15:02:41 carbon krdpserver[2797]: org.kde.krdp: Started Freedesktop Portal session
```

STEPS TO REPRODUCE
1. Configure KRDP
2. Open a RDP software like Remmina
3. Connect and log in
4. see a mostly black screen with some pixels at the top

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS
(available in About System)
KDE Plasma Version: 6.1 Beta
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Comment 1 Akseli Lahtinen 2024-06-24 07:21:27 UTC
Hi, can you try if either of these server commands work when ran from terminal? Then just connect using Remmina.

KPIPEWIRE_FORCE_ENCODER=libx264 krdpserver -u test -p test

or 

KPIPEWIRE_FORCE_ENCODER=libx264_baseline krdpserver -u test -p test
Comment 2 Sandro 2024-06-25 23:58:19 UTC
Both commands result in the same behavior as initially described but it seems to now fallback to software rendering. In the meantime I updated to the full 6.1.0 release.

$ KPIPEWIRE_FORCE_ENCODER=libx264_baseline krdpserver -u test -p test --port 10000 &> krdp.log
....
libva info: VA-API version 1.21.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /run/opengl-driver/lib/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
[01:47:25:708] [97824:97888] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_CONTINUE_NEEDED [0x00090312]
[01:47:25:708] [97824:97888] [WARN][com.winpr.negotiate] - AcceptSecurityContext status SEC_I_COMPLETE_NEEDED [0x00090313]
org.kde.krdp: New client connected:  UNIX platform Unspecified version
org.kde.krdp: Video stream initialized
org.kde.krdp: Received caps:
org.kde.krdp:   RDPGFX_CAPVERSION_8 AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_81 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_10 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_101 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_102 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_103 AVC: true YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_104 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_105 AVC: true YUV420: true
org.kde.krdp:   RDPGFX_CAPVERSION_106 AVC: true YUV420: true
org.kde.krdp:   UNKNOWN_VERSION AVC: false YUV420: false
org.kde.krdp:   RDPGFX_CAPVERSION_107 AVC: true YUV420: true
org.kde.krdp: Selected caps: RDPGFX_CAPVERSION_107
kpipewire_record_logging: Forcing H264 Software encoding, baseline profile
[libx264 @ 0x7facc0637cc0] -qscale is ignored, -crf is recommended.
[libx264 @ 0x7facc0637cc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7facc0637cc0] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0x7ffe2d48c340), parent's thread is QThread(0x468930), current thread is QThread(0x7facc8043ef0)
org.kde.krdp: Closing Freedesktop Portal Session

journalctl did not show anything suspicious especially for kwin_wayland.

I noticed another strange behavior though: When connecting the second time I get a white screen and when I move my mouse onto it, it jumps to my second screen as it would be somehow confusing the screens.

journalctl also generates lots of messages like:
Jun 26 01:51:47 carbon kwin_wayland[93426]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated.
Jun 26 01:51:47 carbon remmina-file-wrapper[95403]: [01:51:47:641] [95403:00018336] [WARN][com.freerdp.codec] - [openh264_decompress]: DecodeFrame2 iBufferStatus: 0

so I assume it can now encode at least something?
Comment 3 Akseli Lahtinen 2024-07-10 08:58:47 UTC
Hi, does screen recording with spectacle work?

Also, what version of the nvidia driver do you have?
Comment 4 Sandro 2024-07-26 22:36:50 UTC
> Hi, does screen recording with spectacle work?

Yes, region, window and screen.

> Also, what version of the nvidia driver do you have?

I am not sure anymore what exact version I used but I think it should have been the 550.XX.XX.