On 05/06 03:20, Kai Krakow wrote:
> Am Sat, 6 May 2017 14:42:59 +0200
> schrieb tu...@posteo.de:
> 
> > On 05/06 02:16, Kai Krakow wrote:
> > > Am Sat, 6 May 2017 12:55:24 +0200
> > > schrieb tu...@posteo.de:
> > >   
> > > > On 05/06 12:28, Kai Krakow wrote:  
> >  [...]  
> >  [...]  
> > > >  [...]  
> > > >  [...]    
> >  [...]  
> > > >  [...]    
> >  [...]  
> > > >  [...]    
> >  [...]  
> > > >  [...]    
> >  [...]  
> > > >  [...]  
> > > >  [...]    
> >  [...]  
> >  [...]  
> >  [...]  
> >  [...]  
> > > > 
> > > > Hi,
> > > > 
> > > > ...it runs now at least for root (called as user it crashes
> > > > still).
> > > > 
> > > > I did the following:
> > > > 
> > > > 
> > > > mv /usr/lib64/libGL.so  /usr/lib64/off.libGL.so 
> > > > 
> > > > for all libGL.so* in /usr/lib64/libGL.so*  
> > > 
> > > You shouldn't shuffle those files around. They are controlled by the
> > > package manager.
> > > 
> > > I think it's a bug of the software that it overwrites ld paths.
> > > With a Gentoo standard configuration and eselect opengl switched to
> > > nvidia, every software should find and load the nvidia opengl stuff
> > > first.
> > > 
> > > Could you show the output of
> > > 
> > > # lddtree $(which FreeCAD)
> > > 
> > > E.g., lddtree $(which kwin_x11) shows a line for me:
> > > 
> > > libGL.so.1 => /usr/lib64/opengl/nvidia/lib/libGL.so.1
> > > 
> > > which clearly says it's linking libGL.so.1 from nvidia first.
> > > 
> > > If a libGL line is missing for FreeCAD, it is dynamically loaded by
> > > the application itself. Then it's a FreeCAD bug that should be
> > > fixed.
> > > 
> > > If it's loading from /usr/lib64/libGL* for you, then some paths and
> > > configs are borked in your system.
> > > 
> > >   
> > > > Addtionally I added 06nvidia to /etc/ld.so.config.d/. with this
> > > > contents:
> > > > /usr/lib64/opengl/nvidia/lib
> > > > and did a ldconfig afterwards and reboot to release any
> > > > filehandle.  
> > > 
> > > I wonder why these paths are missing for you... My ld.so.conf has
> > > nvidia paths right in the beginning (first two lines). It's
> > > actually made from /etc/env.d/000opengl. There's nothing nvidia
> > > specific in the .d directory.
> > > 
> > >   
> > > > One question remains:
> > > > It works for root but not for any other user.
> > > > I (as user) am in the video group.
> > > > 
> > > > I checked the directory/file permissions of opencascade and they
> > > > seem to be ok.  
> > > 
> > > I don't think that modern kernels and desktop managers still use the
> > > video group. It should be handled by ACLs. Please have a look at the
> > > ACLs of the device nodes.
> > > 
> > > It all depends on your login manager and pam configuration. You
> > > should check that if things don't work right. If you're using
> > > systemd, you are using systemd-logind, otherwise you're probably
> > > using consolekit.
> > > 
> > > If you're not using either of those, the system would fall back to
> > > standard unix group permissions. But I'm not sure if this works
> > > correctly if you didn't configure the whole chain to work that way.
> > > 
> > >   
> > > > I straced FreeCAD...but...I fear not to see anything suspicious
> > > > because the output contains a lot of noise (much more as normally
> > > > seen in such traces)...  
> > > 
> > > You can use call filters to limit that to what you want to see.
> > > Also, there's ltrace which could be interesting.
> > > 
> > >   
> > > > The eselects show:  
> >  [...]  
> > > > Available OpenGL implementations:
> > > >   [1]   nvidia *
> > > >   [2]   xorg-x11  
> >  [...]  
> > > > i915 (Intel 915, 945)
> > > > i965 (Intel GMA 965, G/Q3x, G/Q4x, HD)
> > > > r300 (Radeon R300-R500)
> > > > r600 (Radeon R600-R700, Evergreen, Northern Islands)
> > > > sw (Software renderer)
> > > >   [1]   classic
> > > >   [2]   gallium *
> > > > 
> > > > Why is nvidia not listed with the second command?  
> > > 
> > > Afaik, it does not provide mesa drivers. That's probably why it
> > > cannot find an "swrast" driver/visual then. Directly using nvidia
> > > OpenGL fixes that, which is what you did now.
> > > 
> > > I think the bug with FreeCAD is, that it cannot properly handle
> > > multiple opengl implementations which it tries to do itself. It
> > > should be left to the system to correctly load the correct opengl
> > > implementation.
> > > 
> > > I guess FreeCAD looks up visuals by loading libGL from /usr/lib,
> > > then it loads libGL again using means provided by the system, which
> > > ends up loading the nvidia implementation. But that does not
> > > provide swrast. I can only guess why they did that. But I could
> > > also be totally wrong.
> > > 
> > > 
> > > -- 
> > > Regards,
> > > Kai
> > > 
> > > Replies to list-only preferred.
> > >   
> > 
> > 
> > 
> > 
> > Hi Kai,
> > 
> > NO PANIC! :) the renaming of libGL and friends was for
> > testing/experimenting purposes only! :)
> > 
> > After renaming those back to normal and doing a ldconfig
> > these were back for root and user:
> > 
> >     libGL error: No matching fbConfigs or visuals found
> >     libGL error: failed to load driver: swrast
> >     *** Abort *** an exception was raised, but no catch was found.
> >         ... The exception is:SIGSEGV 'segmentation violation'
> > detected. Address 0
> > 
> > I checked for the 000opengl file in /etc/env.d on my installation and
> > it is there...so I removed my file under /etc/ld.config.d/.
> > 
> > lddtree /usr/bin/FreeCAD gives me:
> > 
> > FreeCAD => /usr/bin/FreeCAD (interpreter => /lib64/ld-linux-x86-64.so.2)
> [...snip...]
> > libGL.so.1 => /usr/lib64/libGL.so.1
> [...snap...]
> 
> So it's loading the wrong lib...
> 
> Let's find out why... Is there /etc/env/000opengl?
> 
> Did you run env-update and logged out and in again? (or rebooted)
> 
> If all yes, you should in /etc/ld.so.conf that the very first lines
> (after the comments) are for the nvidia opengl implementation.
> 
> > Next: ACL
> > 
> > What? ;)
> 
> Access control lists...
> 
> It's fine grained controls than posix access controls
> (user,group,others,owner,group-owner etc).
> 
> If you "ls -l" the dev directory, you should notice a "+" behind some
> permissions. This actually tells you that there are ACLs. The input
> devices you're using should show that:
> 
> $ ls -al /dev/input/event*
> crw-rw----+ 1 root input 13, 69  6. Mai 13:28 /dev/input/event5
> 
> $ getfacl /dev/input/event5
> getfacl: Removing leading '/' from absolute path names
> # file: dev/input/event5
> # owner: root
> # group: input
> user::rw-
> user:kakra:rw-
> group::rw-
> mask::rw-
> other::---
> 
> So you see, additionally to root:input=rwrw it also gave my user
> explicit rw permissions. This is handled by the login manager which
> gives users exact permissions to only the devices attached to that seat
> instead of generic access for everything, no matter how the user logged
> in. E.g., why would you need access to those devices if logged in by
> SSH? Even if you have local login permissions, why should those be
> valid when logged in by remote?
> 
> This problem is fixed by ACLs.
> 
> Other essential devices should show similar ACLs for you.
> 
> BTW: I'm in the video group, too. I think this is required for nvidia
> drivers. So I don't believe that is the problem for you and we are on
> the wrong path here. You should check that /dev/nvidia* belongs to the
> video group, tho. Otherwise check that NVreg_DeviceFileGID matches your
> video group id in /etc/modprobe.d/nvidia.conf.
> 
> Does glxgears work for you?
> 
> 
> > Sorry Kai...you hit the blank spot of my knowledge of Linux here.
> > Please give me some hints...
> 
> I hope I did.
> 
> 
> > To summarize:
> > I am using good 'ole openrc. Consolekit is installed.
> > My login manager is slim.
> 
> It's systemd and sddm here...
> 
> I ditched consolekit long time ago so I cannot really help you here by
> comparing with my local configuration.
> 
> 
> > ltrace:
> > I will take a look, what I may find with that one.
> > strace: It is difficult to filter unimportant things
> > as long I dont know the reason (the important thing)
> > for the problem... ;) :)
> > But I will take a deeper look...
> 
> You could enable coredumps and feed that to gdb to get a backtrace. But
> I believe you need to enable debug symbols in portage and
> recompile stuff to have debug info. Even if incomplete, it could be
> helpful to identify the offender. Maybe it can be fixed by preloading
> older .so files.
> 
> 
> -- 
> Regards,
> Kai
> 
> Replies to list-only preferred.
> 
> 

Hi Kai,

It's there
-rw-r--r-- 1 root root 141 May  6 10:37 /etc/env.d/000opengl

and its contents is:
# Configuration file for eselect
# This file has been automatically generated.
LDPATH="/usr/lib64/opengl/nvidia/lib"
OPENGL_PROFILE="nvidia"

Contents of ld.so.conf:

# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/usr/lib64/opengl/nvidia/lib
/lib64
/usr/lib64
/usr/local/lib64
/lib
/usr/lib
/usr/local/lib
include ld.so.conf.d/*.conf
/usr/lib64/OpenCL/vendors/nvidia
/usr/lib/llvm/4/lib64
/usr/lib64/itcl4.0.3/
/usr/lib64/itk4.0.1/
/usr/lib64/qt4
/opt/nvidia-cg-toolkit/lib64
/usr/games/lib64
/usr/games/lib
/opt/cuda/lib64
/opt/cuda/lib
/opt/cuda/nvvm/lib64
/usr/lib64/fltk
/usr/lib64/libgig/



No, no ACLs here:

ls -l /dev/input/*   (excerpt)

crw-rw---- 1 root input 13, 64 May  6 12:11 /dev/input/event0
crw-rw---- 1 root input 13, 65 May  6 12:11 /dev/input/event1


crw-rw---- 1 root video 195,   0 May  6 12:11 /dev/nvidia0
crw-rw---- 1 root video 195,   1 May  6 12:11 /dev/nvidia1
crw-rw---- 1 root video 195, 255 May  6 12:11 /dev/nvidiactl
crw-rw-rw- 1 root root  195, 254 May  6 12:11 /dev/nvidia-modeset
crw-rw-rw- 1 root root  246,   0 May  6 12:20 /dev/nvidia-uvm
crw-rw-rw- 1 root root  246,   1 May  6 12:20 /dev/nvidia-uvm-tools


I have two nvidia-cards in my PC. One (the slower,older) is for
everytyhing except rendering, the newer and faster one is for
rendering except anything else.

The above shows both permissions:
root:root and root:portage...


Video-group settings are ok it seems:
NVreg_DeviceFileGID=27

27(video)

(as user)
glxgears -info:
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER   = GeForce GT 430/PCIe/SSE2          <<<===== this is the older, 
slower graphics card!
GL_VERSION    = 4.5.0 NVIDIA 381.09
GL_VENDOR     = NVIDIA Corporation
GL_EXTENSIONS = GL_AMD_multi_draw_indirect 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_compatibility 
GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth 
GL_ARB_compute_shader GL_ARB_compute_variable_group_size 
GL_ARB_conditional_render_inverted 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_depth_texture GL_ARB_derivative_control 
GL_ARB_direct_state_access GL_ARB_draw_buffers GL_ARB_draw_buffers_blend 
GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced 
GL_ARB_enhanced_layouts GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility 
GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility 
GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location 
GL_ARB_fragment_coord_conventions GL_ARB_fragment_layer_viewport 
GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader 
GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object 
GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary 
GL_ARB_get_texture_sub_image GL_ARB_gl_spirv GL_ARB_gpu_shader5 
GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64 GL_ARB_half_float_pixel 
GL_ARB_half_float_vertex GL_ARB_imaging 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_multisample GL_ARB_multitexture 
GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_parallel_shader_compile 
GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object 
GL_ARB_point_parameters 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_separate_shader_objects 
GL_ARB_shader_atomic_counter_ops GL_ARB_shader_atomic_counters 
GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters 
GL_ARB_shader_group_vote GL_ARB_shader_image_load_store 
GL_ARB_shader_image_size GL_ARB_shader_objects GL_ARB_shader_precision 
GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine 
GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod 
GL_ARB_shading_language_100 GL_ARB_shading_language_420pack 
GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow 
GL_ARB_sparse_buffer GL_ARB_sparse_texture GL_ARB_stencil_texturing GL_ARB_sync 
GL_ARB_tessellation_shader GL_ARB_texture_barrier GL_ARB_texture_border_clamp 
GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 
GL_ARB_texture_buffer_range GL_ARB_texture_compression 
GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc 
GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add 
GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 
GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge 
GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample 
GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels 
GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg 
GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8 GL_ARB_texture_storage 
GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_texture_view 
GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 
GL_ARB_transform_feedback_instanced GL_ARB_transform_feedback_overflow_query 
GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra 
GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit 
GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program 
GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev 
GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos 
GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc 
GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform 
GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate 
GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array 
GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access 
GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements 
GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample 
GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_multisample_blit_scaled 
GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 
GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays 
GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels 
GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset_clamp 
GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color 
GL_EXT_separate_shader_objects GL_EXT_separate_specular_color 
GL_EXT_shader_image_load_store GL_EXT_shader_integer_mix GL_EXT_shadow_funcs 
GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D 
GL_EXT_texture_array GL_EXT_texture_buffer_object 
GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc 
GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc 
GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine 
GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic 
GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias 
GL_EXT_texture_mirror_clamp GL_EXT_texture_object 
GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode 
GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query 
GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra 
GL_EXT_vertex_attrib_64bit GL_EXT_window_rectangles GL_EXT_x11_sync_object 
GL_EXT_import_sync_object GL_NV_robustness_video_memory_purge 
GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat 
GL_KHR_context_flush_control GL_KHR_debug GL_KHR_no_error 
GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_KTX_buffer_region 
GL_NV_alpha_to_coverage_dither_control GL_NV_bindless_multi_draw_indirect 
GL_NV_bindless_multi_draw_indirect_count GL_NV_blend_equation_advanced 
GL_NV_blend_square GL_NV_command_list GL_NV_compute_program5 
GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image 
GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_draw_texture 
GL_NV_ES1_1_compatibility GL_NV_ES3_1_compatibility GL_NV_explicit_multisample 
GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program 
GL_NV_fragment_program_option GL_NV_fragment_program2 
GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 
GL_NV_gpu_program4 GL_NV_internalformat_sample_query GL_NV_gpu_program4_1 
GL_NV_gpu_program5 GL_NV_gpu_program5_mem_extended GL_NV_gpu_program_fp64 
GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent 
GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query 
GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object 
GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range 
GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners 
GL_NV_register_combiners2 GL_NV_shader_atomic_counters 
GL_NV_shader_atomic_float GL_NV_shader_buffer_load 
GL_NV_shader_storage_buffer_object GL_NV_texgen_reflection 
GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 
GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader 
GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback 
GL_NV_transform_feedback2 GL_NV_uniform_buffer_unified_memory 
GL_NV_vdpau_interop GL_NV_vertex_array_range GL_NV_vertex_array_range2 
GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory 
GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 
GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render 
GL_NVX_gpu_memory_info GL_NV_shader_threaXIO:  fatal IO error 11 (Resource 
temporarily unavailable) on X server ":0.0"
      after 52 requests (52 known processed) with 0 events remaining.
d_group GL_KHR_blend_equation_advanced GL_SGIS_generate_mipmap 
GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum 
VisualID 39, 0x27


The framerate is bound to the refreshrate of my monitor (60Hz) but
mains is 50Hz)....


Cheers
Meino




Reply via email to