Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add virtio drivers #10

Open
RushingAlien opened this issue Sep 6, 2024 · 0 comments
Open

Add virtio drivers #10

RushingAlien opened this issue Sep 6, 2024 · 0 comments

Comments

@RushingAlien
Copy link

Hey! So progress has been moving to get virgl and venus on Waydroid at waydroid/waydroid#564, but it janrupf claimed that waydroid's binary images are not built with virtio drivers. Is this true?

Kaz205 pushed a commit to Kaz205/android_external_mesa3d that referenced this issue Nov 26, 2024
This change ensures that all these allocations are using
the same memory context.

For instance, this issue is triggered with:
"piglit/bin/arb_shader_image_load_store-host-mem-barrier -auto -fbo":
Indirect leak of 32816 byte(s) in 1 object(s) allocated from:
    #0 0x7f49a35447ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef)
    waydroid#1 0x7f49998e4b4f in ralloc_size ../src/util/ralloc.c:118
    waydroid#2 0x7f49998e7521 in create_slab ../src/util/ralloc.c:801
    waydroid#3 0x7f49998e7521 in gc_alloc_size ../src/util/ralloc.c:840
    waydroid#4 0x7f49998e7d11 in gc_zalloc_size ../src/util/ralloc.c:868
    waydroid#5 0x7f49999a6126 in nir_alu_instr_create ../src/compiler/nir/nir.c:682
    waydroid#6 0x7f49999cba48 in clone_alu ../src/compiler/nir/nir_clone.c:217
    waydroid#7 0x7f49999cc85a in clone_instr ../src/compiler/nir/nir_clone.c:456
    waydroid#8 0x7f49999cee3a in clone_block ../src/compiler/nir/nir_clone.c:529
    waydroid#9 0x7f49999cee3a in clone_cf_list ../src/compiler/nir/nir_clone.c:583
    waydroid#10 0x7f49999d03be in clone_function_impl ../src/compiler/nir/nir_clone.c:660
    waydroid#11 0x7f49999d13f7 in nir_function_impl_clone ../src/compiler/nir/nir_clone.c:678
    #12 0x7f4999a0e2c5 in lower_call_function_impl ../src/compiler/nir/nir_functions.c:397
    #13 0x7f4999a0e2c5 in function_link_pass ../src/compiler/nir/nir_functions.c:430
    #14 0x7f4999a0e2c5 in function_link_pass ../src/compiler/nir/nir_functions.c:408
    #15 0x7f4999a0e2c5 in nir_function_instructions_pass ../src/compiler/nir/nir_builder.h:108
    #16 0x7f4999a0e2c5 in nir_link_shader_functions ../src/compiler/nir/nir_functions.c:452
    #17 0x7f499ca30b8f in link_libintel_shaders ../src/gallium/drivers/iris/iris_program_cache.c:329
    #18 0x7f499ca30b8f in iris_ensure_indirect_generation_shader ../src/gallium/drivers/iris/iris_program_cache.c:374
    #19 0x7f499d185267 in gfx9_emit_indirect_generate ../src/gallium/drivers/iris/iris_indirect_gen.c:593
    #20 0x7f499d119c79 in iris_upload_indirect_shader_render_state ../src/gallium/drivers/iris/iris_state.c:8744
    #21 0x7f499fe86b01 in iris_indirect_draw_vbo ../src/gallium/drivers/iris/iris_draw.c:233
    #22 0x7f499fe86b01 in iris_draw_vbo ../src/gallium/drivers/iris/iris_draw.c:343
    #23 0x7f499a174e43 in tc_call_draw_indirect ../src/gallium/auxiliary/util/u_threaded_context.c:3828
    #24 0x7f499a1557fe in batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:453
    #25 0x7f499a1557fe in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:504
    #26 0x7f499a167f26 in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:761
    #27 0x7f499a168888 in tc_texture_map ../src/gallium/auxiliary/util/u_threaded_context.c:2783
    #28 0x7f49986f2631 in pipe_texture_map ../src/gallium/auxiliary/util/u_inlines.h:556
    #29 0x7f49986f2631 in _mesa_map_renderbuffer ../src/mesa/main/renderbuffer.c:494
    #30 0x7f49991af7ca in readpixels_memcpy ../src/mesa/main/readpix.c:260
    #31 0x7f49991af7ca in _mesa_readpixels ../src/mesa/main/readpix.c:898
    #32 0x7f499931ee23 in st_ReadPixels ../src/mesa/state_tracker/st_cb_readpixels.c:575
    #33 0x7f49991b40b5 in read_pixels ../src/mesa/main/readpix.c:1199
    #34 0x7f49991b40b5 in _mesa_ReadnPixelsARB ../src/mesa/main/readpix.c:1216
    #35 0x7f49991b4a20 in _mesa_ReadPixels ../src/mesa/main/readpix.c:1231
...
SUMMARY: AddressSanitizer: 323648 byte(s) leaked in 201 allocation(s).

Fixes: 5438b19 ("iris: enable generated indirect draws")
Signed-off-by: Patrick Lerda <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31313>
(cherry picked from commit b6b363c)
Kaz205 pushed a commit to Kaz205/android_external_mesa3d that referenced this issue Nov 26, 2024
For instance, this issue is triggered with "piglit/bin/glsl-fs-loop -auto -fbo":
Indirect leak of 120 byte(s) in 5 object(s) allocated from:
    #0 0x7f8e7930ef57 in operator new(unsigned long) (/usr/lib64/libasan.so.6+0xb2f57)
    waydroid#1 0x7f8e6dc8c68a in __gnu_cxx::new_allocator<std::_List_node<nir_intrinsic_instr*> >::allocate(unsigned long, void const*) /usr/include/c++/11.4.0/ext/new_allocator.h:127
    waydroid#2 0x7f8e6dc8c68a in std::allocator_traits<std::allocator<std::_List_node<nir_intrinsic_instr*> > >::allocate(std::allocator<std::_List_node<nir_intrinsic_instr*> >&, unsigned long) /usr/include/c++/11.4.0/bits/alloc_traits.h:464
    waydroid#3 0x7f8e6dc8c68a in std::__cxx11::_List_base<nir_intrinsic_instr*, std::allocator<nir_intrinsic_instr*> >::_M_get_node() /usr/include/c++/11.4.0/bits/stl_list.h:443
    waydroid#4 0x7f8e6dc8c68a in std::_List_node<nir_intrinsic_instr*>* std::__cxx11::list<nir_intrinsic_instr*, std::allocator<nir_intrinsic_instr*> >::_M_create_node<nir_intrinsic_instr* const&>(nir_intrinsic_instr* const&) /usr/include/c++/11.4.0/bits/stl_list.h:635
    waydroid#5 0x7f8e6dc8c68a in void std::__cxx11::list<nir_intrinsic_instr*, std::allocator<nir_intrinsic_instr*> >::_M_insert<nir_intrinsic_instr* const&>(std::_List_iterator<nir_intrinsic_instr*>, nir_intrinsic_instr* const&) /usr/include/c++/11.4.0/bits/stl_list.h:1912
    waydroid#6 0x7f8e6dc8c68a in std::__cxx11::list<nir_intrinsic_instr*, std::allocator<nir_intrinsic_instr*> >::push_back(nir_intrinsic_instr* const&) /usr/include/c++/11.4.0/bits/stl_list.h:1213
    waydroid#7 0x7f8e6dc8c68a in r600::Shader::scan_instruction(nir_instr*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:655
    waydroid#8 0x7f8e6dc8cc2a in r600::Shader::scan_shader(nir_function const*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:554
    waydroid#9 0x7f8e6dcab5bc in r600::Shader::process(nir_shader*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:526
    waydroid#10 0x7f8e6dcabae1 in r600::Shader::translate_from_nir(nir_shader*, pipe_stream_output_info const*, r600_shader*, r600_shader_key const&, r600_chip_class, radeon_family) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:494
    waydroid#11 0x7f8e6da5bf15 in r600_shader_from_nir ../src/gallium/drivers/r600/r600_sfn.cpp:111
    #12 0x7f8e6da5db2c in r600_pipe_shader_create ../src/gallium/drivers/r600/r600_shader.c:198
    #13 0x7f8e6da95c62 in r600_shader_select ../src/gallium/drivers/r600/r600_state_common.c:961
    #14 0x7f8e6da9c09f in r600_update_derived_state ../src/gallium/drivers/r600/r600_state_common.c:1888
    #15 0x7f8e6da9c09f in r600_draw_vbo ../src/gallium/drivers/r600/r600_state_common.c:2219
    #16 0x7f8e6d55229d in u_vbuf_draw_vbo ../src/gallium/auxiliary/util/u_vbuf.c:1782
    #17 0x7f8e6c5d6322 in _mesa_draw_arrays ../src/mesa/main/draw.c:1204

Fixes: 5de8141 ("r600/sfn: Allow skipping backend shader optimization for a subset of shaders")
Signed-off-by: Patrick Lerda <[email protected]>
Reviewed-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27334>
(cherry picked from commit b660c73)
Kaz205 pushed a commit to Kaz205/android_external_mesa3d that referenced this issue Nov 26, 2024
For instance, this issue is triggered with "piglit/bin/glsl-vs-arrays -auto -fbo":
Direct leak of 104 byte(s) in 1 object(s) allocated from:
    #0 0x7f2fab415f57 in operator new(unsigned long) (/usr/lib64/libasan.so.6+0xb2f57)
    waydroid#1 0x7f2f9fd9d541 in __gnu_cxx::new_allocator<std::__detail::_Hash_node_base*>::allocate(unsigned long, void const*) /usr/include/c++/11.4.0/ext/new_allocator.h:127
    waydroid#2 0x7f2f9fd9d541 in std::allocator_traits<std::allocator<std::__detail::_Hash_node_base*> >::allocate(std::allocator<std::__detail::_Hash_node_base*>&, unsigned long) /usr/include/c++/11.4.0/bits/alloc_traits.h:464
    waydroid#3 0x7f2f9fd9d541 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<int const, r600::Instr*>, false> > >::_M_allocate_buckets(unsigned long) /usr/include/c++/11.4.0/bits/hashtable_policy.h:1927
    waydroid#4 0x7f2f9fd9d541 in std::_Hashtable<int, std::pair<int const, r600::Instr*>, std::allocator<std::pair<int const, r600::Instr*> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_allocate_buckets(unsigned long) /usr/include/c++/11.4.0/bits/hashtable.h:440
    waydroid#5 0x7f2f9fd9d541 in std::_Hashtable<int, std::pair<int const, r600::Instr*>, std::allocator<std::pair<int const, r600::Instr*> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_rehash_aux(unsigned long, std::integral_constant<bool, true>) /usr/include/c++/11.4.0/bits/hashtable.h:2382
    waydroid#6 0x7f2f9fd9d541 in std::_Hashtable<int, std::pair<int const, r600::Instr*>, std::allocator<std::pair<int const, r600::Instr*> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_rehash(unsigned long, unsigned long const&) /usr/include/c++/11.4.0/bits/hashtable.h:2361
    waydroid#7 0x7f2f9fd9d541 in std::_Hashtable<int, std::pair<int const, r600::Instr*>, std::allocator<std::pair<int const, r600::Instr*> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<int const, r600::Instr*>, false>*, unsigned long) /usr/include/c++/11.4.0/bits/hashtable.h:2021
    waydroid#8 0x7f2f9fd9e7f8 in std::__detail::_Map_base<int, std::pair<int const, r600::Instr*>, std::allocator<std::pair<int const, r600::Instr*> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true>, true>::operator[](int&&) /usr/include/c++/11.4.0/bits/hashtable_policy.h:741
    waydroid#9 0x7f2f9fd9f6fe in std::unordered_map<int, r600::Instr*, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, r600::Instr*> > >::operator[](int&&) /usr/include/c++/11.4.0/bits/unordered_map.h:984
    waydroid#10 0x7f2f9fd9f6fe in r600::Shader::InstructionChain::visit(r600::AluInstr*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:1358
    waydroid#11 0x7f2f9fd8f309 in r600::Shader::emit_instruction(r600::Instr*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:1419
    #12 0x7f2f9fd8f822 in r600::RegisterReadHandler::visit(r600::LocalArray&) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:1040
    #13 0x7f2f9fd8e726 in r600::Shader::emit_load_reg_indirect(nir_intrinsic_instr*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:993
    #14 0x7f2f9fd8de5c in r600::Shader::process_instr(nir_instr*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:848
    #15 0x7f2f9fd8de5c in r600::Shader::process_block(nir_block*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:836
    #16 0x7f2f9fd962f2 in r600::Shader::process_cf_node(nir_cf_node*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:669
    #17 0x7f2f9fdac01a in r600::Shader::process(nir_shader*) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:537
    #18 0x7f2f9fdac3d1 in r600::Shader::translate_from_nir(nir_shader*, pipe_stream_output_info const*, r600_shader*, r600_shader_key const&, r600_chip_class, radeon_family) ../src/gallium/drivers/r600/sfn/sfn_shader.cpp:494
    #19 0x7f2f9fb5c8f5 in r600_shader_from_nir ../src/gallium/drivers/r600/r600_sfn.cpp:111
    #20 0x7f2f9fb5e50c in r600_pipe_shader_create ../src/gallium/drivers/r600/r600_shader.c:198
    #21 0x7f2f9fb96642 in r600_shader_select ../src/gallium/drivers/r600/r600_state_common.c:961
    #22 0x7f2f9fb97340 in r600_create_shader_state ../src/gallium/drivers/r600/r600_state_common.c:1056
    #23 0x7f2f9e060f82 in st_create_common_variant ../src/mesa/state_tracker/st_program.c:720
    #24 0x7f2f9e06e779 in st_get_common_variant ../src/mesa/state_tracker/st_program.c:773
    #25 0x7f2f9e06f78d in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:1259
    #26 0x7f2f9e06f78d in st_finalize_program ../src/mesa/state_tracker/st_program.c:1345
    #27 0x7f2f9ead0f20 in st_link_glsl_to_nir ../src/mesa/state_tracker/st_glsl_to_nir.cpp:723
    #28 0x7f2f9ead0f20 in st_link_shader ../src/mesa/state_tracker/st_glsl_to_nir.cpp:951
    #29 0x7f2f9e9b0d15 in link_program ../src/mesa/main/shaderapi.c:1336
    #30 0x7f2f9e9b0d15 in link_program_error ../src/mesa/main/shaderapi.c:1447

Fixes: ddb167e ("r600/sfn: Handle indirect array load/store dependencies better")
Signed-off-by: Patrick Lerda <[email protected]>
Reviewed-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27334>
(cherry picked from commit 242da61)
Kaz205 pushed a commit to Kaz205/android_external_mesa3d that referenced this issue Nov 26, 2024
Addresses:
```
Indirect leak of 256 byte(s) in 2 object(s) allocated from:
    #0 0x7faaf53ee0 in __interceptor_malloc
       ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    waydroid#1 0x7fa8cfe900 in ralloc_size ../src/util/ralloc.c:118
    waydroid#2 0x7fa8cfeb20 in rzalloc_size ../src/util/ralloc.c:152
    waydroid#3 0x7fa8cff004 in rzalloc_array_size ../src/util/ralloc.c:232
    waydroid#4 0x7fa8d06a84 in _mesa_set_init ../src/util/set.c:133
    waydroid#5 0x7fa8d06bcc in _mesa_set_create ../src/util/set.c:152
    waydroid#6 0x7fa8d0939c in _mesa_pointer_set_create ../src/util/set.c:613
    waydroid#7 0x7fa95e5790 in nir_lower_mediump_vars
       ../src/compiler/nir/nir_lower_mediump.c:574
    waydroid#8 0x7fa862c1c8 in tu_spirv_to_nir(tu_device*, void*, unsigned long,
       VkPipelineShaderStageCreateInfo const*, tu_shader_key const*,
pipe_shader_type) ../src/freedreno/vulkan/tu_shader.cc:116
    waydroid#9 0x7fa8646f24 in tu_compile_shaders(tu_device*, unsigned long,
       VkPipelineShaderStageCreateInfo const**, nir_shader**,
tu_shader_key const*, tu_pipeline_layout*, unsigned char const*,
tu_shader**, char**, void*, nir_shader**, VkPipelineCreationFeedback*)
../src/freedreno/vulkan/tu_shader.cc:2741
    waydroid#10 0x7fa85a16a4 in tu_pipeline_builder_compile_shaders
	../src/freedreno/vulkan/tu_pipeline.cc:1887
    waydroid#11 0x7fa85eb844 in tu_pipeline_builder_build<(chip)7>
	../src/freedreno/vulkan/tu_pipeline.cc:3923
    #12 0x7fa85e6bd8 in tu_graphics_pipeline_create<(chip)7>
	../src/freedreno/vulkan/tu_pipeline.cc:4203
    #13 0x7fa85c2588 in VkResult
	tu_CreateGraphicsPipelines<(chip)7>(VkDevice_T*,
VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*,
VkAllocationCallbacks const*, VkPipeline_T**)
../src/freedreno/vulkan/tu_pipeline.cc:4234
```
seen in:
dEQP-VK.binding_model.mutable_descriptor.single.switches.uniform_texel_buffer_storage_image.update_write.no_source.no_source.pool_expand_types.pre_update.no_array.vert

Fixes: 7e986e5 ("nir/lower_mediump_vars: Don't lower mediump shared vars with atomic access.")
Signed-off-by: Karmjit Mahil <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32057>
(cherry picked from commit 2a7df331af65216e0229fe6481c1eca70221b225)
supechicken pushed a commit to Waydroid-ATV/android_external_mesa3d that referenced this issue Nov 29, 2024
Addresses:
```
Indirect leak of 256 byte(s) in 2 object(s) allocated from:
    #0 0x7faaf53ee0 in __interceptor_malloc
       ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    waydroid#1 0x7fa8cfe900 in ralloc_size ../src/util/ralloc.c:118
    waydroid#2 0x7fa8cfeb20 in rzalloc_size ../src/util/ralloc.c:152
    waydroid#3 0x7fa8cff004 in rzalloc_array_size ../src/util/ralloc.c:232
    waydroid#4 0x7fa8d06a84 in _mesa_set_init ../src/util/set.c:133
    waydroid#5 0x7fa8d06bcc in _mesa_set_create ../src/util/set.c:152
    waydroid#6 0x7fa8d0939c in _mesa_pointer_set_create ../src/util/set.c:613
    waydroid#7 0x7fa95e5790 in nir_lower_mediump_vars
       ../src/compiler/nir/nir_lower_mediump.c:574
    waydroid#8 0x7fa862c1c8 in tu_spirv_to_nir(tu_device*, void*, unsigned long,
       VkPipelineShaderStageCreateInfo const*, tu_shader_key const*,
pipe_shader_type) ../src/freedreno/vulkan/tu_shader.cc:116
    waydroid#9 0x7fa8646f24 in tu_compile_shaders(tu_device*, unsigned long,
       VkPipelineShaderStageCreateInfo const**, nir_shader**,
tu_shader_key const*, tu_pipeline_layout*, unsigned char const*,
tu_shader**, char**, void*, nir_shader**, VkPipelineCreationFeedback*)
../src/freedreno/vulkan/tu_shader.cc:2741
    waydroid#10 0x7fa85a16a4 in tu_pipeline_builder_compile_shaders
	../src/freedreno/vulkan/tu_pipeline.cc:1887
    waydroid#11 0x7fa85eb844 in tu_pipeline_builder_build<(chip)7>
	../src/freedreno/vulkan/tu_pipeline.cc:3923
    #12 0x7fa85e6bd8 in tu_graphics_pipeline_create<(chip)7>
	../src/freedreno/vulkan/tu_pipeline.cc:4203
    #13 0x7fa85c2588 in VkResult
	tu_CreateGraphicsPipelines<(chip)7>(VkDevice_T*,
VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*,
VkAllocationCallbacks const*, VkPipeline_T**)
../src/freedreno/vulkan/tu_pipeline.cc:4234
```
seen in:
dEQP-VK.binding_model.mutable_descriptor.single.switches.uniform_texel_buffer_storage_image.update_write.no_source.no_source.pool_expand_types.pre_update.no_array.vert

Fixes: 7e986e5 ("nir/lower_mediump_vars: Don't lower mediump shared vars with atomic access.")
Signed-off-by: Karmjit Mahil <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32057>
(cherry picked from commit 2a7df331af65216e0229fe6481c1eca70221b225)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant