Gentoo Archives: gentoo-user

From: tuxic@××××××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: FreeCAD permission problems
Date: Sat, 06 May 2017 14:23:33
Message-Id: 20170506142319.reu7qgnk2pd66gwm@solfire
In Reply to: [gentoo-user] Re: FreeCAD permission problems by Kai Krakow
1 On 05/06 03:20, Kai Krakow wrote:
2 > Am Sat, 6 May 2017 14:42:59 +0200
3 > schrieb tuxic@××××××.de:
4 >
5 > > On 05/06 02:16, Kai Krakow wrote:
6 > > > Am Sat, 6 May 2017 12:55:24 +0200
7 > > > schrieb tuxic@××××××.de:
8 > > >
9 > > > > On 05/06 12:28, Kai Krakow wrote:
10 > > [...]
11 > > [...]
12 > > > > [...]
13 > > > > [...]
14 > > [...]
15 > > > > [...]
16 > > [...]
17 > > > > [...]
18 > > [...]
19 > > > > [...]
20 > > [...]
21 > > > > [...]
22 > > > > [...]
23 > > [...]
24 > > [...]
25 > > [...]
26 > > [...]
27 > > > >
28 > > > > Hi,
29 > > > >
30 > > > > ...it runs now at least for root (called as user it crashes
31 > > > > still).
32 > > > >
33 > > > > I did the following:
34 > > > >
35 > > > >
36 > > > > mv /usr/lib64/libGL.so /usr/lib64/off.libGL.so
37 > > > >
38 > > > > for all libGL.so* in /usr/lib64/libGL.so*
39 > > >
40 > > > You shouldn't shuffle those files around. They are controlled by the
41 > > > package manager.
42 > > >
43 > > > I think it's a bug of the software that it overwrites ld paths.
44 > > > With a Gentoo standard configuration and eselect opengl switched to
45 > > > nvidia, every software should find and load the nvidia opengl stuff
46 > > > first.
47 > > >
48 > > > Could you show the output of
49 > > >
50 > > > # lddtree $(which FreeCAD)
51 > > >
52 > > > E.g., lddtree $(which kwin_x11) shows a line for me:
53 > > >
54 > > > libGL.so.1 => /usr/lib64/opengl/nvidia/lib/libGL.so.1
55 > > >
56 > > > which clearly says it's linking libGL.so.1 from nvidia first.
57 > > >
58 > > > If a libGL line is missing for FreeCAD, it is dynamically loaded by
59 > > > the application itself. Then it's a FreeCAD bug that should be
60 > > > fixed.
61 > > >
62 > > > If it's loading from /usr/lib64/libGL* for you, then some paths and
63 > > > configs are borked in your system.
64 > > >
65 > > >
66 > > > > Addtionally I added 06nvidia to /etc/ld.so.config.d/. with this
67 > > > > contents:
68 > > > > /usr/lib64/opengl/nvidia/lib
69 > > > > and did a ldconfig afterwards and reboot to release any
70 > > > > filehandle.
71 > > >
72 > > > I wonder why these paths are missing for you... My ld.so.conf has
73 > > > nvidia paths right in the beginning (first two lines). It's
74 > > > actually made from /etc/env.d/000opengl. There's nothing nvidia
75 > > > specific in the .d directory.
76 > > >
77 > > >
78 > > > > One question remains:
79 > > > > It works for root but not for any other user.
80 > > > > I (as user) am in the video group.
81 > > > >
82 > > > > I checked the directory/file permissions of opencascade and they
83 > > > > seem to be ok.
84 > > >
85 > > > I don't think that modern kernels and desktop managers still use the
86 > > > video group. It should be handled by ACLs. Please have a look at the
87 > > > ACLs of the device nodes.
88 > > >
89 > > > It all depends on your login manager and pam configuration. You
90 > > > should check that if things don't work right. If you're using
91 > > > systemd, you are using systemd-logind, otherwise you're probably
92 > > > using consolekit.
93 > > >
94 > > > If you're not using either of those, the system would fall back to
95 > > > standard unix group permissions. But I'm not sure if this works
96 > > > correctly if you didn't configure the whole chain to work that way.
97 > > >
98 > > >
99 > > > > I straced FreeCAD...but...I fear not to see anything suspicious
100 > > > > because the output contains a lot of noise (much more as normally
101 > > > > seen in such traces)...
102 > > >
103 > > > You can use call filters to limit that to what you want to see.
104 > > > Also, there's ltrace which could be interesting.
105 > > >
106 > > >
107 > > > > The eselects show:
108 > > [...]
109 > > > > Available OpenGL implementations:
110 > > > > [1] nvidia *
111 > > > > [2] xorg-x11
112 > > [...]
113 > > > > i915 (Intel 915, 945)
114 > > > > i965 (Intel GMA 965, G/Q3x, G/Q4x, HD)
115 > > > > r300 (Radeon R300-R500)
116 > > > > r600 (Radeon R600-R700, Evergreen, Northern Islands)
117 > > > > sw (Software renderer)
118 > > > > [1] classic
119 > > > > [2] gallium *
120 > > > >
121 > > > > Why is nvidia not listed with the second command?
122 > > >
123 > > > Afaik, it does not provide mesa drivers. That's probably why it
124 > > > cannot find an "swrast" driver/visual then. Directly using nvidia
125 > > > OpenGL fixes that, which is what you did now.
126 > > >
127 > > > I think the bug with FreeCAD is, that it cannot properly handle
128 > > > multiple opengl implementations which it tries to do itself. It
129 > > > should be left to the system to correctly load the correct opengl
130 > > > implementation.
131 > > >
132 > > > I guess FreeCAD looks up visuals by loading libGL from /usr/lib,
133 > > > then it loads libGL again using means provided by the system, which
134 > > > ends up loading the nvidia implementation. But that does not
135 > > > provide swrast. I can only guess why they did that. But I could
136 > > > also be totally wrong.
137 > > >
138 > > >
139 > > > --
140 > > > Regards,
141 > > > Kai
142 > > >
143 > > > Replies to list-only preferred.
144 > > >
145 > >
146 > >
147 > >
148 > >
149 > > Hi Kai,
150 > >
151 > > NO PANIC! :) the renaming of libGL and friends was for
152 > > testing/experimenting purposes only! :)
153 > >
154 > > After renaming those back to normal and doing a ldconfig
155 > > these were back for root and user:
156 > >
157 > > libGL error: No matching fbConfigs or visuals found
158 > > libGL error: failed to load driver: swrast
159 > > *** Abort *** an exception was raised, but no catch was found.
160 > > ... The exception is:SIGSEGV 'segmentation violation'
161 > > detected. Address 0
162 > >
163 > > I checked for the 000opengl file in /etc/env.d on my installation and
164 > > it is there...so I removed my file under /etc/ld.config.d/.
165 > >
166 > > lddtree /usr/bin/FreeCAD gives me:
167 > >
168 > > FreeCAD => /usr/bin/FreeCAD (interpreter => /lib64/ld-linux-x86-64.so.2)
169 > [...snip...]
170 > > libGL.so.1 => /usr/lib64/libGL.so.1
171 > [...snap...]
172 >
173 > So it's loading the wrong lib...
174 >
175 > Let's find out why... Is there /etc/env/000opengl?
176 >
177 > Did you run env-update and logged out and in again? (or rebooted)
178 >
179 > If all yes, you should in /etc/ld.so.conf that the very first lines
180 > (after the comments) are for the nvidia opengl implementation.
181 >
182 > > Next: ACL
183 > >
184 > > What? ;)
185 >
186 > Access control lists...
187 >
188 > It's fine grained controls than posix access controls
189 > (user,group,others,owner,group-owner etc).
190 >
191 > If you "ls -l" the dev directory, you should notice a "+" behind some
192 > permissions. This actually tells you that there are ACLs. The input
193 > devices you're using should show that:
194 >
195 > $ ls -al /dev/input/event*
196 > crw-rw----+ 1 root input 13, 69 6. Mai 13:28 /dev/input/event5
197 >
198 > $ getfacl /dev/input/event5
199 > getfacl: Removing leading '/' from absolute path names
200 > # file: dev/input/event5
201 > # owner: root
202 > # group: input
203 > user::rw-
204 > user:kakra:rw-
205 > group::rw-
206 > mask::rw-
207 > other::---
208 >
209 > So you see, additionally to root:input=rwrw it also gave my user
210 > explicit rw permissions. This is handled by the login manager which
211 > gives users exact permissions to only the devices attached to that seat
212 > instead of generic access for everything, no matter how the user logged
213 > in. E.g., why would you need access to those devices if logged in by
214 > SSH? Even if you have local login permissions, why should those be
215 > valid when logged in by remote?
216 >
217 > This problem is fixed by ACLs.
218 >
219 > Other essential devices should show similar ACLs for you.
220 >
221 > BTW: I'm in the video group, too. I think this is required for nvidia
222 > drivers. So I don't believe that is the problem for you and we are on
223 > the wrong path here. You should check that /dev/nvidia* belongs to the
224 > video group, tho. Otherwise check that NVreg_DeviceFileGID matches your
225 > video group id in /etc/modprobe.d/nvidia.conf.
226 >
227 > Does glxgears work for you?
228 >
229 >
230 > > Sorry Kai...you hit the blank spot of my knowledge of Linux here.
231 > > Please give me some hints...
232 >
233 > I hope I did.
234 >
235 >
236 > > To summarize:
237 > > I am using good 'ole openrc. Consolekit is installed.
238 > > My login manager is slim.
239 >
240 > It's systemd and sddm here...
241 >
242 > I ditched consolekit long time ago so I cannot really help you here by
243 > comparing with my local configuration.
244 >
245 >
246 > > ltrace:
247 > > I will take a look, what I may find with that one.
248 > > strace: It is difficult to filter unimportant things
249 > > as long I dont know the reason (the important thing)
250 > > for the problem... ;) :)
251 > > But I will take a deeper look...
252 >
253 > You could enable coredumps and feed that to gdb to get a backtrace. But
254 > I believe you need to enable debug symbols in portage and
255 > recompile stuff to have debug info. Even if incomplete, it could be
256 > helpful to identify the offender. Maybe it can be fixed by preloading
257 > older .so files.
258 >
259 >
260 > --
261 > Regards,
262 > Kai
263 >
264 > Replies to list-only preferred.
265 >
266 >
267
268 Hi Kai,
269
270 It's there
271 -rw-r--r-- 1 root root 141 May 6 10:37 /etc/env.d/000opengl
272
273 and its contents is:
274 # Configuration file for eselect
275 # This file has been automatically generated.
276 LDPATH="/usr/lib64/opengl/nvidia/lib"
277 OPENGL_PROFILE="nvidia"
278
279 Contents of ld.so.conf:
280
281 # ld.so.conf autogenerated by env-update; make all changes to
282 # contents of /etc/env.d directory
283 /usr/lib64/opengl/nvidia/lib
284 /lib64
285 /usr/lib64
286 /usr/local/lib64
287 /lib
288 /usr/lib
289 /usr/local/lib
290 include ld.so.conf.d/*.conf
291 /usr/lib64/OpenCL/vendors/nvidia
292 /usr/lib/llvm/4/lib64
293 /usr/lib64/itcl4.0.3/
294 /usr/lib64/itk4.0.1/
295 /usr/lib64/qt4
296 /opt/nvidia-cg-toolkit/lib64
297 /usr/games/lib64
298 /usr/games/lib
299 /opt/cuda/lib64
300 /opt/cuda/lib
301 /opt/cuda/nvvm/lib64
302 /usr/lib64/fltk
303 /usr/lib64/libgig/
304
305
306
307 No, no ACLs here:
308
309 ls -l /dev/input/* (excerpt)
310
311 crw-rw---- 1 root input 13, 64 May 6 12:11 /dev/input/event0
312 crw-rw---- 1 root input 13, 65 May 6 12:11 /dev/input/event1
313
314
315 crw-rw---- 1 root video 195, 0 May 6 12:11 /dev/nvidia0
316 crw-rw---- 1 root video 195, 1 May 6 12:11 /dev/nvidia1
317 crw-rw---- 1 root video 195, 255 May 6 12:11 /dev/nvidiactl
318 crw-rw-rw- 1 root root 195, 254 May 6 12:11 /dev/nvidia-modeset
319 crw-rw-rw- 1 root root 246, 0 May 6 12:20 /dev/nvidia-uvm
320 crw-rw-rw- 1 root root 246, 1 May 6 12:20 /dev/nvidia-uvm-tools
321
322
323 I have two nvidia-cards in my PC. One (the slower,older) is for
324 everytyhing except rendering, the newer and faster one is for
325 rendering except anything else.
326
327 The above shows both permissions:
328 root:root and root:portage...
329
330
331 Video-group settings are ok it seems:
332 NVreg_DeviceFileGID=27
333
334 27(video)
335
336 (as user)
337 glxgears -info:
338 Running synchronized to the vertical refresh. The framerate should be
339 approximately the same as the monitor refresh rate.
340 GL_RENDERER = GeForce GT 430/PCIe/SSE2 <<<===== this is the older, slower graphics card!
341 GL_VERSION = 4.5.0 NVIDIA 381.09
342 GL_VENDOR = NVIDIA Corporation
343 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"
344 after 52 requests (52 known processed) with 0 events remaining.
345 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
346 VisualID 39, 0x27
347
348
349 The framerate is bound to the refreshrate of my monitor (60Hz) but
350 mains is 50Hz)....
351
352
353 Cheers
354 Meino

Replies

Subject Author
[gentoo-user] Re: FreeCAD permission problems Kai Krakow <hurikhan77@×××××.com>