wayab icon indicating copy to clipboard operation
wayab copied to clipboard

Support NVIDIA Prime setups

Open viniciusmuller opened this issue 4 years ago • 3 comments

Hello! Thanks for this nice piece of software. I'm currently trying to run it using an NVIDIA prime setup. Sway runs in my GPU by default and if I want other programs to run using my GPU I use the nvidia-offload script. Currently, the error that I get is about the device not supporting SMAA. I suspect this is because the program is choosing the integrated graphics as its device regardless I use nvidia-offload or not.

I would really like to be able to use this. If you want help to test any changes about this, I'm willing to help.

viniciusmuller avatar Jan 08 '22 18:01 viniciusmuller

Sorry for the late reply, I'm not sure about what's going wrong, could you show me some error messages ?

And after some searching, have you tried to set DRI_PRIME=1 (but i think this probably won't work too.)

Another thing is that direct rendering on wayland relies on egl, so make sure you installed egl-wayland (for nvidia, it seems to be this project)

chux0519 avatar Jan 20 '22 02:01 chux0519

Here is the error dump:

❯ wayab -o HDMI-A-1:./gif/:fill:0.0,0.0
output_name: HDMI-A-1
dir: ./gif/
resize: fill
x(3): 0.000000, y(3): 0.000000
Got a registry event for wl_shm id 1
Got a registry event for wl_drm id 2
Got a registry event for zwp_linux_dmabuf_v1 id 3
Got a registry event for wl_compositor id 4
Got a registry event for wl_subcompositor id 5
Got a registry event for wl_data_device_manager id 6
Got a registry event for zwlr_gamma_control_manager_v1 id 7
Got a registry event for zxdg_output_manager_v1 id 8
Got a registry event for org_kde_kwin_idle id 9
Got a registry event for zwp_idle_inhibit_manager_v1 id 10
Got a registry event for zwlr_layer_shell_v1 id 11
Got a registry event for xdg_wm_base id 12
Got a registry event for zwp_tablet_manager_v2 id 13
Got a registry event for org_kde_kwin_server_decoration_manager id 14
Got a registry event for zxdg_decoration_manager_v1 id 15
Got a registry event for zwp_relative_pointer_manager_v1 id 16
Got a registry event for zwp_pointer_constraints_v1 id 17
Got a registry event for wp_presentation id 18
Got a registry event for zwlr_output_manager_v1 id 19
Got a registry event for zwlr_output_power_manager_v1 id 20
Got a registry event for zwp_input_method_manager_v2 id 21
Got a registry event for zwp_text_input_manager_v3 id 22
Got a registry event for zwlr_foreign_toplevel_manager_v1 id 23
Got a registry event for zwlr_export_dmabuf_manager_v1 id 24
Got a registry event for zwlr_screencopy_manager_v1 id 25
Got a registry event for zwlr_data_control_manager_v1 id 26
Got a registry event for zwp_primary_selection_device_manager_v1 id 27
Got a registry event for wp_viewporter id 28
Got a registry event for zxdg_exporter_v1 id 29
Got a registry event for zxdg_importer_v1 id 30
Got a registry event for zxdg_exporter_v2 id 31
Got a registry event for zxdg_importer_v2 id 32
Got a registry event for zwp_virtual_keyboard_manager_v1 id 33
Got a registry event for zwlr_virtual_pointer_manager_v1 id 34
Got a registry event for zwlr_input_inhibit_manager_v1 id 35
Got a registry event for zwp_keyboard_shortcuts_inhibit_manager_v1 id 36
Got a registry event for wl_seat id 37
Got a registry event for zwp_pointer_gestures_v1 id 38
Got a registry event for wl_output id 39
name: HDMI-A-1 width: 1600, height: 900
Loading ./gif//out0000.png
wayab: cairo-gl-device.c:648: bind_multisample_framebuffer: Assertion `surface->supports_msaa' failed.
Aborted (core dumped)

This exact same error happens whether I'm using nothing, wrapping it with nvidia-offload or setting DRI_PRIME=1

Probably relevant to this issue, my hardware is a GTX 1070 and an Intel HD Graphics 630.

viniciusmuller avatar Jan 20 '22 15:01 viniciusmuller

Still have no idea, I've backtracked some code of cario-gl. The call stack should be something like

bind_multisample_framebuffer <- 
_cairo_gl_context_bind_framebuffer <- 
_cairo_gl_context_set_destination <- 
XXX
...

but there are several spots calling it.

Could you do a debug build (cmake -DCMAKE_BUILD_TYPE=Debug), then attach gdb to it, when it crash, use bt and I want to check the whole call stack.

chux0519 avatar Jan 21 '22 04:01 chux0519