NVIDIA (495) on sway tutorial + questions (Arch-based distros)

Since this merge and the 495 driver, we are all trying to make sway run “out of the box”.

Since “running out of the box” is a strong statement, let us try to build this box such that we have a baseline to give you quality feedback on this beta driver.

I would appreciate very much in case you (NVIDIA) be so kind to confim the following steps and open questions we have as a community, and I will try to keep this thread as clean as possible considering your feedback, updating the steps accordingly.

#1) First, let us assume we have an Arch-based distro and we have a supported NVIDIA card.

  1. GBM API support for a single NVIDIA card: (Yes / No);

  2. GBM API support for hybrid setups (NVIDIA + intel). Here, I mean just GBM API, nvidia only, no prime-offload: (Yes / Partial / No)

  3. GBM API support for hybrid setups (NVIDIA + intel) with prime-offload: (Yes / Partial / No (for 470, not sure for 495)

#2) Install 495 KMS driver using TKG’s Frogging-Family/nvidia-all PKBUILD. Here, I chose Tkg’s installer so we could have a Arch-agnostic installer.

  1. Can you confirm that TKG’s installer works in your test environment and does what you expect from your new GBM shared libraries? (cf. commits 9404b959dce5152da15afb5b9cda4907c3492e8d and ef12a70f293cb23b35205503eab4de63af52305d ) (Yes / No)

#3) Install libxcb-git from AUR;

#4) Install mesa-git from AUR;

#5) Install libglvnd-git and lib32-libglvnd-git from AUR;

#6) Install egl-wayland-git from AUR (egl-wayland-git depends on libglvnd-git) to work);

#7) Install xorg-xwayland-git from AUR. I’ve built with eglstreams and managed to work, but we have people building xwayland without eglstreams (cf. this reddit thread ). So,

  1. Build Xwayland with eglstreams? (Yes / No)

#8) Install libdrm-git from AUR;

#9) change /etc/mkinitcpio.conf such that we have nvidia drivers available as soon as possible:

  1. MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)

  2. Does the order matters here? For example, in case one has an optimus device, should one add i915 before or after the NVIDIA drivers?

  3. Update initramfs with sudo mkinitcpio -P

#10) Change /etc/default/grub and add rd.driver.blacklist=nouveau nvidia-drm.modeset=1 to GRUB_CMDLINE_LINUX_DEFAULT

  1. Blocking nouveau and adding nvidia-drm.modeset=1 as a redundancy fallback to ensure we’ve enabled modesetting.

  2. Update grub grub-mkconfig -o /boot/grub/grub.cfg

#11) Steps 1-10 should be enough to satisfy all dependencies we have for 495 GBM API right? (Yes / No)

=====================================

#12) From here, one can install wlroots-git and sway-git from AUR.

Here, I am assuming one knows how to setup and configure sway (it might be a strong assumption, since it was not an option before, but anyway…).

  1. sway now identifies that we are trying to run it with NVIDIA’s proprietary driver and tries to avoid it. So, one workaround is :

  2. In case one has a login manager (like SDDM or GDM), modify /usr/share/wayland-sessions/sway.desktop such that one ends up with Exec=sway --my-next-gpu-wont-be-nvidia

  3. In case lunching from TTY, use sway --my-next-gpu-wont-be-nvidia

#13) Run sway and test nvidia-smi, check whether sway is there

#14) Install vulkan-tools

  1. Run vkcube and check whether one has a spinning cube, and vulkan renderer selected NVIDIA.

=====================================

With all that said and done, steps 1-14 should provide a functional sway setup with the 495 driver on Arch-based distros with hardware acceleration.

Some open questions remain though, for instance, on Wayland/XWayland, do we have support for the following? If so, what is the recommended setup?

  1. Coolbits (Yes / No)

  2. TripleBuffer (Yes / No)

  3. Sync to VBlank (Yes / No)

  4. Flipping (Yes / No)

  5. GSync (Yes / No)

  6. Runtime D3 (RTD3) Power Management (All / Fine / Coarse / None)

Another thing is the external monitor issue. Since 470 drivers, we have numerous reports here in this forum showing that external monitors do not work on Wayland, and it remains on 495 (cf. sway issue ticket , I can confirm this issue)
Can you acknowledge this issue? At least give us a internal bug report ID. I can give you my bug report files, in a separated thread, since I am trying to keep this one as clean as possible.

7 Likes

Should we collate bugs and issues related to using GBM as well? Here are the issues I’ve seen so far:

  • Unable to use hardware cursor with Sway (requires WLR_NO_HARDWARE_CURSORS=1)

  • wf-recorder not working with NVENC (I keep getting errors like pts (811) < dts (2441) in stream 0)

  • mpv dropping frames

    • mpv requires opengl-es=yes option (displays black window otherwise)

    • mpv drops frames with or without NVDEC enabled (options used are vo=gpu, opengl-es=yes, hwdec=nvdec)

  • Terminals

    • foot terminal has flickering issue when newlines are loaded (reproduce by holding Enter)

    • foot also fails to copy-and-paste text from other applications (warn: selection.c:1602: no data received from clipboard in 2 seconds, aborting)

    • alacritty is unresponsive (exceptionally slow)

  • Fails to launch sway-git due to this assertion

  • OBS does not start (eglChooseConfig failed, device_create (GL) failed)

3 Likes

My GPU is NVIDIA GeForce GTX 1650 Mobile / Max-Q.

System variables related to Wayland:

CLUTTER_BACKEND=wayland
SDL_VIDEODRIVER=wayland
XDG_SESSION_TYPE=wayland
QT_QPA_PLATFORM=wayland
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
MOZ_ENABLE_WAYLAND=1
GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
WLR_NO_HARDWARE_CURSORS=1 

Sway .bashrc startup command:

exec sway --unsupported-gpu -c /home/user/.config/sway/config

I’m using sway/wlroots (-git fail with the aforementioned assertion) + nvidia-all + mesa + libdrm-git/xorg-xwayland-git/egl-wayland-git/libglvnd-git/lib32-libglvnd-git. I’ve explicitly disabled XWayland in sway, so I can say for sure that XWayland isn’t in use. Apart from the bugs mentioned above:

  • Any apps utilizing OpenGL flicker/show artifacts, i.e. Chromium, VS Code, Kitty, Telegram’s picture/video previews. I managed to get Chromium working on Vulkan, and it’s also doing the same thing. Firefox, on the other hand, is running perfectly with forced hardware acceleration through Webrender.
  • I found an interesting detail by running VS Code without HW acceleration, it keeps flickering.
  • Telegram with OpenGL disabled works as expected.
2 Likes

Followed the instructions above from a fresh arch install and it’s core dumping - I’m still working on troubleshooting this.

00:00:00.000 [INFO] [sway/main.c:312] Sway version 1.6-ca8c6c3d (Oct 17 2021, branch 'master')
00:00:00.000 [INFO] [sway/main.c:313] wlroots version 0.15.0
00:00:00.002 [INFO] [sway/main.c:118] Linux desktop 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux
00:00:00.002 [INFO] [sway/main.c:134] Contents of /etc/os-release:
00:00:00.002 [INFO] [sway/main.c:118] NAME="Arch Linux"
00:00:00.002 [INFO] [sway/main.c:118] PRETTY_NAME="Arch Linux"
00:00:00.002 [INFO] [sway/main.c:118] ID=arch
00:00:00.002 [INFO] [sway/main.c:118] BUILD_ID=rolling
00:00:00.002 [INFO] [sway/main.c:118] ANSI_COLOR="38;2;23;147;209"
00:00:00.002 [INFO] [sway/main.c:118] HOME_URL="https://archlinux.org/"
00:00:00.002 [INFO] [sway/main.c:118] DOCUMENTATION_URL="https://wiki.archlinux.org/"
00:00:00.002 [INFO] [sway/main.c:118] SUPPORT_URL="https://bbs.archlinux.org/"
00:00:00.002 [INFO] [sway/main.c:118] BUG_REPORT_URL="https://bugs.archlinux.org/"
00:00:00.002 [INFO] [sway/main.c:118] LOGO=archlinux
00:00:00.002 [INFO] [sway/main.c:106] LD_LIBRARY_PATH=
00:00:00.002 [INFO] [sway/main.c:106] LD_PRELOAD=
00:00:00.002 [INFO] [sway/main.c:106] PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
00:00:00.002 [INFO] [sway/main.c:106] SWAYSOCK=
00:00:00.002 [ERROR] [sway/main.c:60] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.002 [DEBUG] [sway/server.c:49] Preparing Wayland server initialization
00:00:00.007 [INFO] [wlr] [libseat] [libseat/libseat.c:62] Seat opened with backend 'logind'
00:00:00.007 [INFO] [wlr] [backend/session/session.c:110] Successfully loaded libseat session
00:00:00.008 [INFO] [wlr] [backend/backend.c:296] Found 1 GPUs
00:00:00.008 [INFO] [wlr] [backend/drm/backend.c:174] Initializing DRM backend for /dev/dri/card0 (nvidia-drm)
00:00:00.008 [DEBUG] [wlr] [backend/drm/drm.c:85] Using atomic DRM interface
00:00:00.008 [DEBUG] [wlr] [backend/drm/drm.c:98] ADDFB2 modifiers supported
00:00:00.008 [INFO] [wlr] [backend/drm/drm.c:260] Found 4 DRM CRTCs
00:00:00.008 [INFO] [wlr] [backend/drm/drm.c:187] Found 12 DRM planes
00:00:00.011 [INFO] [wlr] [render/egl.c:175] Supported EGL client extensions: EGL_EXT_platform_base EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query 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 EGL_MESA_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
00:00:00.012 [DEBUG] [wlr] [render/egl.c:413] Using EGL device /dev/dri/card0
00:00:00.018 [INFO] [wlr] [render/egl.c:316] Supported EGL display extensions: EGL_EXT_buffer_age EGL_EXT_client_sync EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_MESA_image_dma_buf_export EGL_EXT_output_base EGL_EXT_output_drm EGL_EXT_protected_content EGL_EXT_stream_consumer_egloutput 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_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_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_quadruple_buffer EGL_NV_stream_consumer_eglimage EGL_NV_stream_cross_display EGL_NV_stream_cross_object EGL_NV_stream_cross_process EGL_NV_stream_cross_system EGL_NV_stream_dma 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_stream_origin EGL_NV_system_time EGL_NV_output_drm_flip_event EGL_NV_triple_buffer EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream
00:00:00.018 [INFO] [wlr] [render/egl.c:318] Supported EGL device extensions: EGL_NV_device_cuda EGL_EXT_device_drm EGL_EXT_device_drm_render_node EGL_EXT_device_persistent_id
00:00:00.018 [INFO] [wlr] [render/egl.c:320] Using EGL 1.5
00:00:00.018 [INFO] [wlr] [render/egl.c:321] EGL vendor: NVIDIA
00:00:00.018 [INFO] [wlr] [render/egl.c:323] EGL driver name: nvidia
00:00:00.018 [DEBUG] [wlr] [render/egl.c:150] Supported DMA-BUF formats: AB24 XB24 R8   RG88 UYVY AB4H AR24 AS24 XS24 XR24 RG16 AR30 R101 R100 AB30 B101 B100 YU12 NV12 NV21 NV16 NV24 P010 P210 P012 HD01 UHD0
00:00:00.018 [DEBUG] [wlr] [render/egl.c:151] EGL DMA-BUF format modifiers supported
00:00:00.021 [DEBUG] [wlr] [render/egl.c:364] Obtained high priority context
00:00:00.021 [DEBUG] [wlr] [render/egl.c:461] Using EGL_PLATFORM_DEVICE_EXT
00:00:00.035 [INFO] [wlr] [render/gles2/renderer.c:732] Creating GLES2 renderer
00:00:00.035 [INFO] [wlr] [render/gles2/renderer.c:733] Using OpenGL ES 3.2 NVIDIA 495.29.05
00:00:00.035 [INFO] [wlr] [render/gles2/renderer.c:734] GL vendor: NVIDIA Corporation
00:00:00.035 [INFO] [wlr] [render/gles2/renderer.c:735] GL renderer: NVIDIA GeForce RTX 3080/PCIe/SSE2
00:00:00.035 [INFO] [wlr] [render/gles2/renderer.c:736] Supported GLES2 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_depth_clamp 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_multiview_texture_multisample GL_EXT_multiview_timer_query 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_query_lod GL_EXT_texture_rg GL_EXT_texture_shadow_lod 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_NV_memory_object_sparse 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_timeline_semaphore GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_texture_compression_astc_hdr 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_compute_shader_derivatives 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_barycentric 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_mesh_shader 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_primitive_shading_rate GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_representative_fragment_test GL_NV_sample_locations GL_NV_sample_mask_override_coverage GL_NV_scissor_exclusive GL_NV_shader_atomic_fp16_vector GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shader_texture_footprint GL_NV_shading_rate_image 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_texture_dirty_tile_map 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
00:00:00.036 [DEBUG] [wlr] [render/allocator/allocator.c:97] Trying to create gbm allocator
00:00:00.036 [DEBUG] [wlr] [render/allocator/allocator.c:38] drmModeCreateLease failed, falling back to plain open
00:00:00.036 [DEBUG] [wlr] [render/allocator/gbm.c:194] Created GBM allocator with backend nvidia
00:00:00.036 [DEBUG] [wlr] [render/allocator/gbm.c:197] Using DRM node /dev/dri/renderD128
00:00:00.036 [INFO] [sway/main.c:360] Starting sway version 1.6-ca8c6c3d (Oct 17 2021, branch 'master')
00:00:00.036 [DEBUG] [sway/server.c:74] Initializing Wayland server
sway: render/wlr_renderer.c:226: wlr_renderer_init_wl_display: Assertion `argb8888 && xrgb8888' failed.
1 Like

@gabe1938182 , try wlroots and sway, not the -git versions.

I’m using Garuda with TKG kernel and it is working fine with -git versions. I thought it would make a Arch-agnostic with libglvnd-git, but it apparently there is something else.

Hi all, thanks for the detailed checklist.
I’m the original poster of that issue in Sway’s bug tracking op mentioned.

I can confirm that the issue still happens, despite trying a number of different combinations of packages: sway[-git], wlroots[-git], nvidia-beta, etc. At this point my setup is pretty much as in op’s post: nvidia-all, every possible -git package from AUR except perhaps mesa.

So far I have these issues:

  • external monitor is detected, enabling it results in eglCreateImageKHR, error: EGL_BAD_ALLOC (0x3003), message: "EGL_BAD_ALLOC error: In eglCreateImageKHR: could not bind to DMA bufferas reported
  • kitty won’t start, throwing:
02:22:47.383 [ERROR] [wlr] [EGL] command: eglCreateImageKHR, error: EGL_BAD_MATCH (0x3009), message: "dri2_create_image_khr_texture"
02:22:47.383 [ERROR] [wlr] [render/egl.c:678] eglCreateImageKHR failed
02:22:47.383 [ERROR] [wlr] [render/gles2/texture.c:273] Failed to create EGL image from DMA-BUF
  • firefox crashes when started with `MOZ_WAYLAND_ENABLE=1

As mentioned in Sway’s issue tracker, I tried to force Sway to use the nvidia gpu as primary one, by setting it first in WLR_DRM_DEVICES:

  • external monitor would turn on, enabling the laptop’s monitor would result in a similar error
  • kitty starts up, although with glitches and artiacts

As op mentioned, it would be beneficial to at least have a clear understanding if multi-gpu for hybrid laptops is supported or not.

1 Like

@0ojqr , When I first decided to write here, I was testing the “out of the box” hypothesis, with minimal -git dependencies.

But, after trying multiple combinations of packages, I fail to see a stable setup using

  • libxcb (1.13);
  • mesa (21.2);
  • egl-wayland (1.1.9);
  • xwayland (c468d34c);

as written in Chapter 38. OpenGL and Vulkan on Xwayland and Chapter 39. GBM and GBM-based Wayland Compositors.

So, instead of trying to fit the minimal requirements, we should indeed start everything from git and reduce afterwards. It is the best combination I’ve got so far.

I will edit the first post reflecting these changes.

I’ve been able to run Wayland (XWayland requires the git version as well but I’m not running anything requiring it right now) with just egl-wayland-git from the AUR (everything else is from the Arch repo) with the issues listed above.

1 Like

Following your instructions to the tee on a fresh install trying both TKG and aur nvidia-beta drivers. I get a segfault when trying to launch sway --my-next-gpu-wont-be-nvidia. Arch states sway - nvidia driver is already in use and then segmentation faults. Using all -git versions, I tried non git versions of sway and wlroots as well with gbm version of wlroots and still failed to boot into sway? Do you have any suggestions to boot into sway, I spent a while trying to troubleshoot to no avail.

@jrgiacone , you might try a conservative approach first (like @sheepymeh mentioned, everything from Arch repo, except egl-wayland-git). You will probably face the same issues mentioned here.

When I included mesa-git, I was testing recent merges around EGL.
Keep in mind that, as soon as you start compiling important things like mesa, you are in a super bleeding edge scenario, so try to move from stable to -git one by one.

It might also be a driver loading issue. Changing /etc/mkinitcpio.conf and /etc/default/grub always did the trick to me in different setups I have, but you might need a device specific solution.

1 Like

@sheepymeh, did you figure out how to get sway-git to get past the core dump of the argb8888?

I agree I can get it to work with normal sway and wlroots, everything else git. Sway-git segfaults

@qumaciel my issue was my grub was not loading the parameters to the linux on my other drive. I run an experimental drive for stuff like this so i dont mess with my production machine when I want to tinker. I had to manually edit the grub.cfg for the lower drive

Deleting the assertion seems to stop the issue (delete lines 214 to 230 from render/wlr_renderer.c), but this doesn’t fix the underlying problem of ARGB8888 and XRGB8888 not being supported (although I must say I’m not very sure what those are).

Also, Vulkan seems broken for my current setup:

$ vkcube
Selected GPU 0: NVIDIA GeForce GTX 1070, type: 2
Segmentation fault (core dumped)

However, now that the initial Vulkan renderer has been committed to wlroots, I wonder if that would help with Nvidia compatibility as well. Currently, it builds after installing vulkan-headers but does not start (might be related to the Vulkan error above, I probably didn’t set up Vulkan properly):

$ WLR_RENDERER=vulkan ./sway --unsupported-gpu
00:00:00.003 [sway/main.c:60] !!! Proprietary Nvidia drivers are in use !!!
00:00:00.014 [wlr] [render/vulkan/vulkan.c:208] Could not create instance: ERROR_LAYER_NOT_PRESENT (-6)
00:00:00.014 [wlr] [render/vulkan/renderer.c:1494] creating vulkan instance for renderer failed
00:00:00.014 [wlr] [backend/backend.c:95] Failed to create backend renderer
00:00:00.014 [sway/server.c:55] Unable to create backend

Quite a number of bugs to squish before the release :/

1 Like

I am stable-ish with

wlroots 0.14.1-2
sway 1:1.6.1-1
egl-wayland-git 1.1.9.r0.gcd0d19a-1
libglvnd 1.3.4-1

The “ish” comes from the fact that Chrome under wayland produces a million errors but still renders, and I have some truly awful screen flickering / tearing whenever anything is updating on the screen (especially bad in firefox).

It seems like the sway 1.6.1 I have pulls from wlroots 0.14.0 where the flicker might be a known issue.

Nope, wlroots just only prints its major version. And I still have the flicker when building from git.

Could be Glitches with nvidia driver 470 (optimus render offload) on xwayland with vulkan games - #9 by saikat0511

mpv is completely unusable.

Does anyone have hardware cursor working? I had to disable that.

1 Like

Having now deleted the assert (lol not scary at all) and tried with Vulkan, I’m ending up with a double free or corruption issue. My vkcube works, though.

did you build from aur or source, i cant figure out how to edit source code from aur

@user4109 I think I’m getting that issue as well now. Guess we’ll have to wait until Nvidia hopefully fixes it in the release/next beta. Also, I’m interested in how you got vkcube running. I have all the packages you mentioned in the first part, and also nvidia-utils-beta. Is it running in XWayland? (I don’t have XWayland installed) vulkaninfo also shows an error for me:

ERROR at /build/vulkan-tools/src/Vulkan-Tools-1.2.194/vulkaninfo/vulkaninfo.h:248:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_INITIALIZATION_FAILED

@jrgiacone You need to build from source: Development Setup · swaywm/sway Wiki · GitHub

I have vkcube running on the non git versions of sway and wlroots. I can check if it is running in XWayland when I get back. A note when compiling from git for XWayland I had to delete to cvt files called out as owned by Xorg-server, after deleting it will install and compile

good test to verify if an application is running in Wayland or XWayland:
start xeyes and hover with your mouse over the window you want to test, if the eyes move it is XWayland.

Current Set up,

Fresh install of archlinux with basics: linux, base, linux-firmware, networkmanager, vim, etc… no display software yet, just enough to sufficiently boot. On a btrfs drive

Add the modules to mkinitcpio, you’ll notice errors for nvidia, that’s fine, it lets you know it is trying.

Add the modeset lines to grub

Install nvidia-beta drivers from aur and all the related lib32 and cuda drivers. Note nvidia-beta (dkms version) did not work for me (make sure to enable multilib in /etc/pacman.conf)

reboot and run mkinitcpio -P, no more nvidia errors

install all software above as git without sway and wlroots

Note: for xorg-xwayland-git you may run into an issue with two files noted as owned by Xorg-server, go ahead and just delete them, then it will install just fine.

Install sway and wlroots from arch repos as the git version currently segfaults.

Everything runs great, except alacritty and chrome based browsers. Note major graphical glitches and artifacts occur.

Does compiling the git for wlroots and sway reduce the amount of artifacts and graphical glitches compared to the sway and wlroots in the arch repo? Everything else I have is built from git

Multiple monitors, xwayland and vuklan running.
Gsync will not enable using output (put monitor DP) adaptive_sync on in the sway config. (Tested dual and single monitor)

Runnig sway with --unsupported-gpu -d, I saw some drm-atomic errors, so now I’m using
WLR_DRM_NO_ATOMIC=1 sway --unsupported-gpu -d

@jrgiacone , I have everything from git, removing that assertion (It was working before because I have a optimus device and it was selecting both intel and nvidia).
I think it reduced the amount of artifacts and graphical glitches, still glitchy though.
Wait! Multiple monitors?! I see my second monitor with swaymsg -t get_outputs, but I’ve never managed to enable it.

Btw., could you enable Webrender in firefox with gfx.webrender.all=true? With MOZ_WAYLAND=1, so far, I could enable just the legacy GL renderer with layers.acceleration.force-enabled=true.