After choosing either nvidia or on-demand in prime-select the KDE interface
stops being rendered and appears as a black screen. However, all applications work
and will appear on said black screen. Moreover, after setting env variables
__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia
nvidia card starts being used by applications.
Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.
Thanks for quick reply!
Meanwhile, I uninstalled Displaylink Manager, thinking it might be to blame. This caused Xorg server to crash on every boot for some reason. So I went for it and installed pop_OS. Now I can seamlessly switch between nvidia-prime modes.
Solved!