smithay icon indicating copy to clipboard operation
smithay copied to clipboard

Anvil crashes on launch: `Error::NoDevice(DrmNode { dev: 57858, ty: Primary })`

Open shaunsingh opened this issue 1 year ago • 1 comments

NixOS using asahi linux (apple m1, kernel 6.1.0)

log:

Feb 04 19:16:46.603 INFO Starting anvil on a tty using udev
Feb 04 19:16:46.603 INFO [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory, session_type: libseat, smithay_module: backend_session
Feb 04 19:16:46.603 INFO [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping, session_type: libseat, smithay_module: backend_session
Feb 04 19:16:46.609 INFO [libseat/libseat.c:73] Seat opened with backend 'logind', session_type: libseat, smithay_module: backend_session
Feb 04 19:16:46.611 INFO Using renderD128 as primary gpu.
Feb 04 19:16:46.614 INFO Trying to initialize EGLDevice { inner: 0xaaab35d81420, device_extensions: ["EGL_EXT_device_drm", "EGL_EXT_device_drm_render_node"] } from renderD128
Feb 04 19:16:46.614 INFO Successfully selected EGL platform: PLATFORM_DEVICE_EXT, platform: EGLPlatform { platform_name: "PLATFORM_DEVICE_EXT", required_extensions: ["EGL_EXT_platform_device"] }, smithay_module: backend_egl
Feb 04 19:16:46.638 INFO EGL Initialized, smithay_module: backend_egl
Feb 04 19:16:46.638 INFO EGL Version: (1, 4), smithay_module: backend_egl
Feb 04 19:16:46.638 INFO Supported EGL display extensions: ["EGL_ANDROID_blob_cache", "EGL_EXT_image_dma_buf_import", "EGL_EXT_image_dma_buf_import_modifiers", "EGL_KHR_cl_event2", "EGL_KHR_config_attribs", "EGL_KHR_context_flush_control", "EGL_KHR_create_context", "EGL_KHR_create_context_no_error", "EGL_KHR_fence_sync", "EGL_KHR_get_all_proc_addresses", "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_base", "EGL_KHR_no_config_context", "EGL_KHR_reusable_sync", "EGL_KHR_surfaceless_context", "EGL_EXT_pixel_format_float", "EGL_KHR_wait_sync", "EGL_MESA_configless_context", "EGL_MESA_drm_image", "EGL_MESA_image_dma_buf_export", "EGL_MESA_query_driver", "EGL_WL_bind_wayland_display", ""], smithay_module: backend_egl
Feb 04 19:16:46.639 INFO EGL context created, smithay_module: backend_egl
Feb 04 19:16:46.640 INFO Initializing OpenGL ES Renderer, smithay_module: renderer_gles2
Feb 04 19:16:46.640 INFO GL Version: "OpenGL ES 2.0 Mesa 23.0.0-devel", smithay_module: renderer_gles2
Feb 04 19:16:46.640 INFO GL Vendor: "Asahi", smithay_module: renderer_gles2
Feb 04 19:16:46.640 INFO GL Renderer: "Apple M1 (G13G B1)", smithay_module: renderer_gles2
Feb 04 19:16:46.640 INFO Supported GL Extensions: ["GL_EXT_blend_minmax", "GL_EXT_multi_draw_arrays", "GL_EXT_texture_filter_anisotropic", "GL_EXT_texture_compression_s3tc", "GL_EXT_texture_compression_dxt1", "GL_EXT_texture_format_BGRA8888", "GL_OES_compressed_ETC1_RGB8_texture", "GL_OES_depth24", "GL_OES_element_index_uint", "GL_OES_fbo_render_mipmap", "GL_OES_mapbuffer", "GL_OES_rgb8_rgba8", "GL_OES_standard_derivatives", "GL_OES_stencil8", "GL_OES_texture_3D", "GL_OES_texture_float", "GL_OES_texture_float_linear", "GL_OES_texture_half_float", "GL_OES_texture_half_float_linear", "GL_OES_texture_npot", "GL_OES_vertex_half_float", "GL_EXT_draw_instanced", "GL_OES_EGL_image", "GL_OES_depth_texture", "GL_OES_packed_depth_stencil", "GL_EXT_texture_type_2_10_10_10_REV", "GL_OES_get_program_binary", "GL_APPLE_texture_max_level", "GL_EXT_discard_framebuffer", "GL_EXT_read_format_bgra", "GL_NV_pack_subimage", "GL_EXT_frag_depth", "GL_NV_fbo_color_attachments", "GL_OES_EGL_image_external", "GL_OES_EGL_sync", "GL_OES_vertex_array_object", "GL_ANGLE_pack_reverse_row_order", "GL_ANGLE_texture_compression_dxt3", "GL_ANGLE_texture_compression_dxt5", "GL_EXT_occlusion_query_boolean", "GL_EXT_texture_rg", "GL_EXT_unpack_subimage", "GL_NV_draw_buffers", "GL_NV_read_buffer", "GL_NV_read_depth", "GL_NV_read_depth_stencil", "GL_NV_read_stencil", "GL_EXT_draw_buffers", "GL_EXT_map_buffer_range", "GL_KHR_debug", "GL_KHR_texture_compression_astc_ldr", "GL_NV_pixel_buffer_object", "GL_OES_depth_texture_cube_map", "GL_OES_required_internalformat", "GL_OES_surfaceless_context", "GL_EXT_debug_label", "GL_EXT_separate_shader_objects", "GL_EXT_compressed_ETC1_RGB8_sub_texture", "GL_EXT_draw_elements_base_vertex", "GL_EXT_texture_border_clamp", "GL_KHR_context_flush_control", "GL_OES_draw_elements_base_vertex", "GL_OES_texture_border_clamp", "GL_KHR_no_error", "GL_KHR_texture_compression_astc_sliced_3d", "GL_EXT_texture_compression_s3tc_srgb", "GL_KHR_parallel_shader_compile", "GL_EXT_depth_clamp", "GL_MESA_bgra", ""], smithay_module: renderer_gles2
Feb 04 19:16:46.650 INFO Trying to initialize EGL Hardware Acceleration via DrmNode { dev: 57984, ty: Render }
Feb 04 19:16:46.650 INFO EGL hardware-acceleration enabled
Feb 04 19:16:46.651 INFO Created new socket, wayland_socket: wayland-1
Feb 04 19:16:46.651 INFO Listening on wayland socket, name: wayland-1
Feb 04 19:16:46.651 INFO Initializing a xkbcommon handler with keymap query, options: None, variant: , layout: , model: , rules: , smithay_module: xkbcommon_handler, seat_name: seat0, smithay_module: seat_handler
Feb 04 19:16:46.653 INFO Loaded Keymap, name: English (US), smithay_module: xkbcommon_handler, seat_name: seat0, smithay_module: seat_handler
Feb 04 19:16:46.687 INFO Initializing a libinput backend, smithay_module: backend_libinput
Feb 04 19:16:46.688 WARN Unable to become drm master, assuming unprivileged mode, smithay_module: backend_drm
Feb 04 19:16:46.688 INFO DrmDevice initializing, smithay_module: backend_drm
Feb 04 19:16:46.693 WARN Skipping device 57857, because of drm error: DRM access error: Error loading resource handles on device `Some("/dev/dri/card1")` (unknown system error: EOPNOTSUPP: Operation not supported on transport endpoint)
Feb 04 19:16:46.693 INFO Dropping device: Some("/dev/dri/card1"), smithay_module: backend_drm
Feb 04 19:16:46.693 WARN Unable to become drm master, assuming unprivileged mode, smithay_module: backend_drm
Feb 04 19:16:46.693 INFO DrmDevice initializing, smithay_module: backend_drm
Feb 04 19:16:46.836 INFO Connected: EmbeddedDisplayPort
Feb 04 19:16:46.836 INFO Successfully selected EGL platform: PLATFORM_GBM_KHR, platform: EGLPlatform { platform_name: "PLATFORM_GBM_KHR", required_extensions: ["EGL_KHR_platform_gbm"] }, smithay_module: backend_egl
Feb 04 19:16:46.836 INFO EGL Initialized, smithay_module: backend_egl
Feb 04 19:16:46.836 INFO EGL Version: (1, 4), smithay_module: backend_egl
Feb 04 19:16:46.836 INFO Supported EGL display extensions: ["EGL_ANDROID_blob_cache", "EGL_EXT_buffer_age", "EGL_EXT_image_dma_buf_import", "EGL_EXT_image_dma_buf_import_modifiers", "EGL_KHR_cl_event2", "EGL_KHR_config_attribs", "EGL_KHR_context_flush_control", "EGL_KHR_create_context", "EGL_KHR_create_context_no_error", "EGL_KHR_fence_sync", "EGL_KHR_get_all_proc_addresses", "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_no_config_context", "EGL_KHR_reusable_sync", "EGL_KHR_surfaceless_context", "EGL_EXT_pixel_format_float", "EGL_KHR_wait_sync", "EGL_MESA_configless_context", "EGL_MESA_drm_image", "EGL_MESA_image_dma_buf_export", "EGL_MESA_query_driver", "EGL_WL_bind_wayland_display", ""], smithay_module: backend_egl
Feb 04 19:16:46.837 INFO EGL context created, smithay_module: backend_egl
Feb 04 19:16:46.837 INFO Trying to setup connector EmbeddedDisplayPort-1 with crtc crtc::Handle(33)
Feb 04 19:16:46.837 INFO Initializing drm surface (crtc::Handle(33):plane::Handle(31)) with mode Mode { name: "2560x1600", clock: 266630, size: (2560, 1600), hsync: (2568, 2600, 2642), vsync: (1632, 1640, 1682), hskew: 0, vscan: 0, vrefresh: 60, mode_type: PREFERRED | DRIVER } and connectors [connector::Handle(35)], drm_module: surface, smithay_module: backend_drm_atomic, smithay_module: backend_drm
Feb 04 19:16:46.838 INFO Creating new wl_output, smithay_module: output_handler, name: eDP-1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error::NoDevice(DrmNode { dev: 57858, ty: Primary })', src/udev.rs:1150:77
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

shaunsingh avatar Feb 04 '23 19:02 shaunsingh

Hey, I actually tried anvil on an M2 (with edge kernel) and I did need to make some code adjustments (hacky to make it work). This is effectively the same issue as #678. One thing you could try is to use is this (of course it needs a rebase) as it uses gbm to handle the gpu to display controller buffer creation: https://github.com/Smithay/smithay/tree/fix/multigpu_gpu_copy

i509VCB avatar Feb 04 '23 19:02 i509VCB