neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.61k stars 1.72k forks source link

Ubuntu 16.10 XRDP + nvidia + GLX not working #721

Open lieff opened 7 years ago

lieff commented 7 years ago

I'm trying to use opengl through rdp connection. I've enable indirect rendering through +iglx X startup option and AllowIndirectGLXProtocol. Logs reported that everything is normal:

[     3.665] (II) LoadModule: "glx"
[     3.665] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so
[     3.723] (II) Module glx: vendor="NVIDIA Corporation"
...
[     3.736] (**) NVIDIA(0): Option "AllowIndirectGLXProtocol" "on"
[     3.736] (**) NVIDIA(0): Enabling 2D acceleration

But inside XRDP session GLX cannot be used:

$ glxinfo
name of display: :10.0
Error: couldn't find RGB GLX visual or fbconfig

Using strace I've noticed that it cannot find libGLX_indirect.so.0, so I tried:

$ LD_LIBRARY_PATH="/usr/lib/nvidia-378/" glxinfo
name of display: :10.0
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Error: couldn't find RGB GLX visual or fbconfig
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".

Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".
Xlib:  extension "GLX" missing on display ":10.0".

Is it possible to use nvidia GLX within XRDP session? Or software mesa glx or VirtualGL must be used?

lieff commented 7 years ago

I can get VirtualGL work, but on modern distributions it's very tricky (because of security I suppose). We need two users: user1 and user2. We must login user1 on console (which creates display :0 with nvidia glx). Then we login user2 through xrdp. If we just try to use VirtualGL, it failed:

user2$ /opt/VirtualGL/bin/vglrun glxgears
Invalid MIT-MAGIC-COOKIE-1 key[VGL] ERROR: Could not open display :0.

Security does not allow us to use others display, we need su user1:

user2$ su user1
Password: 
user1$ /opt/VirtualGL/bin/vglrun glxgears
14188 frames in 5.0 seconds = 2837.502 FPS
15110 frames in 5.0 seconds = 3021.876 FPS

And it worked! I don't know how to make xrdp glx usage more simple for now.

fang64 commented 7 years ago

@lieff were you using VNC to connect to the session or xorgxrdp?

If you had used xorgxrdp driver you could have used mesa gl, but you would have to remove the GLX drivers from Nvidia, since this would prohibit you from creating an X Session. This is due to the xorgxrdp driver not supporting Nvidia's GLX implementation, unless you have libglvnd in the distribution which will allow multiple GLX implementations to co-exist on the machine and it will route those GLX implementations appropriately.

VirtualGL is a alternate option as well but it has caveats with some software, I do know if you run the gnome desktop VGL will get caught up handling the desktop and completely unable to render applications.

lieff commented 7 years ago

I use xorgxrdp session. I know about libglvnd and I can get it work too, but only with nvidia+software GLX, so.. software will be used, not hardware. It can be done even without libglvnd by switching paths to software GLX (we do not need nvidia part if its not working). But I want hardware GLX of course, so we need some working way to connect to nvidia GLX. VirtualGL works, but with security bypass tricks. So, to make it more user friendly, we need some solution on this...

fang64 commented 7 years ago

@lieff VirtualGL is a good option but you will have to still leverage the Mesa Libs for the desktop rendering, otherwise you'll have issues getting applications to render while the desktop is using the hardware.

What I found is I had to create application wrappers to solve the security issue to make it "user friendly" although I ran into issues with applications that were written poorly. For example having a path full of application wrappers that overrides the normal executables for applications so the user calls those instead. Ideally with the environment configured for vgl_run and the application to run properly.

You could also write a generalized wrapper, but those almost never work for "all applications" especially commercial applications that have their own wrappers that like to break out of the shell they are being run from.

lieff commented 7 years ago

Software mesa libs can't run all applications, we need hardware support (from MESA and proprietary drivers). What I see about user friendly solution: XRDP among with sesman starts console user login and creates host display for this user (through systemd I suppose, not really sure how to make this step). Then it setup GL path to VirtualGL, so we do not need vgl_run (which only loads appropriate GL so to app). And bingo, opengl should work through XRDP. This may also require changes in VGL, because we must tell it hardware host display number through system variable or something.

stebo85 commented 7 years ago

Dear lieff and fang64, Has anyone made some progress on this problem? Since we upgraded to Ubuntu 16.04 we have the same issue with xrdp and we can't run GLX applications in XRDP or SSH + X forwarding in combination with the nvidia driver. For an SSH+X connection it is possible to define LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so and then things work again via mesa:

glxinfo name of display: localhost:11.0 Error: couldn't find RGB GLX visual or fbconfig

ldd which glxinfo linux-vdso.so.1 => (0x00007ffcb1dab000) libGL.so.1 => /usr/lib/nvidia-375/libGL.so.1 (0x00007f6fff66b000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f6fff330000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ffef66000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6ffed62000) libGLX.so.0 => /usr/lib/nvidia-375/libGLX.so.0 (0x00007f6ffeb31000) libGLdispatch.so.0 => /usr/lib/nvidia-375/libGLdispatch.so.0 (0x00007f6ffe863000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f6ffe641000) /lib64/ld-linux-x86-64.so.2 (0x000055fe04c33000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f6ffe42e000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f6ffe22a000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f6ffe024000)

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so

ldd which glxinfo linux-vdso.so.1 => (0x00007ffcc9d1b000) /usr/lib/x86_64-linux-gnu/mesa/libGL.so (0x00007f4f23641000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f4f232ca000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f22f00000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f4f22cd7000) libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f4f22ad3000) libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f4f228d0000) libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f4f226c9000) libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f4f224c5000) libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f4f22295000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f4f22083000) libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f4f21e7f000) libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f4f21c79000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f4f21a77000) libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f4f2185d000) libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f4f21658000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f4f21436000) libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f4f2122f000) libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f4f2101e000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4f20d15000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4f20af7000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f208f3000) /lib64/ld-linux-x86-64.so.2 (0x0000562a6e650000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f4f206ee000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f4f204e8000)

glxinfo name of display: localhost:11.0 display: localhost:11 screen: 0 direct rendering: Yes server glx vendor string: SGI server glx version string: 1.4 server glx extensions: GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group client glx vendor string: Mesa Project and SGI client glx version string: 1.4 client glx extensions: GLX_ARB_create_context, GLX_ARB_create_context_profile, GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync GLX version: 1.4 GLX extensions: GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read Extended renderer info (GLX_MESA_query_renderer): Vendor: VMware, Inc. (0xffffffff) Device: llvmpipe (LLVM 4.0, 256 bits) (0xffffffff) Version: 17.1.2 Accelerated: no Video memory: 193371MB Unified memory: no Preferred profile: core (0x1) Max core profile version: 3.3 Max compat profile version: 3.0 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.0 OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 4.0, 256 bits) OpenGL version string: 3.0 Mesa 17.1.2 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: GL_AMD_conservative_depth, GL_AMD_draw_buffers_blend, GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_stencil_export, GL_AMD_shader_trinary_minmax, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, GL_APPLE_packed_pixels, GL_APPLE_vertex_array_object, GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_arrays_of_arrays, GL_ARB_base_instance, GL_ARB_blend_func_extended, GL_ARB_buffer_storage, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, GL_ARB_clip_control, GL_ARB_color_buffer_float, GL_ARB_compressed_texture_pixel_storage, GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_cull_distance, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, GL_ARB_get_texture_sub_image, GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, GL_ARB_instanced_arrays, GL_ARB_internalformat_query, GL_ARB_internalformat_query2, GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_program_interface_query, GL_ARB_provoking_vertex, GL_ARB_robustness, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, GL_ARB_seamless_cubemap_per_texture, GL_ARB_separate_shader_objects, GL_ARB_shader_bit_encoding, GL_ARB_shader_objects, GL_ARB_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shading_language_420pack, GL_ARB_shading_language_packing, GL_ARB_shadow, GL_ARB_stencil_texturing, GL_ARB_sync, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, GL_ARB_texture_cube_map_array, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_float, GL_ARB_texture_gather, GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_stencil8, GL_ARB_texture_storage, GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_ARB_transform_feedback_instanced, GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_window_pos, GL_ATI_blend_equation_separate, GL_ATI_draw_buffers, GL_ATI_fragment_shader, GL_ATI_separate_stencil, GL_ATI_texture_compression_3dc, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array, GL_EXT_copy_texture, GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters, GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object, GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_polygon_offset_clamp, GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_separate_specular_color, GL_EXT_shader_integer_mix, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_latc, GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, GL_KHR_context_flush_control, GL_KHR_debug, GL_MESA_pack_invert, GL_MESA_shader_integer_functions, GL_MESA_texture_signed_rgba, GL_MESA_window_pos, GL_MESA_ycbcr_texture, GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, GL_NV_primitive_restart, GL_NV_texgen_reflection, GL_NV_texture_env_combine4, GL_NV_texture_rectangle, GL_OES_EGL_image, GL_OES_read_format, GL_S3_s3tc, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays

48 GLX Visuals visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat

0x021 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0a2 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x0a3 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x0a4 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x0a5 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x0aa 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x0ab 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x0ac 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x0ad 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x0ae 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x0af 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x0b0 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x0b1 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x0b2 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0b3 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x0b4 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0b5 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x0ba 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x0bb 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x0bc 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x0bd 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0be 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0bf 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0c0 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x0c1 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x0c2 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x0c3 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x0c8 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x0c9 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x0ca 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x0cb 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x0cc 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x0cd 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x0ce 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x0cf 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x0d0 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0d1 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x0d2 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0d3 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x0d8 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x0d9 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x0da 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x0db 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x0dc 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0dd 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0de 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0df 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x041 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None

64 GLXFBConfigs: visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat

0x042 0 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x043 0 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x044 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x045 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x04a 0 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x04b 0 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x04c 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x04d 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x052 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x053 24 tc 0 24 0 r . . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x054 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x055 24 tc 0 24 0 r y . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x05a 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x05b 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x05c 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x05d 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x05e 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x05f 24 tc 0 24 0 r . . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x060 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x061 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x062 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x063 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x064 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x065 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x06a 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x06b 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x06c 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x06d 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x06e 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x06f 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x070 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x071 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x072 0 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x073 0 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x074 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x075 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x07a 0 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x07b 0 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x07c 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x07d 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x082 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x083 24 dc 0 24 0 r . . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x084 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 0 0 0 0 0 0 None 0x085 24 dc 0 24 0 r y . 8 8 8 0 . . 0 0 0 16 16 16 0 0 0 Slow 0x08a 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x08b 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x08c 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 0 0 0 0 0 0 0 None 0x08d 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 0 16 16 16 0 0 0 Slow 0x08e 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x08f 24 dc 0 24 0 r . . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x090 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 0 0 None 0x091 24 dc 0 24 0 r y . 8 8 8 0 . . 0 24 8 16 16 16 0 0 0 Slow 0x092 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x093 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x094 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x095 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 16 16 16 16 0 0 Slow 0x09a 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x09b 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x09c 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 0 0 0 0 0 0 0 None 0x09d 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 0 16 16 16 16 0 0 Slow 0x09e 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x09f 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0a0 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0a1 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow

Is it possible to force xrdp to run via mesa as well? I would be happy with software rendering. In which ini file would I need to put LD_PRELOAD=/usr/lib/x86_64-linux-gnu/mesa/libGL.so to make it work?

We also tried the workaround via "/opt/VirtualGL/bin/vglrun application" but this only works for a few days and then something crashes and we have to restart the server to get it working again.

Thank you for any hint :) Steffen

lieff commented 7 years ago

@stebo85 vglrun probably stops working when X11 server crashed (I've seen this on CENTOS systems with buggy GLX/GL client code). X11 crashed because of nvidia glx module, so only newer driver/X11/system can help.

Hmm software mesa should always work, but note that libGL.so can load other .so files, and it must be not from nvidia driver. You can use strace to see what happen.

tycho commented 6 years ago

So I ran into this too, on Arch Linux. libGL.so is the vendor-neutral version (glvnd), so depending on what Xorg driver is loaded, it will get directed appropriately to NVIDIA's libGL or Mesa's. The problem for me seems to be that NVIDIA provides a file called /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf which adds the NVIDIA glx module to the search path before the Mesa one:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

I tested out commenting the NVIDIA OutputClass section and GLX seemed to work fine over Xrdp, but this obviously breaks GLX for users physically at the machine.

Presumably if there was an xorg.conf.d file loaded after this with an OutputClass section that only loaded when using the xorgxrdp driver, then it would be possible to re-insert the Mesa module path earlier in the load order. I just can't figure out any OutputClass section that would work, since the MatchDriver directive only seems to match kernel drivers (and I don't see any other Match* directives for the OutputClass section).

EDIT: Interesting, if I add this to /etc/X11/xrdp/xorg.conf, things are fine:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    ModulePath "/usr/lib/xorg/modules"
EndSection
cminnoy commented 5 years ago

This issue is still relevant for Ubuntu 18.02. After adding the above section to /etc/X11/xrdp/xorg.conf GLX applications, like Blender now work under RDP. Great. Unfortunatly I still don't have hardware acceleration for GLX, only software acceleration. Things like RemoteFX which is supposed to work when the client is in LAN mode and color depth is 24bit should theoretically work, but the logs ~/.xorgxrdp.% indicate otherwise.

(EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)

lieff commented 5 years ago

Also relevant for Ubuntu 19.04. Software render also can be enabled by modify .bashrc file and point path to software mesa libGL like:

if [ "$XRDP_SESSION" = "1" ]; then
export LD_LIBRARY_PATH=/path/to/mesa/lib:$LD_LIBRARY_PATH
fi
romybompart commented 4 years ago

Hi guys ! I'm trying to understand this. I am using a Jetson Nano from NVIDIA, operating system is release 18.04.4

I am trying to access remotely through my windows computer (remote desktop). But once I am entered, the sessions closes immediately.

This is my xorg.conf file.

rb@rb-desktop:/etc/X11/xrdp$ more xorg.conf 

Section "ServerLayout"
    Identifier "X11 Server"
    Screen "Screen (xrdpdev)"
    InputDevice "xrdpMouse" "CorePointer"
    InputDevice "xrdpKeyboard" "CoreKeyboard"
EndSection

Section "ServerFlags"
    Option "DontVTSwitch" "on"
    Option "AutoAddDevices" "off"
EndSection

Section "Module"
    Load "dbe"
    Load "ddc"
    Load "extmod"
    Load "glx"
    Load "int10"
    Load "record"
    Load "vbe"
    Load "xorgxrdp"
    Load "fb"
EndSection

Section "InputDevice"
    Identifier "xrdpKeyboard"
    Driver "xrdpkeyb"
EndSection

Section "InputDevice"
    Identifier "xrdpMouse"
    Driver "xrdpmouse"
EndSection

Section "Monitor"
    Identifier "Monitor"
    Option "DPMS"
    HorizSync 30-80
    VertRefresh 60-75
    ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync 
-vsync
    ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync
    Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync
    Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync
EndSection

Section "Device"
    Identifier "Video Card (xrdpdev)"
    Driver "xrdpdev"
EndSection

Section "Screen"
    Identifier "Screen (xrdpdev)"
    Device "Video Card (xrdpdev)"
    Monitor "Monitor"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "
1920x1080"
    EndSubSection
EndSection
matt335672 commented 4 years ago

Hi @romybompart

Have a look at #1582 where we looked into what may be exactly the same Jetson issue. There are some logs from that issue that you can compare with yours. There's also a link to the NVidia developers forum where you'll find more information.