elFarto / nvidia-vaapi-driver

A VA-API implemention using NVIDIA's NVDEC
Other
1.19k stars 53 forks source link

Can't get it to work on Firefox 96/NVIDIA 470.94 #29

Closed guihkx closed 2 years ago

guihkx commented 2 years ago

For some reason, Firefox 96 doesn't seem to be enabling VA-API, despite me configuring everything as per the README file.

Firefox log:

$ LIBVA_DRIVER_NAME=nvidia MOZ_DISABLE_RDD_SANDBOX=1 NVD_LOG=1 MOZ_LOG="PlatformDecoderModule:5" firefox
[Child 39613: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 39613: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 39613: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 39613: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 39728: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
[RDD 39728: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 39728: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 39728: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 39728: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 39728: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 39728: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 39728: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[Child 39613: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 39728: MediaSupervisor #1]: D/PlatformDecoderModule VA-API is disabled by pref.
[RDD 39728: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[RDD 39728: MediaPDecoder #2]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[h264 @ 0x7ff69a14f400] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7ff69a14f400] nal_unit_type: 8(PPS), nal_ref_idc: 3
[RDD 39728: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[h264 @ 0x7ff69a14f400] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7ff69a14f400] nal_unit_type: 5(IDR), nal_ref_idc: 3
[RDD 39728: MediaPDecoder #1]: D/PlatformDecoderModule Choosing FFmpeg pixel format for video decoding.
[RDD 39728: MediaPDecoder #1]: D/PlatformDecoderModule Requesting pixel format YUV420P.
[h264 @ 0x7ff69a14f400] Format yuv420p chosen by get_format().
[h264 @ 0x7ff69a14f400] Reinit context to 640x480, pix_fmt: yuv420p
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 39613: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type

Some other infos:

$ sudo cat /sys/module/nvidia_drm/parameters/modeset
Y
$ LIBVA_DRIVER_NAME=nvidia vainfo
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD

image

Any help is appreciated. Thanks.

Darkspirit commented 2 years ago

Please post the complete Graphics section of about:support.

guihkx commented 2 years ago
Graphics
--------

Features
Compositing: WebRender
Asynchronous Pan/Zoom: wheel input enabled; scrollbar drag enabled; keyboard enabled; autoscroll enabled; smooth pinch-zoom enabled
WebGL 1 Driver WSI Info: EGL_VENDOR: NVIDIA EGL_VERSION: 1.5 EGL_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_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_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_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_NV_robustness_video_memory_purge EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream EGL_EXTENSIONS(nullptr): 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 IsWebglOutOfProcessEnabled: 0
WebGL 1 Driver Renderer: NVIDIA Corporation -- NVIDIA GeForce GTX 660/PCIe/SSE2
WebGL 1 Driver Version: 4.6.0 NVIDIA 470.94
WebGL 1 Driver Extensions: GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture 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_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted 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_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters 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_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc 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_filter_anisotropic 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_query_lod 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_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit 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_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform 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_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_EGL_image_storage GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query 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_clamp GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object 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_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_import_sync_object GL_NV_robustness_video_memory_purge GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat 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_timeline_semaphore GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_square GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_internalformat_sample_query GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_unified_memory GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NV_gpu_multicast GL_NVX_progress_fence GL_NVX_gpu_memory_info GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_KHR_blend_equation_advanced GL_OES_EGL_image GL_OVR_multiview GL_OVR_multiview2 GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum
WebGL 1 Extensions: ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_half_float EXT_float_blend EXT_frag_depth EXT_shader_texture_lod EXT_sRGB EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic MOZ_debug OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_etc WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context
WebGL 2 Driver WSI Info: EGL_VENDOR: NVIDIA EGL_VERSION: 1.5 EGL_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_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_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_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_NV_robustness_video_memory_purge EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream EGL_EXTENSIONS(nullptr): 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 IsWebglOutOfProcessEnabled: 0
WebGL 2 Driver Renderer: NVIDIA Corporation -- NVIDIA GeForce GTX 660/PCIe/SSE2
WebGL 2 Driver Version: 3.2.0 NVIDIA 470.94
WebGL 2 Driver Extensions: GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture 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_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted 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_derivative_control GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_indirect_parameters 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_multi_draw_indirect GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_polygon_offset_clamp GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters GL_ARB_shader_ballot GL_ARB_shader_bit_encoding GL_ARB_shader_clock GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_spirv_extensions GL_ARB_stencil_texturing GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_buffer_range GL_ARB_texture_compression GL_ARB_texture_compression_bptc 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_filter_anisotropic 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_query_lod 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_transform_feedback_overflow_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit 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_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform 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_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_EGL_image_storage GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query 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_clamp GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object 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_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shadow_lod GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_import_sync_object GL_NV_robustness_video_memory_purge GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat 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_timeline_semaphore GL_KHR_shader_subgroup GL_KTX_buffer_region GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect GL_NV_bindless_multi_draw_indirect_count GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_square GL_NV_command_list GL_NV_compute_program5 GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample GL_NV_feature_query GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_internalformat_sample_query GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_point_sprite GL_NV_primitive_restart GL_NV_query_resource GL_NV_query_resource_tag GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_shader_storage_buffer_object GL_NV_shader_subgroup_partitioned GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_rectangle_compressed GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_uniform_buffer_unified_memory GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NV_gpu_multicast GL_NVX_progress_fence GL_NVX_gpu_memory_info GL_NV_shader_thread_group GL_NV_shader_thread_shuffle GL_KHR_blend_equation_advanced GL_OES_EGL_image GL_OVR_multiview GL_OVR_multiview2 GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum
WebGL 2 Extensions: EXT_color_buffer_float EXT_float_blend EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic MOZ_debug OES_texture_float_linear OVR_multiview2 WEBGL_compressed_texture_etc WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context
Window Protocol: x11
Desktop Environment: gnome
Target Frame Rate: 120
GPU #1
Active: Yes
Description: NVIDIA GeForce GTX 660/PCIe/SSE2
Vendor ID: 0x10de
Device ID: 0x11c0
Driver Vendor: nvidia/unknown
Driver Version: 470.94.0.0
RAM: 0
Darkspirit commented 2 years ago

Driver: 470.94

Gbm/DMABUF is disabled by default below 495.44.

guihkx commented 2 years ago

Ah, dang it. Any way to force-enable it on Firefox? Or the 470 driver series don't even support it? If that's the case, I'm afraid NVIDIA won't ever implement the gbm stuff for the 470 driver branch. And because my GPU is from 2012, the 470 driver branch will be the last one supporting my GPU. :S

Darkspirit commented 2 years ago

If I unterstand correctly, 470 only supports Dmabuf, but not Gbm. It might work with widget.dmabuf.force-enabled=true, I don't know.

SupervisedThinking commented 2 years ago

Well your problem is simple: GTX 660

You need at least a Maxwell based GPU so your card is more or less EOS... 🤔

guihkx commented 2 years ago

It might work with widget.dmabuf.force-enabled=true, I don't know.

Yeah, I don't think so... image

You need at least a Maxwell based GPU

Why though? Is it because this only works with the 495 driver series or there are some other reasons as well? I think we should add this information to the README.

elFarto commented 2 years ago

If I unterstand correctly, 470 only supports Dmabuf, but not Gbm.

Do you know why exactly GBM is needed? Technically only DMA-BUF is required for this library to work, and having it work with the older driver would enable a lot of people with older cards to use it.

SupervisedThinking commented 2 years ago

Well if only DMA-BUF is needed then it might could work with the 470er series - it should be in https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-470-Wayland-Friendly

But if you compare the readme files it's not mentioned - at least for EGL & Wayland

A Wayland EGL external platform library (/usr/lib/libnvidia-egl-wayland.so.1) and its corresponding configuration file ( /usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json ); this library provides client-side Wayland support on top of the EGLDevice and EGLStream families of extensions, for use in combination with an EGLStream-enabled Wayland compositor:

https://us.download.nvidia.com/XFree86/Linux-x86_64/470.94/README/installedcomponents.html

A Wayland EGL external platform library (/usr/lib/libnvidia-egl-wayland.so.1) and its corresponding configuration file ( /usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json ); this library provides client-side Wayland EGL application support using either dmabuf or EGLStream buffer sharing protocols

https://us.download.nvidia.com/XFree86/Linux-x86_64/495.46/README/installedcomponents.html

Darkspirit commented 2 years ago

Firefox' EGL-Dmabuf-VAAPI requires hardware WebRender which requires OpenGL 3.2.

IIUC, Gbm is primarily needed for EGL-Gbm-Dmabuf-WebGL, but FEATURE_DMABUF on about:support means Gbm+Dmabuf. "Failed to configure" comes from here: https://searchfox.org/mozilla-central/rev/3de56eb5f266f523340e739ae1b53258e0a95dfe/gfx/thebes/gfxPlatformGtk.cpp#217

VAAPI decision is made here: https://searchfox.org/mozilla-central/rev/3de56eb5f266f523340e739ae1b53258e0a95dfe/widget/gtk/DMABufLibWrapper.cpp#275

philipl commented 2 years ago

Also, The EGL extension to export the dma buf was only added in 495.

guihkx commented 2 years ago

RIP then. 🥲

I'm pretty sure NVIDIA won't be adding new features to R470 because it's a LTS branch. Feel free to close this if you wish, @elFarto.

Darkspirit commented 2 years ago

Some further background info: If I understand correctly, media.ffmpeg.vaapi.enabled also enables dmabuf-textures for software decoding (it can be disabled with media.ffmpeg.dmabuf-textures.disabled). If a codec is not supported by the VAAPI hardware decoder because

Firefox uses the software decoder, but tries to use EGL+Gbm+Dmabuf to avoid copies between processes which should improve performance for high res videos. (dmabuf-textures did work in the content process back then, it might be broken unnoticed in the RDD process, I haven't tested yet. It might even not be needed anymore.)

elFarto commented 2 years ago

Also, The EGL extension to export the dma buf was only added in 495.

eeeh..not so fast there. The output of eglinfo on my GeForce 760 with the 470.94 driver contains these:

EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_MESA_image_dma_buf_export

And after finally convincing my second machine to build mpv, and can confirm this library does work (with mpv at least).

It doesn't work too well with a Prime/Optimus setup, I get this error, which I believe is from mpv even though it's our logging function:

[21052-21058] ../src/export-buf.c:  36                    debug [EGL] eglCreateImageKHR: dri2_create_image_khr_texture (3003)

But if I force mpv to use the NVIDIA EGL backend (this library already picks the correct EGL device), it does work, and it does display the video, which is hooked up to the Intel iGPU.

So, there is hope for getting this working on 470 within Firefox, if it can enable DMA-BUF without GBM, and you're not using a Optimus setup.

philipl commented 2 years ago

Also, The EGL extension to export the dma buf was only added in 495.

eeeh..not so fast there. The output of eglinfo on my GeForce 760 with the 470.94 driver contains these:

EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_MESA_image_dma_buf_export

Ah. My bad. I didn't remember seeing those when I was running 470.

guihkx commented 2 years ago

Just for fun I tried to see if it'd work with VLC, but:

$ NVD_LOG=1 cvlc Big_Buck_Bunny_1080_10s_30MB.mp4
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000560d72b25240] dummy interface: using the dummy interface module...
TagLib: MP4: No audio tracks
[00007f4f580069c0] gl gl: Initialized libplacebo v4.157.0 (API v157)
[65142-65161] ../src/vabackend.c:1592       __vaDriverInit_1_0 Initing NVIDIA VA-API Driver
[65142-65161] ../src/export-buf.c:  90          findCudaDisplay Found 3 EGL devices
[65142-65161] ../src/export-buf.c:  94          findCudaDisplay Got EGL_CUDA_DEVICE_NV value '0' from device 0
[65142-65161] ../src/export-buf.c: 122             initExporter Got EGLDisplay from CUDA device
[65142-65161] ../src/export-buf.c:  56                reconnect Reconnecting to stream
[65142-65161] ../src/vabackend.c: 514        nvCreateSurfaces2 creating 36 surface(s) 1920x1080, format 1
[65142-65161] ../src/vabackend.c:1008            nvDeriveImage In nvDeriveImage
[00007f4f580069c0] glconv_vaapi_x11 gl error: vaDeriveImage: operation failed
[65142-65161] ../src/vabackend.c:1580              nvTerminate In nvTerminate
[00007f4f5c172f30] main video output error: video output creation failed
[00007f4f64c17340] main decoder error: failed to create video output

And after that VLC falls back to VDPAU then it works. And yes, I understand there's no point in using this with VLC. I was just curious... Is this expected not to work?

philipl commented 2 years ago

That log output says VLC is using the X11 interop:

[00007f4f580069c0] glconv_vaapi_x11 gl error: vaDeriveImage: operation failed

which isn't supported. I'd say surely VLC must support dma-buf interop but it has a weird relationship with hwaccel so anything is possible.

elFarto commented 2 years ago

This library has only been tested with MPV and Firefox. It should work with anything that uses ffmpeg to talk to VA-API, but anything else that uses it directly will likely use parts that are unimplemented. There's little point for any application that can use NVDEC (or VDPAU I guess) directly to use this library.

I'm not against getting it working in other applications, like Chrome, but that's a future goal.

LordTermor commented 2 years ago

Setting widget.dmabuf.force-enabled to true helped 2060 SUPER to be able to work with 470 driver. Maybe it's worth adding this to README? (I'm not sure about pre-Maxwell GPUs though)

elFarto commented 2 years ago

@LordTermor I'm surprised that made a difference, are you sure it was using the driver with that option enabled? Firefox specifically checks for GBM to be present before enabling VA-API, so we'll need to patch Firefox first, before we can get it to work.

LordTermor commented 2 years ago

Firefox specifically checks for GBM to be present before enabling VA-API

Even on X11? I'm sure that's what did the trick for my friend.

elFarto commented 2 years ago

Even on X11? I'm sure that's what did the trick for my friend.

Yes, it always checks.

LordTermor commented 2 years ago

So here are the screenshots that show the difference. Tell me if anything else is needed. изображение изображение

elFarto commented 2 years ago

That does certainly look like it's working. I'll have to do some more investigation as to why that option seems to help. Can you run firefox with the MOZ_LOG="PlatformDecoderModule:5" environment variable set, and post the log?

LordTermor commented 2 years ago

firefox.log

Here you go.

elFarto commented 2 years ago

Thanks for that, it does actually seem to be working correctly.

elFarto commented 2 years ago

Well, I've finally got around to testing this on the appropriate hardware, and it does infact work. I'm still a little confused as to why it does. In theory attempting to open a GBM device on the NVIDIA render node shouldn't work on this version (this was the bit I was expecting to fail), but it works just fine.

I'm going to add this to the README as it might help some people.

@LordTermor Can you post what version of MESA you have installed? And the contents of /usr/lib64/gbm (or /usr/lib/gbm depending on how your distro is setup)?

@guihkx Can you retry with the config option widget.dmabuf.force-enabled set to true? And post a log with MOZ_LOG="Dmabuf:5,PlatformDecoderModule:5" set if it doesn't work?

guihkx commented 2 years ago

Didn't work for me... I even made sure to test it on a fresh Firefox profile, but nada:

$ NVD_LOG=1 MOZ_DISABLE_RDD_SANDBOX=1 LIBVA_DRIVER_NAME=nvidia MOZ_LOG="PlatformDecoderModule:5" firefox
[Parent 261272: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Chrome process
[Parent 261272: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Parent 261272: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 261392: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 261392: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 261392: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 261392: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
[RDD 261435: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 261435: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 261392: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 261392: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 261435: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 261435: MediaSupervisor #1]: D/PlatformDecoderModule VA-API is disabled by pref.
[RDD 261435: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[h264 @ 0x7fc1d104da00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7fc1d104da00] nal_unit_type: 8(PPS), nal_ref_idc: 3
[RDD 261435: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[RDD 261435: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[RDD 261435: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[Child 261392: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7f74a2f61160] ::PrepareTrimmers: sample[-23219,0] no trimming information
[h264 @ 0x7fc1d104da00] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7fc1d104da00] nal_unit_type: 5(IDR), nal_ref_idc: 3
[RDD 261435: MediaPDecoder #2]: D/PlatformDecoderModule Choosing FFmpeg pixel format for video decoding.
[RDD 261435: MediaPDecoder #2]: D/PlatformDecoderModule Requesting pixel format YUV420P.
[h264 @ 0x7fc1d104da00] Format yuv420p chosen by get_format().
[h264 @ 0x7fc1d104da00] Reinit context to 640x480, pix_fmt: yuv420p
[Child 261392: MediaPDecoder #2]: D/PlatformDecoderModule AudioTrimmer[7f74a2f61160] ::HandleDecodedResult: sample[-23219,0] (decoded[-23219,0] no trimming needed
elFarto commented 2 years ago

Can you add the Dmabuf:5 into MOZ_LOG?

guihkx commented 2 years ago

Can you add the Dmabug:5 into MOZ_LOG?

I'm not sure if I did it correctly, but here it is:

$ NVD_LOG=1 MOZ_DISABLE_RDD_SANDBOX=1 LIBVA_DRIVER_NAME=nvidia MOZ_LOG="PlatformDecoderModule:5,Dmabug:5" firefox
[Parent 264978: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Chrome process
[Parent 264978: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Parent 264978: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 265091: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 265091: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 265091: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 265091: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 265091: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 265140: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
[RDD 265140: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 265140: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 265140: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 265140: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 265140: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 265140: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 265140: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 265140: MediaSupervisor #1]: D/PlatformDecoderModule VA-API is disabled by pref.
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[h264 @ 0x7f833bf51d00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f833bf51d00] nal_unit_type: 8(PPS), nal_ref_idc: 3
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[Child 265091: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[7fb0d07da020] ::PrepareTrimmers: sample[-23219,0] no trimming information
[h264 @ 0x7f833bf51d00] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f833bf51d00] nal_unit_type: 5(IDR), nal_ref_idc: 3
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule Choosing FFmpeg pixel format for video decoding.
[RDD 265140: MediaPDecoder #1]: D/PlatformDecoderModule Requesting pixel format YUV420P.
[h264 @ 0x7f833bf51d00] Format yuv420p chosen by get_format().
[h264 @ 0x7f833bf51d00] Reinit context to 640x480, pix_fmt: yuv420p
Darkspirit commented 2 years ago

Typo: Dmabuf, not Dmabug. MOZ_LOG="PlatformDecoderModule:5,Dmabuf:5"

guihkx commented 2 years ago

Thanks.

$ NVD_LOG=1 MOZ_DISABLE_RDD_SANDBOX=1 LIBVA_DRIVER_NAME=nvidia MOZ_LOG="PlatformDecoderModule:5,Dmabuf:5" firefox
[Parent 267041: Main Thread]: D/Dmabuf nsDMABufDevice::Configure()
[Parent 267041: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
[Parent 267041: Main Thread]: D/Dmabuf Failed: We're missing DRM render device!
[Parent 267041: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Chrome process
[Parent 267041: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[Parent 267041: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Parent 267041: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[Parent 267041: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 267203: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 267203: Main Thread]: D/Dmabuf nsDMABufDevice::Configure()
[Child 267203: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
[Child 267203: Main Thread]: D/Dmabuf Failed: We're missing DRM render device!
[Child 267203: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[Child 267203: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 267203: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[Child 267203: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 267203: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[Child 267203: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder supports requested type
[RDD 267248: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
[RDD 267248: Main Thread]: D/Dmabuf nsDMABufDevice::Configure()
[RDD 267248: Main Thread]: D/Dmabuf Loading DMABuf system library libgbm.so.1 ...
[RDD 267248: Main Thread]: D/Dmabuf Failed: We're missing DRM render device!
[RDD 267248: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[RDD 267248: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 267248: Main Thread]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[RDD 267248: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 267248: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[RDD 267248: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 267248: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 267248: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 267248: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 267248: MediaSupervisor #1]: D/Dmabuf nsDMABufDevice::IsDMABufVAAPIEnabled: EGL 1 DMABufEnabled 0  media_ffmpeg_vaapi_enabled 1 CanUseHardwareVideoDecoding 1
[RDD 267248: MediaSupervisor #1]: D/PlatformDecoderModule VA-API is disabled by pref.
[RDD 267248: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[h264 @ 0x7fd612955b00] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7fd612955b00] nal_unit_type: 8(PPS), nal_ref_idc: 3
[RDD 267248: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[RDD 267248: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[h264 @ 0x7fd612955b00] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7fd612955b00] nal_unit_type: 5(IDR), nal_ref_idc: 3
[RDD 267248: MediaPDecoder #2]: D/PlatformDecoderModule Choosing FFmpeg pixel format for video decoding.
[RDD 267248: MediaPDecoder #2]: D/PlatformDecoderModule Requesting pixel format YUV420P.
[h264 @ 0x7fd612955b00] Format yuv420p chosen by get_format().
[h264 @ 0x7fd612955b00] Reinit context to 640x480, pix_fmt: yuv420p
[h264 @ 0x7fd612950b00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[RDD 267248: MediaPDecoder #2]: D/PlatformDecoderModule Got one frame output with pts=0 dts=0 duration=40000 opaque=-9223372036854775808

I'm pretty sure the 470 driver doesn't install a libgbm.so.1

elFarto commented 2 years ago

libgbm.so.1 is part of MESA, not the driver. The NVIDIA driver installs a backend into /usr/lib64/gbm/. Can you check what version of MESA is installed?

guihkx commented 2 years ago
$ pacman -Qi mesa
Name            : mesa
Version         : 21.3.4-1
Description     : An open-source implementation of the OpenGL specification
Architecture    : x86_64
URL             : https://www.mesa3d.org/
Licenses        : custom
Groups          : None
Provides        : mesa-libgl  opengl-driver
Depends On      : libdrm  wayland  libxxf86vm  libxdamage  libxshmfence  libelf
                  libomxil-bellagio  libunwind  llvm-libs  lm_sensors  libglvnd  zstd
                  vulkan-icd-loader  libsensors.so=5-64  libexpat.so=1-64
                  libvulkan.so=1-64
Optional Deps   : opengl-man-pages: for the OpenGL API man pages
                  mesa-vdpau: for accelerated video playback
                  libva-mesa-driver: for accelerated video playback
Required By     : gst-plugins-base-libs  gtk3  lib32-mesa  libglvnd  mpv  qt5-base
                  qt6-base  slop
Optional For    : None
Conflicts With  : mesa-libgl
Replaces        : mesa-libgl
Installed Size  : 97,64 MiB
Packager        : Laurent Carlier <lordheavym@gmail.com>
Build Date      : qui 13 jan 2022 04:40:03
Install Date    : qui 13 jan 2022 22:22:10
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
guihkx commented 2 years ago

libgbm.so.1 is part of MESA, not the driver. The NVIDIA driver installs a backend into /usr/lib64/gbm/. Can you check what version of MESA is installed?

Indeed, sorry.

$ pacman -Qo /usr/lib/libgbm.so.1 
/usr/lib/libgbm.so.1 is owned by mesa 21.3.4-1
Darkspirit commented 2 years ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1736761 ("MESA-LOADER: failed to open nouveau") was the reason why versions below 495 have been blocklisted for FEATURE_DMABUF (Dmabuf+Gbm).

elFarto commented 2 years ago

Can you run NVD_LOG=1 vainfo and paste the output? Specifically, this error: We're missing DRM render device! doesn't make any sense, the 470 driver creates a render node.

guihkx commented 2 years ago
$ NVD_LOG=1 vainfo
[278107-278107] ../src/vabackend.c:1610       __vaDriverInit_1_0 Initing NVIDIA VA-API Driver
[278107-278107] ../src/export-buf.c:  90          findCudaDisplay Found 3 EGL devices
[278107-278107] ../src/export-buf.c:  94          findCudaDisplay Got EGL_CUDA_DEVICE_NV value '0' from device 0
[278107-278107] ../src/export-buf.c: 122             initExporter Got EGLDisplay from CUDA device
[278107-278107] ../src/export-buf.c:  56                reconnect Reconnecting to stream
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
[278107-278107] ../src/vabackend.c:1598              nvTerminate In nvTerminate
guihkx commented 2 years ago

I also tried running Firefox with MOZ_WAYLAND_DRM_DEVICE=/dev/dri/card0 and at least that made the D/Dmabuf Failed: We're missing DRM render device! message disappear, but I suspect that's very wrong judging by output I got, lol

I've put in a gist because it's a bit long: https://gist.githubusercontent.com/guihkx/c539e654361e5d63e9e9a5fa91de5ae7/raw/8832a39a5d86f7a102e507c4019ca4ae6c121b66/firefox.txt

elFarto commented 2 years ago

Can you retry that with the latest version of the driver from git? You've got the interesting combination of modeset=Y and Unable to export to dma-buf.

guihkx commented 2 years ago

Okay so I was on commit f5924d5 and now I tested with 71f2e0a:

$ NVD_LOG=1 vainfo
[285974-285974] ../src/vabackend.c:1631       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver
[285974-285974] ../src/export-buf.c: 139          findCudaDisplay Found 3 EGL devices
[285974-285974] ../src/export-buf.c: 143          findCudaDisplay Got EGL_CUDA_DEVICE_NV value '0' from device 0
[285974-285974] ../src/export-buf.c: 151          findCudaDisplay Checking device file: (null)
[285974-285974] ../src/export-buf.c: 169          findCudaDisplay Unable to retrieve DRM device file
[285974-285974] ../src/export-buf.c: 198             initExporter Got EGLDisplay from CUDA device
[285974-285974] ../src/export-buf.c: 102                reconnect Reconnecting to stream
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
[285974-285974] ../src/vabackend.c:1617              nvTerminate In nvTerminate
[285974-285974] ../src/export-buf.c:  54          releaseExporter Releasing exporter, 0 outstanding frames
[285974-285974] ../src/export-buf.c:  71          releaseExporter Done releasing frames
[285974-285974] ../src/export-buf.c:  81          releaseExporter Done releasing EGLImages

And the Firefox log: https://gist.github.com/guihkx/4fc565c52e1cc4703561e9e6ddd35f2b/raw/9eb4d1cf58385cd9fe5f5647cba8a362399f79b9/firefox2.txt

LordTermor commented 2 years ago

@LordTermor Can you post what version of MESA you have installed? And the contents of /usr/lib64/gbm (or /usr/lib/gbm depending on how your distro is setup)?

pacman -Q mesa && ls -l /usr/lib/gbm/                                                                                                                                                                          

mesa 21.3.2-1
ls: unable to access '/usr/lib/gdm/': There is no such file or directory

And the MOZ_LOG="PlatformDecoderModule:5,Dmabuf:5" firefox log: firefox-dmabuf.log

elFarto commented 2 years ago

findCudaDisplay Checking device file: (null)

Ok, now I'm really confused. There's something very odd about this setup. The NVIDIA EGL driver isn't giving you the DRI device for that EGLDevice, but there does appear to be one there. Can you run nvidia-bug-report.sh and attach the resulting file?

ls: unable to access '/usr/lib/gdm/': There is no such file or directory

gdm?

guihkx commented 2 years ago

Can someone please share with me the output of:

ls -la /dev/dri/renderD128

I'm pretty sure mine has the wrong permissions and when I run Firefox with MOZ_WAYLAND_DRM_DEVICE=/dev/dri/renderD128 I get:

[Parent 287367: Main Thread]: D/Dmabuf Failed to open drm render node /dev/dri/renderD128 error Permission denied

It's my own fault, some time ago I was messing with vglserver and the script I ran added group restrictions to /dev/dri/renderD128. I know I can add myself to that group, but I suppose I'd have to logout/login and I can't do that right now. Plus I want to restore the original permissions... Thx

elFarto commented 2 years ago

ls -la /dev/dri/renderD128

> ls -la /dev/dri/renderD128 
crw-rw-rw- 1 root render 226, 128 Jan 22 08:21 /dev/dri/renderD128
guihkx commented 2 years ago

My sincere apologies to anyone who helped me debug this issue.

TL;DR: The cause of the issue was incorrect permissions in /dev/dri/renderD128.

Screenshot of HW decoding working on Firefox now (no additional steps needed, I only followed the instructions in the README file):

image

Thank you very much. Feel free to close this.

elFarto commented 2 years ago

Excellent, glad we got it working.

LordTermor commented 2 years ago

ls: unable to access '/usr/lib/gdm/': There is no such file or directory

gdm?

Oops, lost this letter during copying and mistyped it accidentally. Sure it's gbm.

But anyway, great that it actually works.