# Nvidia EGL Wayland

## dimko

Did anyone manage to get Nvidia Binary work with Wayland?

I am getting this:

```

Date: 2019-01-31 GMT

[12:43:41.157] weston 3.0.0

               http://wayland.freedesktop.org

               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0

               Build: unknown (not built from git or tarball)

[12:43:41.157] Command line: /usr/bin/weston

[12:43:41.157] OS: Linux, 4.20.1-gentoo, #2 SMP PREEMPT Fri Jan 18 11:30:54 GMT 2019, x86_64

[12:43:41.157] warning: XDG_RUNTIME_DIR "/run/user/1000" is not configured

correctly.  Unix access mode must be 0700 (current mode is 700),

and must be owned by the user (current owner is UID 1000).

Refer to your distribution on how to get it, or

http://www.freedesktop.org/wiki/Specifications/basedir-spec

on how to implement it.

[12:43:41.157] Starting with no config file.

[12:43:41.157] Output repaint window is 7 ms maximum.

[12:43:41.157] Loading module '/usr/lib64/libweston-3/drm-backend.so'

[12:43:41.157] Failed to load module: /usr/lib64/libweston-3/drm-backend.so: cannot open shared object file: No such file or directory

[12:43:41.157] fatal: failed to create compositor backend

```

Weston is compiled with wayland-compositor and without DRM.(drm required Intel or AMD GPU)

So what was your experience?

----------

## Tyler_Durden

 *dimko wrote:*   

> Did anyone manage to get Nvidia Binary work with Wayland?
> 
> ...
> 
> So what was your experience?

 

What DE do you like to use with wayland? Did you saw this Headline at Phoronix?

I managed to patch and re-emerge kwin with the code by Erik Kurzinger, restarted sddm and after an unusual long wait I saw my first wayland session with Nvidia binary drivers (418.30)   :Very Happy:   but with a not fitting resolution at my 4K Monitor via HDMI.

Tried to start the plasma display setting app, but it was mirror-inverted, unstable and disappeared frequently and therefore unusable.

Have to go deeper into this interesting new toy...

----------

## dimko

 *Tyler_Durden wrote:*   

>  *dimko wrote:*   Did anyone manage to get Nvidia Binary work with Wayland?
> 
> ...
> 
> So what was your experience? 
> ...

 

I did read Phoronix thats why i decided to give it a go again.

I am on Gnome though.

Mutter does not seem to support wayland on its own, but it can 'nest' natively into Weston.

I changed flags.

Weston compiled with DRM.

I get other error now.

This technology is not good enough at this time.

Not for EGL, not for Nvidia anyway.

----------

## Tyler_Durden

 *dimko wrote:*   

>  *Tyler_Durden wrote:*    *dimko wrote:*   Did anyone manage to get Nvidia Binary work with Wayland?
> 
> ...
> 
> So what was your experience? 
> ...

 

You're giving up too fast. Weston 5.0 is working well:

```
Date: 2019-01-31 CET

[21:59:01.941] weston 5.0.0

               https://wayland.freedesktop.org

               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/

               Build: unknown (not built from git or tarball)

[21:59:01.941] Command line: weston

[21:59:01.941] OS: Linux, 4.20.0-pf3, #2 SMP PREEMPT Thu Jan 31 19:27:20 CET 2019, x86_64

[21:59:01.941] Using config file '/home/peter/.config/weston.ini'

[21:59:01.941] Output repaint window is 7 ms maximum.

[21:59:01.941] Loading module '/usr/lib64/libweston-5/x11-backend.so'

[21:59:01.943] Loading module '/usr/lib64/libweston-5/gl-renderer.so'

[21:59:01.944] EGL client extensions: EGL_EXT_platform_base EGL_EXT_device_base

               EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions

               EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11

               EGL_EXT_platform_device EGL_KHR_platform_wayland

               EGL_EXT_platform_wayland

[21:59:01.947] warning: Disabling render GPU timeline due to missing EGL_ANDROID_native_fence_sync extension

[21:59:01.947] EGL_KHR_surfaceless_context available

[21:59:02.043] EGL version: 1.5

[21:59:02.043] EGL vendor: NVIDIA

[21:59:02.043] EGL client APIs: OpenGL_ES OpenGL

[21:59:02.043] EGL extensions: EGL_EXT_buffer_age EGL_EXT_client_sync

               EGL_EXT_create_context_robustness EGL_EXT_output_base

               EGL_EXT_stream_acquire_mode EGL_EXT_sync_reuse

               EGL_IMG_context_priority EGL_KHR_config_attribs

               EGL_KHR_create_context_no_error EGL_KHR_context_flush_control

               EGL_KHR_create_context EGL_KHR_display_reference

               EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses

               EGL_KHR_partial_update EGL_KHR_swap_buffers_with_damage

               EGL_KHR_no_config_context EGL_KHR_gl_colorspace

               EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image

               EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image

               EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap

               EGL_KHR_reusable_sync EGL_KHR_stream EGL_KHR_stream_attrib

               EGL_KHR_stream_consumer_gltexture

               EGL_KHR_stream_cross_process_fd EGL_KHR_stream_fifo

               EGL_KHR_stream_producer_eglsurface EGL_KHR_surfaceless_context

               EGL_KHR_wait_sync EGL_NV_nvrm_fence_sync EGL_NV_post_sub_buffer

               EGL_NV_stream_cross_display EGL_NV_stream_cross_object

               EGL_NV_stream_cross_process EGL_NV_stream_cross_system

               EGL_NV_stream_flush EGL_NV_stream_metadata EGL_NV_stream_remote

               EGL_NV_stream_reset EGL_NV_stream_socket

               EGL_NV_stream_socket_inet EGL_NV_stream_socket_unix

               EGL_NV_stream_sync EGL_NV_stream_fifo_next

               EGL_NV_stream_fifo_synchronous

               EGL_NV_stream_consumer_gltexture_yuv EGL_NV_stream_attrib

               EGL_NV_system_time EGL_NV_output_drm_flip_event

               EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream

[21:59:02.043] GL version: OpenGL ES 3.2 NVIDIA 418.30

[21:59:02.043] GLSL version: OpenGL ES GLSL ES 3.20

[21:59:02.043] GL vendor: NVIDIA Corporation

[21:59:02.043] GL renderer: GeForce GTX 1080 Ti/PCIe/SSE2

[21:59:02.043] GL extensions: GL_EXT_base_instance GL_EXT_blend_func_extended

               GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture

               GL_EXT_clip_control GL_EXT_clip_cull_distance

               GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float

               GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_debug_label

               GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query

               GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex

               GL_EXT_EGL_image_array GL_EXT_EGL_image_storage

               GL_EXT_EGL_image_external_wrap_modes GL_EXT_float_blend

               GL_EXT_frag_depth GL_EXT_geometry_point_size

               GL_EXT_geometry_shader GL_EXT_gpu_shader5

               GL_EXT_map_buffer_range GL_EXT_multi_draw_indirect

               GL_EXT_multisample_compatibility

               GL_EXT_multisampled_render_to_texture

               GL_EXT_multisampled_render_to_texture2

               GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp

               GL_EXT_post_depth_coverage GL_EXT_primitive_bounding_box

               GL_EXT_raster_multisample GL_EXT_render_snorm GL_EXT_robustness

               GL_EXT_separate_shader_objects GL_EXT_shader_group_vote

               GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix

               GL_EXT_shader_io_blocks

               GL_EXT_shader_non_constant_global_initializers

               GL_EXT_shader_texture_lod GL_EXT_shadow_samplers

               GL_EXT_sparse_texture GL_EXT_sparse_texture2 GL_EXT_sRGB

               GL_EXT_sRGB_write_control GL_EXT_tessellation_point_size

               GL_EXT_tessellation_shader GL_EXT_texture_border_clamp

               GL_EXT_texture_buffer GL_EXT_texture_compression_bptc

               GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc

               GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array

               GL_EXT_texture_filter_anisotropic GL_EXT_texture_filter_minmax

               GL_EXT_texture_format_BGRA8888

               GL_EXT_texture_mirror_clamp_to_edge GL_EXT_texture_norm16

               GL_EXT_texture_rg GL_EXT_texture_sRGB_R8

               GL_EXT_texture_sRGB_decode GL_EXT_texture_storage

               GL_EXT_texture_view GL_EXT_draw_transform_feedback

               GL_EXT_unpack_subimage GL_EXT_window_rectangles

               GL_KHR_context_flush_control GL_KHR_debug GL_EXT_memory_object

               GL_EXT_memory_object_fd GL_KHR_parallel_shader_compile

               GL_KHR_no_error GL_KHR_robust_buffer_access_behavior

               GL_KHR_robustness GL_EXT_semaphore GL_EXT_semaphore_fd

               GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced

               GL_NV_blend_equation_advanced_coherent

               GL_NVX_blend_equation_advanced_multi_draw_buffers

               GL_NV_blend_minmax_factor GL_NV_clip_space_w_scaling

               GL_NV_conditional_render GL_NV_conservative_raster

               GL_NV_conservative_raster_pre_snap_triangles GL_NV_copy_buffer

               GL_NV_copy_image GL_NV_draw_buffers GL_NV_draw_instanced

               GL_NV_draw_texture GL_NV_draw_vulkan_image

               GL_NV_EGL_stream_consumer_external

               GL_NV_explicit_attrib_location GL_NV_fbo_color_attachments

               GL_NV_fill_rectangle GL_NV_fragment_coverage_to_color

               GL_NV_fragment_shader_interlock GL_NV_framebuffer_blit

               GL_NV_framebuffer_mixed_samples GL_NV_framebuffer_multisample

               GL_NV_generate_mipmap_sRGB GL_NV_geometry_shader_passthrough

               GL_NV_instanced_arrays GL_NV_internalformat_sample_query

               GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_memory_attachment

               GL_NV_occlusion_query_samples GL_NV_non_square_matrices

               GL_NV_pack_subimage GL_NV_packed_float

               GL_NV_packed_float_linear GL_NV_path_rendering

               GL_NV_path_rendering_shared_edge GL_NV_pixel_buffer_object

               GL_NV_polygon_mode GL_NV_read_buffer GL_NV_read_depth

               GL_NV_read_depth_stencil GL_NV_read_stencil

               GL_NV_sample_locations GL_NV_sample_mask_override_coverage

               GL_NV_shader_atomic_fp16_vector

               GL_NV_shader_noperspective_interpolation

               GL_NV_shadow_samplers_array GL_NV_shadow_samplers_cube

               GL_NV_sRGB_formats GL_NV_stereo_view_rendering

               GL_NV_texture_array GL_NV_texture_barrier

               GL_NV_texture_border_clamp GL_NV_texture_compression_latc

               GL_NV_texture_compression_s3tc

               GL_NV_texture_compression_s3tc_update GL_NV_timer_query

               GL_NV_viewport_array GL_NV_viewport_array2

               GL_NV_viewport_swizzle GL_KHR_blend_equation_advanced

               GL_KHR_blend_equation_advanced_coherent

               GL_OES_compressed_ETC1_RGB8_texture

               GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_depth24

               GL_OES_depth32 GL_OES_depth_texture

               GL_OES_depth_texture_cube_map GL_OES_copy_image

               GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex

               GL_OES_texture_border_clamp GL_OES_tessellation_point_size

               GL_OES_tessellation_shader GL_OES_texture_buffer

               GL_OES_geometry_point_size GL_OES_geometry_shader

               GL_OES_gpu_shader5 GL_OES_shader_io_blocks GL_OES_texture_view

               GL_OES_primitive_bounding_box GL_OES_EGL_image

               GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3

               GL_OES_EGL_sync GL_OES_element_index_uint

               GL_OES_fbo_render_mipmap GL_OES_get_program_binary

               GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8

               GL_OES_sample_shading GL_OES_sample_variables

               GL_OES_shader_image_atomic

               GL_OES_shader_multisample_interpolation

               GL_OES_standard_derivatives GL_OES_surfaceless_context

               GL_OES_texture_cube_map_array GL_OES_texture_npot

               GL_OES_texture_float GL_OES_texture_float_linear

               GL_OES_texture_half_float GL_OES_texture_half_float_linear

               GL_OES_texture_stencil8

               GL_OES_texture_storage_multisample_2d_array

               GL_OES_vertex_array_object GL_OES_vertex_half_float

               GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2

               GL_OVR_multiview_multisampled_render_to_texture

               GL_ANDROID_extension_pack_es31a

[21:59:02.043] GL ES 2 renderer features:

               read-back format: RGBA

               wl_shm sub-image to texture: yes

               EGL Wayland extension: yes

[21:59:02.043] Using gl renderer

[21:59:02.046] Registered plugin API 'weston_windowed_output_api_v1' of size 16

[21:59:02.046] Chosen EGL config details:

               RGBA bits: 8 8 8 0

               swap interval range: 0 - 8

[21:59:02.079] x11 output 1024x600, window id 46137350

[21:59:02.079] Output 'screen0' enabled with head(s) screen0

[21:59:02.079] Compositor capabilities:

               arbitrary surface rotation: yes

               screen capture uses y-flip: yes

               presentation clock: CLOCK_MONOTONIC_RAW, id 4

               presentation clock resolution: 0.000000001 s

[21:59:02.079] Loading module '/usr/lib64/weston/desktop-shell.so'

[21:59:02.079] launching '/usr/libexec/weston-keyboard'

[21:59:02.080] launching '/usr/libexec/weston-desktop-shell'

```

```

[ebuild   R    ] dev-libs/weston-5.0.0::mv  USE="X colord dbus drm gles2 jpeg launch lcms pam resize-optimization suid systemd wayland-compositor xwayland -editor -examples -fbdev -headless -ivi -rdp -screen-sharing -static-libs -test -webp" 0 KiB

```

----------

## dimko

 *Tyler_Durden wrote:*   

> 
> 
> You're giving up too fast. Weston 5.0 is working well:
> 
> 

 

Allright...

I was on version 3 of Weston.

Will try version 5.

Also, what command line options did you use for weston?(probably nothing special, but just in case?)

----------

## dimko

```
Date: 2019-01-31 GMT

[22:02:51.468] weston 5.0.0

               https://wayland.freedesktop.org

               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/

               Build: unknown (not built from git or tarball)

[22:02:51.468] Command line: /usr/bin/weston

[22:02:51.468] OS: Linux, 4.20.1-gentoo, #2 SMP PREEMPT Fri Jan 18 11:30:54 GMT 2019, x86_64

[22:02:51.468] Starting with no config file.

[22:02:51.468] Output repaint window is 7 ms maximum.

[22:02:51.468] Loading module '/usr/lib64/libweston-5/drm-backend.so'

[22:02:51.469] initializing drm backend

[22:02:51.472] logind: session control granted

[22:02:51.474] using /dev/dri/card0

[22:02:51.474] DRM: supports universal planes

[22:02:51.474] DRM: supports atomic modesetting

[22:02:51.474] DRM: supports picture aspect ratio

[22:02:51.474] Loading module '/usr/lib64/libweston-5/gl-renderer.so'

gbm: failed to open any driver (search paths /usr/lib64/dri)

gbm: Last dlopen error: /usr/lib64/dri/nouveau_dri.so: cannot open shared object file: No such file or directory

failed to load driver: nouveau

gbm: failed to open any driver (search paths /usr/lib64/dri)

gbm: Last dlopen error: /usr/lib64/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory

failed to load driver: kms_swrast

[22:02:51.477] EGL client extensions: EGL_EXT_platform_base EGL_EXT_device_base

               EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions

               EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11

               EGL_EXT_platform_device EGL_KHR_platform_wayland

               EGL_EXT_platform_wayland

[22:02:51.477] failed to initialize egl

[22:02:51.478] fatal: failed to create compositor backend

```

OK. For clarification, 780TI Binary.

Driver:

```
[ebuild   R    ] x11-drivers/nvidia-drivers-415.27:0/415::gentoo  USE="X acpi driver gtk3 kms multilib tools -compat -static-libs -uvm -wayland*" ABI_X86="32 (64) (-x32)" 0 KiB
```

Now, wayland was enabled through use of $USE variable.(i can see it's green in output)

Weston was compiled exactly like in your case, same flags, one by one.

Screen goes black until you touch keyboard. And then goes back into console.

```

 lsmod |grep nvidia

nvidia_drm             40960  4

nvidia_modeset       1003520  9 nvidia_drm

nvidia              16752640  374 nvidia_modeset
```

----------

## Tyler_Durden

 *dimko wrote:*   

> 
> 
> ```
> Date: 2019-01-31 GMT
> 
> ...

 

I started weston without any parameters. If I specify any available backend, I'll get a broken pipe error.

```
gbm: Last dlopen error: /usr/lib64/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory
```

This file belongs to mesa. But don't know, if it's really necessary. But maybe you didn't set USE=egl in general?

```
equery h egl

 * Searching for USE flag egl ... 

[I-O] [  ] dev-qt/qtgui-5.12.0:5/5.12

[IP-] [  ] media-libs/clutter-1.26.2-r1:1.0

[IP-] [  ] media-libs/gst-plugins-bad-1.14.3:1.0

[IP-] [  ] media-libs/gst-plugins-base-1.14.4-r1:1.0

[IP-] [  ] media-libs/mesa-18.3.2:0

[IP-] [  ] media-plugins/gst-plugins-gtk-1.14.4:1.0

[I-O] [  ] media-video/mpv-0.29.1-r1:0

[IP-] [  ] x11-apps/mesa-progs-8.3.0:0

```

I merged mesa this way:

```
[ebuild   R    ] media-libs/mesa-18.3.2::gentoo  USE="classic dri3 egl gallium gbm gles2 llvm lm_sensors opencl vdpau wayland xvmc -d3d9 -debug -gles1 -osmesa -pax_kernel -pic (-selinux) -test -unwind -vaapi -valgrind -vulkan -xa" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="(-freedreno) -i915 -i965 (-imx) -intel -nouveau -r100 -r200 -r300 -r600 -radeon -radeonsi (-vc4) -virgl (-vivante) -vmware" 0 KiB
```

----------

## dimko

```
 equery h egl 

 * Searching for USE flag egl ... 

[IP-] [  ] dev-qt/qtgui-5.11.3:5/5.11

[IP-] [  ] media-libs/clutter-1.26.2-r1:1.0

[IP-] [  ] media-libs/gst-plugins-bad-1.14.3:1.0

[IP-] [  ] media-libs/gst-plugins-base-1.14.4-r1:1.0

[IP-] [  ] media-libs/mesa-18.2.8:0

[IP-] [  ] media-plugins/gst-plugins-gtk-1.14.4:1.0

[IP-] [  ] net-libs/webkit-gtk-2.22.5:4/37

[IP-] [  ] x11-apps/mesa-progs-8.3.0:0

```

Just compiled Mesa without vulkan so I don't have to choose AMD gpu.(requirement with vulkan use flag)

same story exactly.

And I am not sure, how mesa is relevant when comes to wayland protocol? Isn't it supposed to be stand alone, since it's replacement of mesa? I understand Xwayland, but weston can work without it I guess?

I am not getting even that.

----------

