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

high CPU usage #268

Open
rofl0r opened this issue Feb 24, 2019 · 1 comment
Open

high CPU usage #268

rofl0r opened this issue Feb 24, 2019 · 1 comment

Comments

@rofl0r
Copy link
Contributor

rofl0r commented Feb 24, 2019

i get about 80% constant cpu usage while playing tracks.
attached is the output of perf report

# Samples: 368K of event 'cycles:uppp'
# Event count (approx.): 165183435396
#
# Overhead  Command         Shared Object          Symbol                       
# ........  ..............  .....................  .............................
#
    15.92%  klystrack       libc.so                [.] __pthread_mutex_lock
    14.82%  klystrack       i965_dri.so            [.] vbo_Vertex2f
     3.59%  klystrack       libc.so                [.] memcmp
     3.25%  klystrack       i965_dri.so            [.] check_and_emit_atom
     2.49%  klystrack       i965_dri.so            [.] brw_upload_pipeline_state
     2.35%  klystrack       libc.so                [.] __pthread_mutex_unlock
     1.54%  klystrack       i965_dri.so            [.] vbo_exec_vtx_flush
     1.51%  klystrack       i965_dri.so            [.] brw_search_cache
     1.33%  klystrack       libdrm_intel.so.1.0.0  [.] drm_intel_gem_bo_referenc
     1.32%  klystrack       i965_dri.so            [.] hash_key
     1.29%  klystrack       i965_dri.so            [.] brw_upload_sampler_state_
     1.26%  klystrack       i965_dri.so            [.] _mesa_update_texture
     1.22%  klystrack       i965_dri.so            [.] gen8_emit_vertices
     1.21%  klystrack       i965_dri.so            [.] _mesa_update_state_locked
     1.11%  klystrack       i965_dri.so            [.] brw_draw_prims
     1.07%  klystrack       i965_dri.so            [.] brw_prepare_vertices
     1.04%  SDLAudioP1      klystrack              [.] cyd_advance_oscillators.i
     0.96%  klystrack       libdrm_intel.so.1.0.0  [.] drm_intel_gem_bo_unrefere
     0.93%  klystrack       libdrm_intel.so.1.0.0  [.] do_bo_emit_reloc
     0.86%  klystrack       i965_dri.so            [.] brw_update_texture_surfac
     0.84%  klystrack       libc.so                [.] memcpy
     0.82%  klystrack       i965_dri.so            [.] brw_merge_inputs
     0.82%  klystrack       libSDL2-2.0.so.0.9.0   [.] GL_RenderCopy
     0.74%  klystrack       i965_dri.so            [.] vbo_exec_wrap_upgrade_ver
     0.73%  klystrack       libc.so                [.] printf_core
     0.72%  klystrack       libc.so                [.] __pthread_mutex_trylock_o
     0.71%  klystrack       i965_dri.so            [.] isl_gen9_surf_fill_state_
     0.68%  klystrack       libglapi.so.0.0.0      [.] u_current_get_table
     0.67%  klystrack       libdrm_intel.so.1.0.0  [.] drm_intel_gem_bo_unrefere
     0.67%  klystrack       i965_dri.so            [.] update_stage_texture_surf
     0.59%  klystrack       i965_dri.so            [.] brw_wm_populate_key
     0.59%  klystrack       i965_dri.so            [.] intel_batchbuffer_require
     0.58%  klystrack       i965_dri.so            [.] brw_upload_binding_table
     0.55%  klystrack       i965_dri.so            [.] vbo_exec_copy_to_current
     0.55%  SDLAudioP1      klystrack              [.] cyd_output_channel
     0.54%  klystrack       i965_dri.so            [.] set_search
     0.53%  SDLAudioP1      klystrack              [.] cyd_output
     0.52%  klystrack       libSDL2-2.0.so.0.9.0   [.] SDL_RenderGetViewport_REA
     0.51%  klystrack       i965_dri.so            [.] _mesa_hash_data
     0.50%  klystrack       i965_dri.so            [.] vbo_TexCoord2f
     0.48%  klystrack       i965_dri.so            [.] brw_emit_surface_state
     0.47%  klystrack       i965_dri.so            [.] brw_update_texture_surfac
     0.44%  SDLAudioP1      libasound.so.2.0.0     [.] mix_areas_32_smp
     0.42%  klystrack       i965_dri.so            [.] intel_update_state
     0.41%  klystrack       i965_dri.so            [.] set_add
     0.41%  klystrack       i965_dri.so            [.] vbo_exec_Begin
     0.40%  klystrack       i965_dri.so            [.] intel_prepare_render
     0.39%  klystrack       i965_dri.so            [.] GEN9_RENDER_SURFACE_STATE
     0.39%  klystrack       i965_dri.so            [.] brw_get_vertex_surface_ty
     0.36%  klystrack       i965_dri.so            [.] intel_upload_space
     0.36%  klystrack       libc.so                [.] __bin_chunk
     0.35%  klystrack       i965_dri.so            [.] brw_vs_populate_key
     0.34%  klystrack       i965_dri.so            [.] brw_upload_vs_image_surfa
     0.33%  klystrack       i965_dri.so            [.] brw_emit_vertex_buffer_st
     0.32%  klystrack       libdrm_intel.so.1.0.0  [.] drm_intel_gem_bo_process_
     0.32%  klystrack       i965_dri.so            [.] brw_get_texture_swizzle
     0.32%  klystrack       libdrm_intel.so.1.0.0  [.] drm_intel_gem_bo_emit_rel
     0.32%  klystrack       i965_dri.so            [.] brw_populate_sampler_prog
     0.31%  klystrack       i965_dri.so            [.] brw_upload_image_surfaces
     0.30%  klystrack       klystrack              [.] pattern_view_inner
... etc

my suspicion is that the screen is constantly redrawn without any sleep delays in between rendering of the single frames... rather than targeting 40 fps or so.
there's also a very nervous flickering of the screen which seems to support my suspicion.

@kometbomb
Copy link
Owner

I think the screen update (while quite heavy on all platforms) is somehow broken on non-Windows platforms. The root caouse of the problem is how SDL handles rendering, no calls are batched. The whole screen is usually updated by klystrack so e.g. the main view with lots of tiny rectangles is very, very heavy.

Not sure if it could be easily added that only the dirty regions are updated.

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

2 participants