telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.93k stars 5.13k forks source link

TG Desktop uses dGPU instead of iGPU, ignoring all priority #27374

Closed kcalbxof closed 8 months ago

kcalbxof commented 8 months ago

Steps to reproduce

  1. Install TG desktop from a snap
  2. Launch TG desktop
  3. Launch nvidia-smi

Expected behaviour

TG desktop using iGPU and being a good boy

Actual behaviour

TG desktop using 3060 to render itself, like, do you really need it?

Operating system

Ubuntu 23.10 x86_64 Wayland

Version of Telegram Desktop

4.14.6

Installation source

Snap

Crash ID

No response

Logs

[2024.01.17 11:35:51] Launched version: 4014006, install beta: [FALSE], alpha: 0, debug mode: [FALSE]
[2024.01.17 11:35:51] Executable dir: /snap/telegram-desktop/5439/usr/bin/, name: telegram-desktop
[2024.01.17 11:35:51] Initial working dir: /home/user/
[2024.01.17 11:35:51] Working dir: /home/user/snap/telegram-desktop/5439/.local/share/TelegramDesktop/
[2024.01.17 11:35:51] Command line: /snap/telegram-desktop/5439/usr/bin/telegram-desktop --
[2024.01.17 11:35:51] Executable path before check: /snap/telegram-desktop/5439/usr/bin/telegram-desktop
[2024.01.17 11:35:51] Logs started
[2024.01.17 11:35:51] App ID: telegram-desktop_telegram-desktop
[2024.01.17 11:35:52] Connecting local socket to snap.telegram-desktop.c154515eef2427c1397d5ac96aba208d...
[2024.01.17 11:35:52] Socket connect error 0, starting server and app...
[2024.01.17 11:35:52] Moved logging from '/home/user/snap/telegram-desktop/5439/.local/share/TelegramDesktop/log_start0.txt' to '/home/user/snap/telegram-desktop/5439/.local/share/TelegramDesktop/log.txt'!
[2024.01.17 11:35:52] Global devicePixelRatio: 2
[2024.01.17 11:35:52] Primary screen DPI: 96, Base: 96.
[2024.01.17 11:35:52] Computed screen scale: 100
[2024.01.17 11:35:52] DevicePixelRatio: 2
[2024.01.17 11:35:52] ScreenScale: 100
[2024.01.17 11:35:52] Icon theme: Adwaita
[2024.01.17 11:35:52] Fallback icon theme: 
[2024.01.17 11:35:52] System tray available: [TRUE]
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2024.01.17 11:35:52] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2024.01.17 11:35:52] App Info: reading settings...
[2024.01.17 11:35:52] App Info: reading encrypted settings...
[2024.01.17 11:35:52] Lang Info: Loaded cached, keys: 6091
[2024.01.17 11:35:52] OpenAL Logging Level: (not set)
[2024.01.17 11:35:52] Audio Playback Devices: Built-in Audio Analog Stereo
[2024.01.17 11:35:52] Audio Playback Default Device: Built-in Audio Analog Stereo
[2024.01.17 11:35:52] Audio Capture Devices: Built-in Audio Analog Stereo;Monitor of Built-in Audio Analog Stereo
[2024.01.17 11:35:52] Audio Capture Default Device: Built-in Audio Analog Stereo
[2024.01.17 11:35:52] OpenGL Profile: OpenGLES.
[2024.01.17 11:35:52] OpenGL Renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
[2024.01.17 11:35:52] OpenGL Vendor: NVIDIA Corporation
[2024.01.17 11:35:52] OpenGL Version: OpenGL ES 3.2 NVIDIA 535.146.02
[2024.01.17 11:35:52] OpenGL Extensions: GL_NV_copy_buffer, GL_EXT_window_rectangles, GL_NV_primitive_shading_rate, GL_NV_draw_texture, GL_NV_mesh_shader, GL_EXT_sRGB_write_control, GL_EXT_texture_border_clamp, GL_EXT_shader_group_vote, GL_OES_mapbuffer, GL_EXT_texture_shadow_lod, GL_OES_geometry_shader, GL_EXT_shader_non_constant_global_initializers, GL_OES_geometry_point_size, GL_OES_texture_half_float, GL_OES_copy_image, GL_OES_get_program_binary, GL_NV_memory_object_sparse, GL_EXT_multiview_texture_multisample, GL_NV_texture_barrier, GL_NV_stereo_view_rendering, GL_NVX_blend_equation_advanced_multi_draw_buffers, GL_NV_texture_compression_s3tc_update, GL_OES_element_index_uint, GL_OES_texture_storage_multisample_2d_array, GL_NV_clip_space_w_scaling, GL_NV_scissor_exclusive, GL_NV_fragment_shader_interlock, GL_EXT_discard_framebuffer, GL_NV_texture_dirty_tile_map, GL_OES_surfaceless_context, GL_EXT_sparse_texture2, GL_EXT_EGL_image_array, GL_NV_shader_texture_footprint, GL_OES_vertex_array_object, GL_OES_shader_image_atomic, GL_OES_texture_buffer, GL_EXT_map_buffer_range, GL_EXT_semaphore_fd, GL_EXT_depth_clamp, GL_EXT_blend_func_extended, GL_NV_framebuffer_mixed_samples, GL_KHR_robustness, GL_NV_image_formats, GL_OES_EGL_image_external_essl3, GL_EXT_frag_depth, GL_OES_texture_float, GL_EXT_shader_io_blocks, GL_NV_timeline_semaphore, GL_EXT_texture_filter_anisotropic, GL_EXT_draw_elements_base_vertex, GL_EXT_robustness, GL_EXT_copy_image, GL_EXT_float_blend, GL_NV_fragment_coverage_to_color, GL_EXT_memory_object, GL_EXT_base_instance, GL_EXT_texture_compression_dxt1, GL_EXT_color_buffer_float, GL_NV_memory_attachment, GL_NV_shader_subgroup_partitioned, GL_OES_primitive_bounding_box, GL_OES_sample_variables, GL_KHR_blend_equation_advanced_coherent, GL_EXT_unpack_subimage, GL_OES_EGL_sync, GL_KHR_context_flush_control, GL_OES_shader_multisample_interpolation, GL_NV_shader_atomic_fp16_vector, GL_NV_non_square_matrices, GL_NV_packed_float_linear, GL_OES_draw_buffers_indexed, GL_EXT_shadow_samplers, GL_OES_viewport_array, GL_NV_pixel_buffer_object, GL_OES_sample_shading, GL_OVR_multiview_multisampled_render_to_texture, , GL_NV_draw_vulkan_image, GL_NV_read_depth_stencil, GL_EXT_memory_object_fd, GL_OES_compressed_ETC1_RGB8_texture, GL_OES_tessellation_point_size, GL_EXT_multisample_compatibility, GL_KHR_parallel_shader_compile, GL_OVR_multiview, GL_NV_fbo_color_attachments, GL_EXT_texture_compression_bptc, GL_EXT_occlusion_query_boolean, GL_KHR_shader_subgroup, GL_EXT_texture_buffer, GL_NV_draw_buffers, GL_KHR_no_error, GL_OES_texture_float_linear, GL_OES_texture_npot, GL_EXT_texture_norm16, GL_EXT_multiview_timer_query, GL_OES_EGL_image, GL_NV_sample_locations, GL_OES_shader_io_blocks, GL_OES_texture_border_clamp, GL_EXT_multisampled_render_to_texture, GL_EXT_post_depth_coverage, GL_EXT_debug_label, GL_KHR_texture_compression_astc_ldr, GL_NV_conditional_render, GL_NV_conservative_raster_pre_snap_triangles, GL_EXT_read_format_bgra, GL_EXT_EGL_image_external_wrap_modes, GL_EXT_tessellation_shader, GL_NV_viewport_array2, GL_KHR_texture_compression_astc_hdr, GL_NV_occlusion_query_samples, GL_OES_depth_texture, GL_EXT_shader_integer_mix, GL_NV_framebuffer_blit, GL_EXT_buffer_storage, GL_OES_vertex_half_float, GL_OES_texture_view, GL_EXT_semaphore, GL_EXT_sparse_texture, GL_NV_fragment_shader_barycentric, GL_NV_generate_mipmap_sRGB, GL_EXT_shader_texture_lod, GL_EXT_shader_implicit_conversions, GL_OES_EGL_image_external, GL_NV_copy_image, GL_NV_framebuffer_multisample, GL_NV_packed_float, GL_EXT_compressed_ETC1_RGB8_sub_texture, GL_KHR_robust_buffer_access_behavior, GL_NV_viewport_swizzle, GL_NV_texture_border_clamp, GL_NV_instanced_arrays, GL_OES_fbo_render_mipmap, GL_NV_viewport_array, GL_ANDROID_extension_pack_es31a, GL_NV_blend_equation_advanced_coherent, GL_EXT_clip_control, GL_NV_texture_array, GL_EXT_EGL_image_storage, GL_NV_read_buffer, GL_NV_path_rendering, GL_NV_draw_instanced, GL_NV_polygon_mode, GL_NV_fill_rectangle, GL_EXT_texture_storage, GL_NV_bindless_texture, GL_EXT_texture_mirror_clamp_to_edge, GL_EXT_texture_rg, GL_NV_texture_compression_s3tc, GL_EXT_sRGB, GL_NV_shading_rate_image, GL_OES_texture_stencil8, GL_OES_texture_half_float_linear, GL_NV_read_depth, GL_NV_shadow_samplers_array, GL_NV_sample_mask_override_coverage, GL_NV_gpu_shader5, GL_NV_path_rendering_shared_edge, GL_EXT_conservative_depth, GL_EXT_polygon_offset_clamp, GL_NV_pack_subimage, GL_EXT_texture_query_lod, GL_OES_depth32, GL_EXT_color_buffer_half_float, GL_KHR_texture_compression_astc_sliced_3d, GL_EXT_disjoint_timer_query, GL_EXT_texture_sRGB_R8, GL_NV_sRGB_formats, GL_EXT_primitive_bounding_box, GL_EXT_multi_draw_indirect, GL_OES_depth24, GL_NV_timer_query, GL_EXT_render_snorm, GL_KHR_debug, GL_EXT_clip_cull_distance, GL_EXT_separate_shader_objects, GL_EXT_draw_buffers_indexed, GL_EXT_raster_multisample, GL_OES_rgb8_rgba8, GL_NV_compute_shader_derivatives, GL_EXT_texture_view, GL_NV_texture_compression_latc, GL_OVR_multiview2, GL_OES_tessellation_shader, GL_NV_blend_equation_advanced, GL_OES_texture_cube_map_array, GL_KHR_blend_equation_advanced, GL_EXT_texture_sRGB_decode, GL_OES_packed_depth_stencil, GL_NV_shadow_samplers_cube, GL_EXT_gpu_shader5, GL_EXT_texture_format_BGRA8888, GL_OES_depth_texture_cube_map, GL_EXT_clear_texture, GL_NV_bgr, GL_NV_blend_minmax_factor, GL_OES_gpu_shader5, GL_OES_standard_derivatives, GL_NV_internalformat_sample_query, GL_EXT_geometry_point_size, GL_NV_read_stencil, GL_EXT_texture_filter_minmax, GL_NV_geometry_shader_passthrough, GL_EXT_multisampled_render_to_texture2, GL_NV_representative_fragment_test, GL_NV_shader_noperspective_interpolation, GL_EXT_texture_compression_rgtc, GL_EXT_texture_cube_map_array, GL_OES_draw_elements_base_vertex, GL_EXT_geometry_shader, GL_NV_conservative_raster, GL_EXT_draw_transform_feedback, GL_EXT_blend_minmax, GL_EXT_texture_compression_s3tc, GL_NV_EGL_stream_consumer_external, GL_NV_explicit_attrib_location, GL_EXT_tessellation_point_size
[2024.01.17 11:35:52] OpenGL: Disable on NVIDIA driver on Linux.
[2024.01.17 11:35:52] App Info: reading accounts info...
[2024.01.17 11:35:52] App Info: reading encrypted info...
[2024.01.17 11:35:52] App Info: reading map...
[2024.01.17 11:35:52] App Info: reading encrypted map...
[2024.01.17 11:35:52] App Info: reading encrypted user settings...
[2024.01.17 11:35:52] App Info: encrypted user settings read.
[2024.01.17 11:35:52] App Info: reading encrypted mtp data...
[2024.01.17 11:35:52] MTP Info: read keys, current: 4, to destroy: 0
[2024.01.17 11:35:52] Map read time: 2
[2024.01.17 11:35:52] App Info: reading encrypted mtp config...
[2024.01.17 11:35:52] Export Info: Destroy top bar by controller removal.
[2024.01.17 11:35:52] OpenGL: [FALSE] (Window)
[2024.01.17 11:35:53] Unable to get last user input time from org.freedesktop.ScreenSaver: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.113" (uid=1000 pid=3026 comm="/snap/telegram-desktop/5439/usr/bin/telegram-deskt" label="snap.telegram-desktop.telegram-desktop (enforce)") interface="org.freedesktop.ScreenSaver" member="GetSessionIdleTime" error name="(unset)" requested_reply="0" destination="org.freedesktop.ScreenSaver" (uid=1000 pid=2002 comm="/usr/libexec/gsd-screensaver-proxy" label="unconfined")
[2024.01.17 11:35:53] Notification daemon product name: gnome-shell
[2024.01.17 11:35:53] Notification daemon vendor name: GNOME
[2024.01.17 11:35:53] Notification daemon version: 45.2
[2024.01.17 11:35:53] Notification daemon specification version: 1.2
[2024.01.17 11:35:53] Notification daemon capabilities: actions, body, body-markup, icon-static, persistence, sound
[2024.01.17 11:35:54] API Warning: not loaded minimal channel applied.
[2024.01.17 11:35:54] API Warning: not loaded minimal channel applied.
kcalbxof commented 8 months ago

Just to clarify, i've set priority of render for egl (/usr/share/glvnd/egl_vendor.d/90_nvidia.json), also tried PrefersNonDefaultGPU flag. None of those work, TG seems to be ignoring it all.

ilya-fedin commented 8 months ago

Snaps have their own filesystem so whatever you have changed in /usr/share is no-op to tdesktop and tdesktop couldn't do anything about that. If you need that, you have to unsandboxed tdesktop.

ilya-fedin commented 8 months ago

I also see OpenGL: Disable on NVIDIA driver on Linux. so it's not really used

kcalbxof commented 8 months ago

I also see OpenGL: Disable on NVIDIA driver on Linux. so it's not really used

image

Is it though?

image

ilya-fedin commented 8 months ago

if you have file+line where OpenGL is used without doing the check then I'm happy to hear. Otherwise I don't believe the GPU is used.