realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

Example program freezes my PC when interacting with something #63

Closed Gladox114 closed 4 years ago

Gladox114 commented 4 years ago

I am on Linux (Distro: POP!_OS 20.04) with official Nvidia Drivers (440.100) on a GTX 1050

If i click on the window or something behind the window or anything then my pc freezes and it takes a few seconds to be able to interact again.

Here is the whole console.

~/.development/vulkan$ python3 example/example_sdl2.py 
availables extensions: ['VK_KHR_device_group_creation', 'VK_KHR_external_fence_capabilities', 'VK_KHR_external_memory_capabilities', 'VK_KHR_external_semaphore_capabilities', 'VK_KHR_get_display_properties2', 'VK_KHR_get_physical_device_properties2', 'VK_KHR_get_surface_capabilities2', 'VK_KHR_surface', 'VK_KHR_surface_protected_capabilities', 'VK_KHR_wayland_surface', 'VK_KHR_xcb_surface', 'VK_KHR_xlib_surface', 'VK_KHR_display', 'VK_EXT_direct_mode_display', 'VK_EXT_acquire_xlib_display', 'VK_EXT_display_surface_counter', 'VK_EXT_debug_report', 'VK_EXT_debug_utils']

availables layers: ['VK_LAYER_VALVE_steam_overlay_32', 'VK_LAYER_VALVE_steam_fossilize_64', 'VK_LAYER_VALVE_steam_fossilize_32', 'VK_LAYER_VALVE_steam_overlay_64', 'VK_LAYER_MESA_overlay', 'VK_LAYER_LUNARG_standard_validation']

Create Xlib surface
availables devices: ['GeForce GTX 1050', 'Intel(R) UHD Graphics 630 (CFL GT2)']
selected device: GeForce GTX 1050

3 available queue family
indice of selected queue families, graphic: 0, presentation: 0

availables device extensions: ['VK_KHR_8bit_storage', 'VK_KHR_16bit_storage', 'VK_KHR_bind_memory2', 'VK_KHR_create_renderpass2', 'VK_KHR_dedicated_allocation', 'VK_KHR_depth_stencil_resolve', 'VK_KHR_descriptor_update_template', 'VK_KHR_device_group', 'VK_KHR_draw_indirect_count', 'VK_KHR_driver_properties', 'VK_KHR_external_fence', 'VK_KHR_external_fence_fd', 'VK_KHR_external_memory', 'VK_KHR_external_memory_fd', 'VK_KHR_external_semaphore', 'VK_KHR_external_semaphore_fd', 'VK_KHR_get_memory_requirements2', 'VK_KHR_image_format_list', 'VK_KHR_imageless_framebuffer', 'VK_KHR_maintenance1', 'VK_KHR_maintenance2', 'VK_KHR_maintenance3', 'VK_KHR_multiview', 'VK_KHR_pipeline_executable_properties', 'VK_KHR_push_descriptor', 'VK_KHR_relaxed_block_layout', 'VK_KHR_sampler_mirror_clamp_to_edge', 'VK_KHR_sampler_ycbcr_conversion', 'VK_KHR_shader_atomic_int64', 'VK_KHR_shader_draw_parameters', 'VK_KHR_shader_float16_int8', 'VK_KHR_shader_float_controls', 'VK_KHR_storage_buffer_storage_class', 'VK_KHR_swapchain', 'VK_KHR_swapchain_mutable_format', 'VK_KHR_timeline_semaphore', 'VK_KHR_uniform_buffer_standard_layout', 'VK_KHR_variable_pointers', 'VK_KHR_vulkan_memory_model', 'VK_EXT_blend_operation_advanced', 'VK_EXT_buffer_device_address', 'VK_EXT_calibrated_timestamps', 'VK_EXT_conditional_rendering', 'VK_EXT_conservative_rasterization', 'VK_EXT_depth_clip_enable', 'VK_EXT_depth_range_unrestricted', 'VK_EXT_descriptor_indexing', 'VK_EXT_discard_rectangles', 'VK_EXT_display_control', 'VK_EXT_fragment_shader_interlock', 'VK_EXT_global_priority', 'VK_EXT_host_query_reset', 'VK_EXT_index_type_uint8', 'VK_EXT_inline_uniform_block', 'VK_EXT_line_rasterization', 'VK_EXT_memory_budget', 'VK_EXT_pci_bus_info', 'VK_EXT_pipeline_creation_feedback', 'VK_EXT_post_depth_coverage', 'VK_EXT_sample_locations', 'VK_EXT_sampler_filter_minmax', 'VK_EXT_scalar_block_layout', 'VK_EXT_separate_stencil_usage', 'VK_EXT_shader_demote_to_helper_invocation', 'VK_EXT_shader_subgroup_ballot', 'VK_EXT_shader_subgroup_vote', 'VK_EXT_shader_viewport_index_layer', 'VK_EXT_subgroup_size_control', 'VK_EXT_texel_buffer_alignment', 'VK_EXT_transform_feedback', 'VK_EXT_vertex_attribute_divisor', 'VK_EXT_ycbcr_image_arrays', 'VK_NV_clip_space_w_scaling', 'VK_NV_dedicated_allocation', 'VK_NV_dedicated_allocation_image_aliasing', 'VK_NV_device_diagnostic_checkpoints', 'VK_NV_fill_rectangle', 'VK_NV_fragment_coverage_to_color', 'VK_NV_framebuffer_mixed_samples', 'VK_NV_coverage_reduction_mode', 'VK_NV_geometry_shader_passthrough', 'VK_NV_sample_mask_override_coverage', 'VK_NV_shader_sm_builtins', 'VK_NV_shader_subgroup_partitioned', 'VK_NV_viewport_array2', 'VK_NV_viewport_swizzle', 'VK_NVX_device_generated_commands', 'VK_NVX_multiview_per_view_attributes']

Logical device and graphic queue successfully created

selected format: 44
3 available swapchain present modes
3 images view created
FPS: 64
FPS: 61
FPS: 61
FPS: 61
FPS: 50
FPS: 2
FPS: 9
FPS: 1
FPS: 4
FPS: 3
FPS: 5
FPS: 1
FPS: 56
FPS: 61
FPS: 60
FPS: 61
FPS: 61
FPS: 61
FPS: 61
FPS: 61
FPS: 61
FPS: 8
FPS: 2
FPS: 4
FPS: 59
FPS: 61
FPS: 61
FPS: 61
FPS: 16
FPS: 62
FPS: 61
FPS: 61
FPS: 32
FPS: 60
^CTraceback (most recent call last):
  File "example/example_sdl2.py", line 693, in <module>
    draw_frame()
  File "example/example_sdl2.py", line 673, in draw_frame
    vkQueueWaitIdle(presentation_queue)
  File "/home/fuyu/.local/lib/python3.8/site-packages/vulkan/_vulkan.py", line 5305, in vkQueueWaitIdle
    result = _callApi(lib.vkQueueWaitIdle, queue)
  File "/home/fuyu/.local/lib/python3.8/site-packages/vulkan/_vulkan.py", line 4962, in _callApi
    return fn(*fn_args)
KeyboardInterrupt

The lag spikes are the freezes

realitix commented 4 years ago

Hello,

I can't help you with that. It may be a problem with your driver or SDK. This example works for almost everyone.

Sorry.

Le mer. 8 juil. 2020 à 19:23, Gladox114 notifications@github.com a écrit :

I am on Linux (Distro: POP!_OS 20.04) with official Nvidia Drivers (440.100) on a GTX 1050

If i click on the window or something behind the window or anything then my pc freezes and it takes a few seconds to be able to interact again.

Here is the whole console.

~/.development/vulkan$ python3 example/example_sdl2.py availables extensions: ['VK_KHR_device_group_creation', 'VK_KHR_external_fence_capabilities', 'VK_KHR_external_memory_capabilities', 'VK_KHR_external_semaphore_capabilities', 'VK_KHR_get_display_properties2', 'VK_KHR_get_physical_device_properties2', 'VK_KHR_get_surface_capabilities2', 'VK_KHR_surface', 'VK_KHR_surface_protected_capabilities', 'VK_KHR_wayland_surface', 'VK_KHR_xcb_surface', 'VK_KHR_xlib_surface', 'VK_KHR_display', 'VK_EXT_direct_mode_display', 'VK_EXT_acquire_xlib_display', 'VK_EXT_display_surface_counter', 'VK_EXT_debug_report', 'VK_EXT_debug_utils']

availables layers: ['VK_LAYER_VALVE_steam_overlay_32', 'VK_LAYER_VALVE_steam_fossilize_64', 'VK_LAYER_VALVE_steam_fossilize_32', 'VK_LAYER_VALVE_steam_overlay_64', 'VK_LAYER_MESA_overlay', 'VK_LAYER_LUNARG_standard_validation']

Create Xlib surface availables devices: ['GeForce GTX 1050', 'Intel(R) UHD Graphics 630 (CFL GT2)'] selected device: GeForce GTX 1050

3 available queue family indice of selected queue families, graphic: 0, presentation: 0

availables device extensions: ['VK_KHR_8bit_storage', 'VK_KHR_16bit_storage', 'VK_KHR_bind_memory2', 'VK_KHR_create_renderpass2', 'VK_KHR_dedicated_allocation', 'VK_KHR_depth_stencil_resolve', 'VK_KHR_descriptor_update_template', 'VK_KHR_device_group', 'VK_KHR_draw_indirect_count', 'VK_KHR_driver_properties', 'VK_KHR_external_fence', 'VK_KHR_external_fence_fd', 'VK_KHR_external_memory', 'VK_KHR_external_memory_fd', 'VK_KHR_external_semaphore', 'VK_KHR_external_semaphore_fd', 'VK_KHR_get_memory_requirements2', 'VK_KHR_image_format_list', 'VK_KHR_imageless_framebuffer', 'VK_KHR_maintenance1', 'VK_KHR_maintenance2', 'VK_KHR_maintenance3', 'VK_KHR_multiview', 'VK_KHR_pipeline_executable_properties', 'VK_KHR_push_descriptor', 'VK_KHR_relaxed_block_layout', 'VK_KHR_sampler_mirror_clamp_to_edge', 'VK_KHR_sampler_ycbcr_conversion', 'VK_KHR_shader_atomic_int64', 'VK_KHR_shader_draw_parameters', 'VK_KHR_shader_float16_int8', 'VK_KHR_shader_float_controls', 'VK_KHR_storage_buffer_storage_class', 'VK_KHR_swapchain', 'VK_KHR_swapchain_mutable_format', 'VK_KHR_timeline_semaphore', 'VK_KHR_uniform_buffer_standard_layout', 'VK_KHR_variable_pointers', 'VK_KHR_vulkan_memory_model', 'VK_EXT_blend_operation_advanced', 'VK_EXT_buffer_device_address', 'VK_EXT_calibrated_timestamps', 'VK_EXT_conditional_rendering', 'VK_EXT_conservative_rasterization', 'VK_EXT_depth_clip_enable', 'VK_EXT_depth_range_unrestricted', 'VK_EXT_descriptor_indexing', 'VK_EXT_discard_rectangles', 'VK_EXT_display_control', 'VK_EXT_fragment_shader_interlock', 'VK_EXT_global_priority', 'VK_EXT_host_query_reset', 'VK_EXT_index_type_uint8', 'VK_EXT_inline_uniform_block', 'VK_EXT_line_rasterization', 'VK_EXT_memory_budget', 'VK_EXT_pci_bus_info', 'VK_EXT_pipeline_creation_feedback', 'VK_EXT_post_depth_coverage', 'VK_EXT_sample_locations', 'VK_EXT_sampler_filter_minmax', 'VK_EXT_scalar_block_layout', 'VK_EXT_separate_stencil_usage', 'VK_EXT_shader_demote_to_helper_invocation', 'VK_EXT_shader_subgroup_ballot', 'VK_EXT_shader_subgroup_vote', 'VK_EXT_shader_viewport_index_layer', 'VK_EXT_subgroup_size_control', 'VK_EXT_texel_buffer_alignment', 'VK_EXT_transform_feedback', 'VK_EXT_vertex_attribute_divisor', 'VK_EXT_ycbcr_image_arrays', 'VK_NV_clip_space_w_scaling', 'VK_NV_dedicated_allocation', 'VK_NV_dedicated_allocation_image_aliasing', 'VK_NV_device_diagnostic_checkpoints', 'VK_NV_fill_rectangle', 'VK_NV_fragment_coverage_to_color', 'VK_NV_framebuffer_mixed_samples', 'VK_NV_coverage_reduction_mode', 'VK_NV_geometry_shader_passthrough', 'VK_NV_sample_mask_override_coverage', 'VK_NV_shader_sm_builtins', 'VK_NV_shader_subgroup_partitioned', 'VK_NV_viewport_array2', 'VK_NV_viewport_swizzle', 'VK_NVX_device_generated_commands', 'VK_NVX_multiview_per_view_attributes']

Logical device and graphic queue successfully created

selected format: 44 3 available swapchain present modes 3 images view created FPS: 64 FPS: 61 FPS: 61 FPS: 61 FPS: 50 FPS: 2 FPS: 9 FPS: 1 FPS: 4 FPS: 3 FPS: 5 FPS: 1 FPS: 56 FPS: 61 FPS: 60 FPS: 61 FPS: 61 FPS: 61 FPS: 61 FPS: 61 FPS: 61 FPS: 8 FPS: 2 FPS: 4 FPS: 59 FPS: 61 FPS: 61 FPS: 61 FPS: 16 FPS: 62 FPS: 61 FPS: 61 FPS: 32 FPS: 60 ^CTraceback (most recent call last): File "example/example_sdl2.py", line 693, in draw_frame() File "example/example_sdl2.py", line 673, in draw_frame vkQueueWaitIdle(presentation_queue) File "/home/fuyu/.local/lib/python3.8/site-packages/vulkan/_vulkan.py", line 5305, in vkQueueWaitIdle result = _callApi(lib.vkQueueWaitIdle, queue) File "/home/fuyu/.local/lib/python3.8/site-packages/vulkan/_vulkan.py", line 4962, in _callApi return fn(*fn_args) KeyboardInterrupt `

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/realitix/vulkan/issues/63, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQSVQEYU4N5C5EL7EJ46K3R2STQ5ANCNFSM4OUZEGKQ .

IsaiasDimitri commented 4 years ago

I solved this problem running sudo ubuntu-drivers autoinstall and rebooting my system. I guess it's issue comes from Pop_OS (NVIDIA) iso image, but I don't now why.

ubuntu-drivers devices

vendor   : NVIDIA Corporation
model    : GP108M [GeForce MX150]
driver   : nvidia-driver-440-server - distro non-free recommended
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-440 - third-party free
driver   : xserver-xorg-video-nouveau - distro free builtin

Then, it started to work really well Captura de tela de 2020-09-02 02-05-20

realitix commented 4 years ago

Thanks for the feedback