Closed freebsd-nils-level1 closed 7 years ago
Dear Nils,
I take it this is with the standard ports tree (i.e., Mesa 13)? If so, please try https://reviews.freebsd.org/D9469 which works for me. That being said, 3D is still buggy on amdgpu KMS (it'll leak memory).
Thanks!
I take it this is with the standard ports tree (i.e., Mesa 13)?
that's correct - standard ports tree rev. 437356 - Mesa 13.0.6
If so, please try https://reviews.freebsd.org/D9469 which works for me.
unfortunately, this patch doesn't apply cleanly to the current ports tree:
Hunk #1 failed at 18.
Hunk #3 failed at 75.
Hunk #4 failed at 141.
3 out of 4 hunks failed while patching graphics/libGL/Makefile.common
Probably caused by ports commit that updated Mesa to 13.0.6
r437215 | rezny | 2017-03-29 18:57:53 +0200 (Wed, 29 Mar 2017)
do you have an updated version available? Or should I downgrade my ports tree?
That being said, 3D is still buggy on amdgpu KMS (it'll leak memory).
just for fun, I've modified "src/loader/loader.c" of the libGL 13.0.6 source code so, that he returns "radeonsi" as the driver name - hardcoded. Now "glxinfo" gives me:
name of display: :0
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver radeonsi for 4
libGL: OpenDriver: trying /usr/local/lib/dri/radeonsi_dri.so
MESA-LOADER: failed to retrieve device information
loader_get_driver_for_fd entered
MESA-LOADER: failed to retrieve device information
amdgpu: drmGetDevice failed.
do_winsys_init: DRM version is 3.8.0 but this driver is only compatible with 2.12.0 (kernel 3.2) or later.
<jemalloc>: /usr/src/contrib/jemalloc/include/jemalloc/internal/arena.h:1396: Failed assertion: "arena_mapbits_allocated_get(chunk, pageind) != 0"
Abort
I would imagine that "libdrm" is still the culprit - first wrong PCI ids (original version 2.4.75), then returning a wrong driver name (version 2.4.76 patched) and now failing at "drmGetDevice".
But I'll happily like to test Mesa 17.0.x...
True, sorry for that. I'll update that patch one of these days.
Nevertheless, your observations are very interesting. I haven't tried loading 3D (b/c of the the aforementioned issues) lately, so I wonder if it broke. I'll check and update this issue in a few days.
I played around a little more. I've reverted to "libdrm-2.4.75" with "libdevq" dependency. Then I patched "libdevq" so that "devq_compare_vgapci_busaddr" always returns successfully (zero means no error, I believe):
#diff -u devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c.orig devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c
--- devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c.orig 2016-07-28 12:50:48.000000000 +0200
+++ devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c 2017-04-04 17:18:24.083966000 +0200
@@ -198,7 +198,7 @@
int ret;
char sysctl_name[32], sysctl_value[128];
size_t sysctl_value_len;
-
+ return(0);
sprintf(sysctl_name, "dev.vgapci.%d.%%location", i);
sysctl_value_len = sizeof(sysctl_value);
now "glxinfo" looks fine:
#env LIBGL_DEBUG=verbose glxinfo | head -100
libGL: OpenDriver: trying /usr/local/lib/dri/radeonsi_dri.so
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL: Using DRI2 for screen 0
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float,
GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context,
GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD POLARIS11 (DRM 3.8.0 / 12.0-CURRENT, LLVM 4.0.0) (0x67ef)
Version: 17.0.3
Accelerated: yes
Video memory: 2003MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD POLARIS11 (DRM 3.8.0 / 12.0-CURRENT, LLVM 4.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
GL_AMD_conservative_depth, GL_AMD_draw_buffers_blend,
GL_AMD_performance_monitor, GL_AMD_pinned_memory,
GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_stencil_export,
GL_AMD_shader_trinary_minmax, GL_AMD_vertex_shader_layer,
GL_AMD_vertex_shader_viewport_index, GL_ARB_ES2_compatibility,
GL_ARB_ES3_1_compatibility, GL_ARB_ES3_2_compatibility,
GL_ARB_ES3_compatibility, GL_ARB_arrays_of_arrays, GL_ARB_base_instance,
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_compute_shader, GL_ARB_compute_variable_group_size,
GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
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_derivative_control, GL_ARB_direct_state_access,
GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend,
GL_ARB_draw_elements_base_vertex, GL_ARB_draw_indirect,
GL_ARB_draw_instanced, GL_ARB_enhanced_layouts,
GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location,
GL_ARB_fragment_coord_conventions, GL_ARB_fragment_layer_viewport,
GL_ARB_fragment_shader, GL_ARB_framebuffer_no_attachments,
GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB,
GL_ARB_get_program_binary, GL_ARB_get_texture_sub_image,
GL_ARB_gpu_shader5, GL_ARB_gpu_shader_fp64, GL_ARB_half_float_pixel,
GL_ARB_half_float_vertex, 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_occlusion_query2,
GL_ARB_pipeline_statistics_query, GL_ARB_pixel_buffer_object,
GL_ARB_point_sprite, 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,
KDE4 flickers like hell (compositor is active), but "tesseract-game" runs very well...
Interesting, the screen corruption issues were all solved for me. Could you let us know if disabling glamor/glx/acceleration in xorg.conf makes KDE smooth?
Also, do you observe in 3D mode a memory leak (swap will be exhausted eventually, causing reset)?
Interesting, the screen corruption issues were all solved for me.
How have you done that?
Could you let us know if disabling glamor/glx/acceleration in xorg.conf makes KDE smooth?
I've tried "AccelMethod=none"; and Xorg crashes with signal 6 as soon KDE starts its compositor. What different "xorg.conf" settings should I try?
Also, do you observe in 3D mode a memory leak (swap will be exhausted eventually, causing reset)?
I've got 32GB of RAM - so swap is disabled; but I see that wired memory is growing and growing:
Mem: 1314M Active, 705M Inact, 23M Laundry, 8486M Wired, 21G Free
ARC: 1698M Total, 172M MFU, 482M MRU, 32K Anon, 22M Header, 1023M Other
Swap:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
20603 nbe 73 20 0 1893M 407M select 14 0:21 0.05% firefox
19954 nbe 54 20 0 384M 275M select 8 0:15 0.01% mysqld
20879 nbe 5 20 0 676M 148M select 8 0:02 0.01% soffice.bin
20570 nbe 2 22 0 549M 136M CPU8 8 0:11 4.42% kdeinit4
20511 nbe 4 20 0 857M 125M select 9 0:04 0.13% kdeinit4
20427 root 6 20 0 320M 123M select 5 0:09 0.31% Xorg
20684 nbe 4 20 0 1679M 107M select 10 0:03 0.00% kmail
20595 nbe 1 20 0 630M 98M select 5 0:00 0.00% knode
20554 nbe 2 20 0 746M 98064K select 10 0:02 0.01% kdeinit4
20496 nbe 5 20 0 690M 85600K select 9 0:02 0.03% kdeinit4
20535 nbe 1 20 0 583M 84636K select 7 0:01 0.00% akonadi_mailfilter_
20509 nbe 3 20 0 622M 84388K select 2 0:03 0.10% kwin
20523 nbe 1 20 0 583M 83952K select 1 0:01 0.00% akonadi_archivemail
20539 nbe 1 20 0 562M 79944K select 15 0:01 0.00% akonadi_sendlater_a
20568 nbe 2 20 0 553M 78588K select 8 0:01 0.02% kdeinit4
20538 nbe 1 20 0 505M 75076K select 5 0:01 0.00% akonadi_notes_agent
20517 nbe 36 20 0 340M 73992K select 4 0:01 0.00% akonadiserver
20501 nbe 1 20 0 463M 68372K select 8 0:00 0.00% kdeinit4
20508 nbe 2 20 0 469M 67920K select 9 0:00 0.00% kdeinit4
20572 nbe 1 20 0 449M 65196K select 12 0:00 0.00% kalarm
20652 nbe 1 20 0 384M 64064K select 14 0:01 0.00% krdc
20494 nbe 1 20 0 362M 62520K select 0 0:00 0.00% kdeinit4
20493 nbe 1 20 0 355M 61028K select 8 0:00 0.00% kdeinit4
20537 nbe 1 20 0 401M 55656K select 11 0:01 0.00% akonadi_newmailnoti
20534 nbe 1 20 0 357M 50584K select 4 0:01 0.00% akonadi_maildispatc
20529 nbe 1 20 0 352M 50228K select 15 0:01 0.00% akonadi_imap_resour
20528 nbe 1 20 0 350M 49940K select 10 0:01 0.00% akonadi_imap_resour
20524 nbe 1 39 19 360M 49524K select 12 0:01 0.00% akonadi_baloo_index
20880 nbe 1 20 0 343M 49468K select 1 0:00 0.00% knotify4
20506 nbe 6 20 0 353M 46636K select 14 0:00 0.00% kactivitymanagerd
20530 nbe 3 20 0 293M 46060K select 1 0:00 0.00% akonadi_agent_launc
20532 nbe 3 20 0 293M 46056K select 12 0:00 0.00% akonadi_agent_launc
20531 nbe 3 20 0 293M 46056K select 15 0:00 0.00% akonadi_agent_launc
20525 nbe 1 20 0 346M 45892K select 13 0:01 0.00% akonadi_birthdays_r
20526 nbe 1 20 0 341M 45444K select 7 0:01 0.00% akonadi_followuprem
20536 nbe 1 20 0 334M 44792K select 14 0:01 0.00% akonadi_migration_a
20516 nbe 2 39 19 339M 43796K select 10 0:00 0.00% baloo_file
20527 nbe 3 20 0 266M 43784K select 4 0:00 0.00% akonadi_agent_launc
20864 nbe 3 20 0 337M 43444K select 7 0:00 0.00% polkit-kde-authenti
20522 nbe 3 20 0 270M 43176K select 5 0:00 0.00% akonadi_agent_launc
20533 nbe 3 20 0 270M 43148K select 8 0:00 0.00% akonadi_agent_launc
628 unbound 1 20 0 39384K 20616K select 15 0:02 0.00% unbound
I have
Section "Module" Disable "glx" Disable "glamoregl" EndSection
and
Option "NoAccel" "True"
that being said, I have no experience w/ KDE and whether it requires GLX to run (looks like that from what you report).
The corruptions were fixed for me with recent updates to the linuxkpi.
Memory leak seems to be present then, unfortunately expected. We are trying to get the current state into CURRENT/ports ATM, I believe after that @markjdb may have another look into the leak.
What issue tracks memory leaks? I've seen those on i915kms as well but only with DRI3 enabled.
None. i915 is news to me, so please open an issue.
This particular issue seems fixed.
Hi,
playing around with "drm-next" and the "amdgpu" kernel module; it loads and runs after several tries:
3D support is my next test - unfortunately, with the original "libdrm" and "libdevq"-combo, it doesn't detect the PCI busses correctly:
So I've tried the not-yet-committed patch to "libdrm" as shown here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217886
Now it wants to load "amdgpu_dri.so":
A little search for "amdgpu_dri.so" seems to reveal that this is the closed-source AMDGPU-Pro driver from AMD itself. Checking the sysctl:
Is that intended that it wants the closed-source variant of the mesa driver or is there a mapping missing somewhere in the loader logic?
TIA and regards, Nils