PCBnew OpenGL 2.1 or higher is required
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Released
|
High
|
Unassigned |
Bug Description
I've been using Kicad 4.07 for a while now, and with the release of 5.0.0-rc3, I wanted to try it out. Unfortunately, I just haven't been able to get PCBnew to work with the OpenGL canvas on my desktop. Unfortunately, I'm just not sure what may be causing the issue, but I'll provide all the relevant information that I can.
Version Information:
Application: kicad
Version: (5.0.0-
Libraries:
wxWidgets 3.0.4
libcurl/7.60.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.14.52-1-MANJARO x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.60.0
Compiler: GCC 8.1.1 with C++ ABI 1012
Build settings:
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
glxinfo | grep OpenGL:
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 5800 Series
OpenGL core profile version string: 4.5.13399 Core Profile Context 15.201.1151
OpenGL core profile shading language version string: 4.40
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.13399 Compatibility Profile Context 15.201.1151
OpenGL shading language version string: 4.40
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
Thomas Pointhuber (pointhi) wrote : | #1 |
Maciej Suminski (orsonmmz) wrote : | #2 |
Have you also updated the video drivers at the same time? Could you check if other OpenGL applications work correctly (e.g. glxgears)?
Changed in kicad: | |
status: | New → Incomplete |
Alex (knapik1227) wrote : | #3 |
My video drivers would have been the latest proprietary ones as the free ones don't work well with my computer and I had just recently reinstalled my operating system. I tried out glxgears and it worked just fine.
Stefan Krueger (z-mail-i) wrote : | #4 |
- Pcbnew with 3D Viewer Edit (155.8 KiB, image/png)
i have same / similar behavior:
if i try to switch to 'Modern Toolset (Accelerated)' i get the 'OpenGL 2.1 or higher is required!' message.
Additionally the 3D Viewer does not show anything (attached screenshot)
on my search i cam across this forum thread that seem to be related:
V5.0.0-rc2 OpenGL not detected, Ubuntu 18.04 https:/
the orig. poster has found that this is coursed by the nvidia-340 driver.
(that is the one i currently also use...)
i quickly tested `glxgears` and it works fine.
(blender also has a openGL user interface and runs fine)
but the kicad-ogltest fails:
stefan@
(kicad-
(kicad-
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
*** Caught unhandled unknown exception; terminating
i will try and switch to the Nouveau driver to test if it works for my system.
(in the past i had problems with this driver.. but eventually things have changed)
pleas let me know if i can give some more information or if i should open a separate bug for this.
my environment is
Application: kicad
Version: 5.0.0-fee4fd1~
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-29-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.3.0 with C++ ABI 1011
Build settings:
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
stefan@
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVS 3100M/PCIe/SSE2
OpenGL core profile version string: 3.3.0 NVIDIA 340.106
OpenGL core profile shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.3.0 NVIDIA 340.106
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL context flags: (none)
OpenGL profile mask: (...
Maciej Suminski (orsonmmz) wrote : | #5 |
Can you try running pcbnew with LIBGL_DEBUG=verbose environmental variable set? Run from a terminal command line and post the results here:
$ LIBGL_DEBUG=verbose pcbnew
Alex (knapik1227) wrote : | #6 |
I just ran it and these are the results. Seems like something to do with swrast?:
LIBGL_DEBUG=verbose pcbnew
19:44:51: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,
and your program used 3.0 (wchar_t,compiler with C++ ABI 1012,wx containers,
19:44:51: Debug: Adding locale lookup path: /usr/share/
19:44:51: Debug: Checking template path '/usr/local/
19:44:51: Debug: Checking template path '/usr/share/
(pcbnew:21048): Gtk-CRITICAL **: 19:44:53.409: IA__gtk_
(pcbnew:21048): Gtk-CRITICAL **: 19:44:53.478: IA__gtk_
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/
libGL: OpenDriver: trying /usr/lib/
libGL: dlopen /usr/lib/
libGL: OpenDriver: trying /usr/lib32/
libGL: OpenDriver: trying /usr/lib32/
libGL: dlopen /usr/lib32/
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Maciej Suminski (orsonmmz) wrote : | #7 |
Yes, for some reason your system insists on using the software renderer and it fails. Could you try to run the same LIBGL_DEBUG test with glxgears and post the output here?
Alex (knapik1227) wrote : | #8 |
Sure, here's the output:
LIBGL_DEBUG=verbose glxgears
libGL: AtiGetClientDri
libGL: OpenDriver: trying /usr/lib/
ukiDynamicMajor: found major device number 244
ukiDynamicMajor: found major device number 244
ukiDynamicMajor: found major device number 244
ukiOpenDevice: node name is /dev/ati/card0
ukiOpenDevice: open result is 4, (OK)
ukiGetBusid returned 'PCI:1:0:0'
ukiOpenDevice: node name is /dev/ati/card1
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card2
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card3
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card4
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card5
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card6
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card7
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card8
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card9
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card10
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card11
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card12
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card13
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card14
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card15
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiDynamicMajor: found major device number 244
ukiOpenByBusid: Searching for BusID PCI:1:0:0
ukiOpenDevice: node name is /dev/ati/card0
ukiOpenDevice: open result is 4, (OK)
ukiOpenByBusid: ukiOpenMinor returns 4
ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0
ukiDynamicMajor: found major device number 244
ukiDynamicMajor: found major device number 244
ukiOpenByBusid: Searching for BusID PCI:1:0:0
ukiOpenDevice: node name is /dev/ati/card0
ukiOpenDevice: open result is 5, (OK)
ukiOpenByBusid: ukiOpenMinor returns 5
ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0
ukiDynamicMajor: found major device number 244
ukiDynamicMajor: found major device number 244
ukiDynamicMajor: found major device number 244
ukiOpenDevice: node name is /dev/ati/card0
ukiOpenDevice: open result is 8, (OK)
ukiGetBusid returned 'PCI:1:0:0'
ukiOpenDevice: node name is /dev/ati/card1
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card2
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card3
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card4
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card5
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card6
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card7
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card8
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card9
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card10
ukiOpenDevice: UKI_ERR_NOT_ROOT
ukiOpenDevice: node name is /dev/ati/card11
ukiOpenDevice: UKI_ERR...
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #9 |
Hi! I'm also using KiCad for a couple of years now for various hobby projects, and I like it a lot. I've only tested the promising OpenGL based layout mode a couple of times, but I'm looking forward to try it out in the new version soon...
Unfortunately, I ran into very similar issues like described above on my Arch Linux box (Manjaro), using an older Nvidia GeForce GTX 260 card, after upgrading to KiCad 5.0.0 recently.
There's a "OpenGL 2.1 or higher is required!" pop-up showing up when I try to switch to the "Modern Toolset" in pcbnew, and the 3D preview doesn't work anymore (also with the Legacy Toolset selected).
Here some infos on my setup. I hope that helps you, to get more insights on the issue:
Application: kicad
Version: 5.0.0, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.15.18-3-MANJARO x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.67.0
Curl: 7.61.0
Compiler: GCC 8.1.1 with C++ ABI 1012
Build settings:
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
$ glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 260/PCIe/SSE2
OpenGL core profile version string: 3.3.0 NVIDIA 340.107
OpenGL core profile shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.3.0 NVIDIA 340.107
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 NVIDIA 340.107 340.107
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.00
OpenGL ES profile extensions:
$ kicad-ogltest
23:31:28: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,
and your program used 3.0 (wchar_t,compiler with C++ ABI 1012,wx containers,
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
*** Caught unhandled unknown exception; terminating
Stefan Krueger (z-mail-i) wrote : | #10 |
Hi there
i also tried and run with the verbose setting:
$ LIBGL_DEBUG=verbose pcbnew
(pcbnew:4704): Gtk-WARNING **: 13:55:50.881: Unable to locate theme engine in module_path: "adwaita",
(pcbnew:4704): Gtk-WARNING **: 13:55:50.910: Unable to locate theme engine in module_path: "adwaita",
** (pcbnew:4704): WARNING **: 13:56:06.617: Invalid borders specified for theme pixmap:
borders don't fit within the image
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/
libGL: OpenDriver: trying /usr/lib/
libGL: Can't open configuration file /home/stefan/
libGL: Can't open configuration file /home/stefan/
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
and also kicad-ogltest gives the same:
$ LIBGL_DEBUG=verbose kicad-ogltest
(kicad-
(kicad-
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/
libGL: OpenDriver: trying /usr/lib/
libGL: Can't open configuration file /home/stefan/
libGL: Can't open configuration file /home/stefan/
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
*** Caught unhandled unknown exception; terminating
and also tried
$ LIBGL_DEBUG=verbose glxgears -info
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER = NVS 3100M/PCIe/SSE2
GL_VERSION = 3.3.0 NVIDIA 340.106
GL_VENDOR = NVIDIA Corporation
GL_EXTENSIONS = GL_ARB_
Seth Hillbrand (sethh) wrote : | #11 |
Hi Stefan-
Can you post the output of the command:
find /usr -iname "*libGL.so*" -exec ls -l {} \;
jean-pierre charras (jp-charras) wrote : | #12 |
Also, google for:
"libGL error: failed to load driver: swrast"
You can find interesting info.
Stefan Krueger (z-mail-i) wrote : | #13 |
Hi Seth,
thats:
~$ find /usr -iname "*libGL.so*" -exec ls -l {} \;
-rw-r--r-- 1 root root 567624 Jun 5 16:16 /usr/lib/
lrwxrwxrwx 1 root root 10 Mär 7 17:25 /usr/lib/
lrwxrwxrwx 1 root root 14 Jul 25 10:28 /usr/lib/
-rw-r--r-- 1 root root 1267800 Jan 9 2018 /usr/lib/
lrwxrwxrwx 1 root root 16 Mär 7 17:25 /usr/lib/
lrwxrwxrwx 1 root root 10 Mär 7 17:25 /usr/lib/
-rw-r--r-- 1 root root 1075136 Jan 9 2018 /usr/lib/
lrwxrwxrwx 1 root root 16 Mär 7 17:25 /usr/lib/
let me know if i can give you more infos!
thanks for taking the time to look into it!
sunny greetings
stefan
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #14 |
To find out more about the issue I've tried to look into the project a bit. So I've searched for the warning ("OpenGL 2.1 or higher is required!") and recompiled KiCad (release build).
Found source files:
- include/
- common/
It turns out to be an issue with wxWidgets, I think. In the GAL (Graphics Abstraction Layer), in the constructor OPENGL_
// IsDisplayAttr() handles WX_GL_{
// starting with 3.1.0 one should use wxGLContext::IsOk() (done by GL_CONTEXT_MANAGER)
#if wxCHECK_VERSION( 3, 0, 3 ) and !wxCHECK_VERSION( 3, 1, 0 )
const int attr[] = { WX_GL_MAJOR_
if( !IsDisplaySuppo
throw std::runtime_error( "OpenGL 2.1 or higher is required!" );
#endif /* wxCHECK_VERSION( 3, 0, 3 ) */
This is throwing an error on my Manjaro/Arch linux computer (more infos on it posted in the previous post).
If I comment the IsDisplaySuppor
$ LIBGL_DEBUG=verbose ./pcbnew/pcbnew
20:08:01: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,
and your program used 3.0 (wchar_t,compiler with C++ ABI 1012,wx containers,
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/
libGL: OpenDriver: trying /usr/lib/
libGL: Can't open configuration file /home/rel/.drirc: No such file or directory.
libGL: Can't open configuration file /home/rel/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
More infos:
$ ldd pcbnew/pcbnew | grep wx
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
$ find /usr -iname "*libGL.so*" -exec ls -l {} \;
-rwxr-xr-x 1 root root 386364 Nov 9 2017 /usr/lib32/
lrwxrwxrwx 1 root root 14 Aug 4 23:15 /usr/lib32/libGL.so -> libGL.so.1.0.0
lrwxrwxrwx 1 root root 10 Jun 9 22:37 /usr/lib32/
-rwxr-xr-x 1 root root 1075136 Jun 9 22:37 /usr/lib32/
lrwxrwxrwx 1 root root 16 Jun 9 22:37 /usr/lib32/
lrwxrwxrwx 1 root root 14 Aug 4 23...
Stefan Krueger (z-mail-i) wrote : | #15 |
here again little bit shorter line format - hopefully without line-wrap:
$ find /usr -iname "*libGL.so*" -exec ls -g --no-group --human-readable --time-style=+ {} \;
-rw-r--r-- 1 555K /usr/lib/
lrwxrwxrwx 1 10 /usr/lib/
lrwxrwxrwx 1 14 /usr/lib/
-rw-r--r-- 1 1,3M /usr/lib/
lrwxrwxrwx 1 16 /usr/lib/
lrwxrwxrwx 1 10 /usr/lib/
-rw-r--r-- 1 1,1M /usr/lib/
lrwxrwxrwx 1 16 /usr/lib/
Seth Hillbrand (sethh) wrote : | #16 |
@Aurelio-
It looks like you are running 64-bit KiCad but only have 32-bit OpenGL installed. You will need to install the 64-bit Nvidia driver or the 32-bit KiCad.
@Stefan-
Can you post the output for the command
ldd /path/to/pcbnew
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #17 |
@Seth:
Thanks for looking into all the cryptic logs! I think both 32- and 64-bit OpenGL drivers should be installed (those libGLs were cut off in the post above).
I've recently tried to update the driver manually (downloaded from Nvidia) to see if it helps with the issue. But then I've switched back to the driver from Arch/Manjaro with pacman, since it is up to date, and behaved the same. - For some reason, older versions of KiCad didn't have this problem (3D preview and OpenGL layout mode worked fine). So, I figured it is a bug introduced with KiCad 5.0.0.
$ lspci -k | grep -A 3 -E "NVIDIA"
01:00.0 VGA compatible controller: NVIDIA Corporation GT200 [GeForce GTX 260] (rev a1)
Subsystem: Gigabyte Technology Co., Ltd GT200 [GeForce GTX 260]
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia
Installed nvidia* packages:
$ pacman -Qs nvidia
local/cuda 9.2.148-1
NVIDIA's GPU programming toolkit
local/lib32-
NVIDIA drivers utilities (32-bit)
local/lib32-
NVIDIA Cg libraries
local/libvdpau 1.1.1+3+ga21bf7a-1
Nvidia VDPAU library
local/linux414-
NVIDIA drivers for linux.
local/linux415-
NVIDIA drivers for linux.
local/mhwd-nvidia 1:396.45-1
MHWD module-ids for nvidia 396.45
local/mhwd-
MHWD module-ids for nvidia 304.137
local/mhwd-
MHWD module-ids for nvidia 340.107
local/mhwd-
MHWD module-ids for nvidia 390.77
local/nvidia-
NVIDIA drivers utilities
local/nvidia-
NVIDIA Cg libraries
local/opencl-nvidia 1:396.45-1
OpenCL implemention for NVIDIA
I try to uninstall unnecessary packages, and keep you posted if I find out more about the problem. - I think it must be something related to wxWidget libraries and/or OpenGL driver...
BTW: Just found out that the current master branch I've tested was already KiCad version 6.0.0 (6.0.0-rc1):
Application: kicad
Version: 6.0.0-rc1-unknown, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.15.18-3-MANJARO x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,
Boost: 1.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.0
Compiler: GCC 8.1.1 with C++ ABI 1012
Build settings:
USE_
USE_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
Seth Hillbrand (sethh) wrote : | #18 |
@Aurelio-
Please post the full output if it was cut off.
Also, can you add the full output from `ldd path/to/pcbnew` ?
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #19 |
Thanks Seth for looking into this.
I've switch to the 5.0.0 branch and built it again (release build). It shows the same behavior as before.
Please note that I had to turn off KICAD_SCRIPTING
$ cd build/release
$ cmake -DCMAKE_
(...)
-- wxPython version 3.0 found.
/usr/lib/
warnings.
CMake Error at CMakeLists.txt:793 (message):
wxWidgets and wxPython use different toolkits (gtk2 vs gtk3). It will
result in a broken build. Please either install wxPython built using gtk2
or add '-DKICAD_
wxPython support.
-- Configuring incomplete, errors occurred!
See also "/home/
That's how I've built it from the launchpad repo:
$ make -DCMAKE_
If posts are too long (this one might be also too long), you could check the full log via "Download full text".
$ ldd kicad/kicad
linux-vdso.so.1 (0x00007ffc69ff
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libwx_
libGLEW.so.2.1 => /usr/lib/
libcairo.so.2 => /usr/lib/
libpixman-1.so.0 => /usr/lib/
libOpenGL.so.0 => /usr/lib/
libGLX.so.0 => /usr/lib/
libGLU.so.1 => /usr/lib/
libcurl.so.4 => /usr/lib/
libssl.so.1.1 => /usr/lib/
libcrypto.so.1.1 => /usr/lib/
libstdc++.so.6 => /usr/lib/
libm.so.6 => /usr/lib/libm.so.6 (0x00007fe9a0bc
libgomp.so.1 => /usr/lib/
libgcc_s.so.1 => /usr/lib/
libpthread.so.0 => /usr/lib/
libc.so.6 => /usr/lib/libc.so.6 (0x00007fe9a01a
libgtk-
libgdk-
Stefan Krueger (z-mail-i) wrote : | #20 |
@Seth:
$ ldd /usr/bin/pcbnew
libc.so.6 => /lib/x86_
libm.so.6 => /lib/x86_
libX11.so.6 => /usr/lib/
libSM.so.6 => /usr/lib/
libz.so.1 => /lib/x86_
libdl.so.2 => /lib/x86_
Seth Hillbrand (sethh) wrote : | #21 |
@Stefan- where did you get your KiCad?
Stefan Krueger (z-mail-i) wrote : | #22 |
@Seth this should be the official version...
i have used the links from the official download info:
http://
there you find the
https:/
ppa. i have checked my sources and this on is active.
i also have added & active the nightly build
https:/
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #23 |
Currently, I'm trying to replicate the error in a wxWidgets example.
For that I've built wxWidgets and the OpenGL cube example from the github repo:
$ git clone https:/
$ cd wxWidgets
$ ./configure --with-x11 --disable-shared --enable-log --enable-debug --enable-
$ make -j4
$ cd samples/opengl/cube
$ make -j4 && ./cube
The build process and the example worked fine on my machine. But when I add a OpenGL version check similar to that in KiCad/pcbnew to the cube example, I run into an issue and a debugging pop-up shows up that says:
> A debugging check in this application has failed.
>
> ./src/unix/
> object is empty.
The newly added version check obviously failed:
$ git diff -U0 cube.cpp
diff --git a/samples/
index 5da6e7137f.
--- a/samples/
+++ b/samples/
@@ -485 +485,7 @@ MyFrame::MyFrame( bool stereoWindow )
-
+
+ static const int attr[] = { WX_GL_MAJOR_
+ if( !wxGLCanvas:
+ fprintf(stderr, "OpenGL 2.1 or higher is required!\n");
+ exit(-1);
+ }
+
It seems to have something to do with wxGLCanvasBase:
I do *not* know if this is really related to the KiCad 5.0.0 problem yet... I try to find out a bit more about this later...
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #24 |
Okay, I think I was on the wrong track up there, sorry for the confusion. The issue has probably nothing to do with wxWidgets directly.
KiCad is for some reason loading the wrong driver I think.
Both those workarounds make the accelerated layout mode finally work nicely :)
$ LD_PRELOAD=
$ LD_PRELOAD=
$ ls -l /usr/lib/
lrwxrwxrwx 1 root root 16 Aug 4 23:15 /usr/lib/
But, starting KiCad like that, shows the "OpenGL 2.1 or higher is required!" error from before in all tested versions of KiCad/pcbnew:
$ LD_PRELOAD=
$ kicad
If I can further track down the problem, I would gladly try to do that, since this is probably a rare problem (is it maybe a CMake configuration issue? - I have not much experience in using CMake...).
@Stefan:
Does the LD_PRELOAD trick work for you as well?
Stefan Krueger (z-mail-i) wrote : | #25 |
@Aurelio:
i have tried with the examples you have given - but non of them worked.
no wounder - as these paths are not available on my system... (see #13 https:/
so i tried and used one of the available paths:
$ LD_PRELOAD=
with this pcbnew started.
then i switched to the openGL view (with F11)
and got shortly a gray screenfill in pcbnew
than the warning: 'Could not find shader uniform: SMAA_RT_METRICS'
and it automatically switched back to 'modern fallback'
then i opend the 3D Viewer and juchu - it worked :-) i saw a small empty pcb ;-)
then i tried and started kicad with the LD_PRELOAD and it was the same - the 'modern toolset' did not work (same error message) - the 3D Viewer worked fine and showed my PCB and the 3D models of the footprints.
i also run the kicad-ogltest:
stefan:~$ LD_PRELOAD=
(kicad-
(kicad-
INFO: Instantiated GL window
INFO: Found OpenGL version 3.3
INFO: Successfully called OPENGL_
PASS
stefan:~$
so this seemed to also worked. :-)
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #26 |
Nice! :)
Strange that those warnings still appear and that the accelerated layout mode in pcbnew doesn't work on your PC.
Maybe it's because you have the open source OpenGL driver installed (not sure, but I think /usr/lib/
Looking into the infos above:
> OpenGL renderer string: NVS 3100M/PCIe/SSE2
> OpenGL core profile version string: 3.3.0 NVIDIA 340.106
> OpenGL core profile shading language version string: 3.30 NVIDIA via Cg
If there are still glitches (like the 'Could not find shader uniform: SMAA_RT_METRICS' warning), you could try to also install the (closed source) Nvidia driver, and LD_PRELOAD that one to see if KiCad works properly with it installed.
So, only the 3D Viewer works on your machine and the OpenGL mode in pcbnew doesn't? Only the "Modern Toolset (Fallback)" mode does? - That's strange... That looks like an actual bug, since it's not just a system/driver issue.
(The SMAA_RT_METRICS warning has something to do with a anti aliasing/a built-in GLSL shader I think, probably only used in pcbnew, not in the 3D Viewer. Source files found:
- common/
- common/
It looks like ANTIALIASING_
---
The kicad-ogl test gives me the following output now here:
$ LD_PRELOAD=
17:26:55: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,
and your program used 3.0 (wchar_t,compiler with C++ ABI 1012,wx containers,
INFO: Instantiated GL window
INFO: Found OpenGL version 3.3
INFO: Successfully called OPENGL_
PASS
I've tried the "Modern Toolset (Accelerated)" mode in pcbnew and the 3D Preview with a larger PCB with many parts, and both seem to work fine now here. No glitches so far, track shoveling working fine so far (I had problems/crashes with that in older KiCad versions, when I tried it).
(Still, I think there's something wrong in the KiCad build process. I do not know why KiCad doesn't loads the right dynamic library libGL.so/driver out of the box. Most other applications use the Nvidia driver by default, and the older version 4 KiCad also had no problem with that here...)
Maciej Suminski (orsonmmz) wrote : | #27 |
I think you already know the root cause: you have two OpenGL libraries and the default symlink points to the software renderer.
If there are different paths to the OpenGL libraries (e.g. /usr/lib vs /usr/lib/nvidia) then you can give priority to the nVidia library by adding an entry in /etc/ld.so.conf or /etc/ld.
You may also try intalling libglvnd [1], this is how the OpenGL library is resolved on my system.
The question demanding an answer is: how come glxgears pick the right OpenGL library?
More info:
https:/
https:/
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #28 |
Thanks for looking into this Maciej.
I do not fully understand yet how the OS decides exactly when to load which shared object/dynamic library. I'm looking into the details you've pointed out (/etc/ld.so.conf*).
$ cat /etc/ld.so.conf
# Dynamic linker/loader configuration.
# See ld.so(8) and ldconfig(8) for details.
include /etc/ld.
$ ls /etc/ld.so.conf.d/
00-lib32-
00-nvidia.conf cuda.conf lib32-glibc.conf opencollada.conf perf.conf xulrunner.conf
$ cat /etc/ld.
/usr/lib/nvidia/
$ cat /etc/ld.
/usr/lib32/nvidia/
> two OpenGL libraries and the default symlink points to the software renderer.
Yes, I think there are even three graphics drivers on my computer (because of dependencies of various programs). The proprietary nvidia driver, an open-source driver (mesa) and the software renderer (swrast?), and all of them in 32- and 64-bit variants.
I'm going to read a bit more about how libglvnd works later on, and how it could be used to fix the issue. Both, the libglvnd 64- and 32-bit version were installed already before.
$ pacman -Qs libglvnd
local/lib32-
The GL Vendor-Neutral Dispatch library
local/libglvnd 1.0.0-1
The GL Vendor-Neutral Dispatch library
> The question demanding an answer is: how come glxgears pick the right OpenGL library?
Right, KiCad somehow tries to load the wrong library.
Not sure, but something has to be fixed in the build process of KiCad 5.0.0. The linker stores the final dependencies in the produced dynamically linked binary. And as it turns out, glxgears explicitly points to the nvidia libraries ('/usr/
Maybe it can be fixed by modifying the CMake configuration files?
$ ls -al /usr/lib/
-rwxr-xr-x 1 root root 44003128 Jun 9 21:57 /usr/lib/
$ ldd /usr/bin/glxgears | grep -Ei 'gl|x11|nv'
libGL.so.1 => /usr/lib/
libX11.so.6 => /usr/lib/
libnvidia-
libnvidia-
$ ldd /usr/bin/pcbnew | grep -Ei 'gl|x11|nv'
libgtk-
libgdk-
libglib-2.0.so.0 => /usr/lib/
libX11.so.6 => /usr/lib/
But for some reason, kicad-ogltest shows the dynamically linked libGL*.so explicitly:
$ /usr/bin/
libwx_
libGLEW.so.2.1 => /usr/lib/
libOpenGL.so.0 => /usr/lib/
libGLX.so.0 => /usr/lib/libGLX...
Maciej Suminski (orsonmmz) wrote : | #29 |
Thank you, that is very detailed report. Apparently you already have the right entries in /etc/ld.
If you are interested in the shared libraries topic: normally ELF files store only the shared libraries file names, no full paths (check 'readelf -d /path/to/exe | grep NEEDED'). It is the loader's job to find the right librariesa and this is what you get from ldd command.
I guess you will get the GL libraries listed when you run 'ldd _pcbnew.kiface' - this is the binary containing the actual pcbnew code. 'Pcbnew' is only a loader for _pcbnew.kiface, which is in turn a shared library. I find it a bit strange that I also have GL libraries listed for the 'pcbnew' executable and you do not.
BTW. I am running Arch Linux, so that is the same distro family as Manjaro and have a similar video adapters configuration: integrated Intel card and discrete nVidia in a laptop. I suppose you installed KiCad from a package, right?
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #30 |
Yes, I've installed KiCad 5.0.0 from the Arch community repo.
$ pacman -Qs kicad
local/kicad 5.0.0-1
Electronic schematic and printed circuit board (PCB) design tools
And also cloned the git repo from launchpad for more testing. But didn't install anything from there...
> normally ELF files store only the shared libraries file names, no full paths
That's interesting, I didn't know that in detail. The man page of ld.so is also very useful.
So it makes sense that the path to the actual shared library gets resolved by the OS/loader, and that's probably where libglvnd comes in (via libOpenGL.so / libGLdispatch.so (?)). I will read up more on that topic later.
Something else I don't understand yet is how the system handles conflicting libraries...
Could it be that another shared object (GTK/wxWidgets) depends on a different OpenGL library than a already loaded one (with the same symbols/functions in it), and libglvnd gets confused?
$ readelf -d /usr/lib/
0x0000000000000001 (NEEDED) Shared library: [libGL.so.1]
$ ldd /usr/lib/
libGL.so.1 => /usr/lib/
Maybe the misbehavior stems from such a conflict, that comes from the *order* the libraries get loaded?
I tried to change the order in the main CMakeLists.txt by simply moving text around, but it didn't help...
---
More logs and various tests:
$ # "OpenGL 2.1 or higher is required!" showing up
$ pcbnew &
$ lsof -p `pidof pcbnew` | grep mem | grep GL
pcbnew 25806 rel mem REG 8,98 109512 6035021 /usr/lib/
pcbnew 25806 rel mem REG 8,98 1137760 6031890 /usr/lib/
pcbnew 25806 rel mem REG 8,98 1267800 6293991 /usr/lib/
pcbnew 25806 rel mem REG 8,98 186112 6037699 /usr/lib/
pcbnew 25806 rel mem REG 8,98 194384 6044838 /usr/lib/
pcbnew 25806 rel mem REG 8,98 44003128 6031871 /usr/lib/
pcbnew 25806 rel mem REG 8,98 477880 6042976 /usr/lib/
pcbnew 25806 rel mem REG 8,98 522000 6044904 /usr/lib/
pcbnew 25806 rel mem REG 8,98 612176 6034906 /usr/lib/
pcbnew 25806 rel mem REG 8,98 665608 6031230 /usr/lib/
pcbnew 25806 rel mem REG 8,98 67272 6039886 /usr/lib/
pcbnew 25806 rel mem REG 8,98 93272 6060100 /usr/lib/
$ # Modern Toolset (Accelerated) working ok
$ killall pcbnew
$ LD_PRELOAD=
$ lsof -p `pidof pcbnew` | grep mem | grep -i GL
pcbnew 25725 rel mem REG 8,98 1137760 6031890 /usr/lib/
pcbnew 25725 rel mem REG 8,98 1267800 6293991 /usr/lib/
pcbnew 25725 rel mem REG ...
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #31 |
Luckily, there's a way to quicky fix the problem.
I've changed the OpenGL_
(Only the debug builds have been tested so far.)
However, I'm not sure, if it is going to work under all conditions, and if it is a good solution at all.
It bypasses the libglvnd magic I guess. If I can help out with more tests on my setup, I would be glad if you could guide those tests a bit. It's difficult for me to find out what's really going, since I don't know KiCad's code base, cmake and there are too many rabbit holes to get lost in a Linux system :P
---
$ git diff -U0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2ea761f9.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -582 +582 @@ endif()
-set( OpenGL_
+set( OpenGL_
$ mkdir -p build/debug
$ cd build/debug
$ cmake -DCMAKE_
$ make -j4
$ ./utils/
05:42:17: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1011,wx containers,
and your program used 3.0 (wchar_t,compiler with C++ ABI 1012,wx containers,
INFO: Instantiated GL window
INFO: Found OpenGL version 3.3
INFO: Successfully called OPENGL_
PASS
(BTW: I turned oce/OpenCASCADE off (KICAD_
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #32 |
The release builds also have been tested successfully.
With the quick fix above, a OpenGL related symbol lookup looks like this. libOpenGL.so (libglvnd related) isn't used.
$ LD_DEBUG=all ./utils/
839621 17046: symbol=
839622 17046: symbol=
839623 17046: symbol=
839624 17046: symbol=
839625 17046: symbol=
839626 17046: symbol=
839627 17046: symbol=
839628 17046: symbol=
839629 17046: symbol=
839630 17046: symbol=
839631 17046: symbol=
839632 17046: symbol=
839633 17046: symbol=
839634 17046: symbol=
839635 17046: binding file ./utils/
Shared libraries needed by kicad-ogltest, after disabling GLVND:
$ readelf -d ./utils/
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libwx_
0x0000000000000001 (NEEDED) Shared library: [libGLEW.so.2.1]
0x0000000000000001 (NEEDED) Shared library: [libcairo.so.2]
0x0000000000000001 (NEEDED) Shared library: [libpixman-1.so.0]
0x0000000000000001 (NEEDED) Shared library: [libGL.so.1]
0x0000000000000001 (NEEDED) Shared library: [libGLU.so.1]
0x0000000000000001 (NEEDED) Shared library: [libcurl.so.4]
0x0000000000000001 (NEEDED) Shared library: [libssl.so.1.1]
0x0000000000000001 (NEEDED) Shared library: [libcrypto.so.1.1]
0x0000000000000001 (NEEDED) Shared library: [li...
Stefan Krueger (z-mail-i) wrote : | #33 |
in reply to @Aurelio #26:
i have resorted the results from
$ find /usr -iname "*libGL.so*" -exec stat -c%N {} \;
so its easier for me to understand and follow the linkgs... :
'/usr/lib/
'/usr/lib/
'/usr/lib/
'/usr/lib/
'/usr/lib/
'/usr/lib/
'/usr/lib/
'/usr/lib/
last time (#25) i have tested with libGL.so.1
so now i have redone the tests with the direct libGL.so.340.106 file.
but the results were exactly the same.
and then also have doen the test with the direct use of libGL.so.1.0.0 file.
this results in the 'OpenGL 2.1 or higher is required' error and an not working 3D Viewer..
so it seems libGL.so.1.0.0 is pointing to the Nouveau driver or something else..
i think the libGL.so.340.106 is standing for the nvidia closed source driver..
i had tested the Nouveau driver - but it does not work on my system... (does not find the 'display' and so it falls back to some sw rendering and i have 600x400pixel resolution....)
so iam very sure that the current active driver is the nvidia one..
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #34 |
Thanks Stephan for all the details!
---
*) nvidia driver on Ubuntu:
Yes, I think I was confused, you seem to have the current proprietary nvidia driver installed!
I've cross-checked those files here:
https:/
/usr/lib/
/usr/lib/
So our setups should be comparable then. Now it would be interesting to find out what exactly causes the problem.
---
*) Anti-aliasing / SMAA_RT_METRICS problem:
After looking a bit into those mentioned source files, to find out how to turn off anti-aliasing in code.
I've discovered that KiCad comes with an comfortable way to configure anti aliasing settings right in pcbnew GUI:
pcbnew -> Display Options... -> Accelerated Graphics -> No Antialiasing
When I select *subpixel* anti-aliasing in that menu, I also get the same error message you've mentioned: "Could not find shader uniform: SMAA_RT_METRICS", after pressing OK. And it also switches over to 'Modern Toolset (Fallback)' mode, after showing a gray window for a moment. -- Both supersampling (2x/4x) modes work fine here (nvidia GeForce GTX 260). - But I think this problem/bug would deserve a new ticket, since it is not directly related to the other one.
I hope this helps, to run pcbnew's new OpenGL mode on your setup with the LD_PRELOAD workaround.
---
*) GLVND workaround / LEGACY pseudo fix:
It would be interesting to see if the tiny change required in CMakeLists.txt also fixes the problem on your system, if you have the time to test it...
To replicate it, you could apply it and rebuild KiCad like this:
$ git clone https:/
$ cd kicad
$ git checkout 5.0.0
$ sed -i.bak 's/OpenGL_
$ mkdir -p build/release
$ cd build/release
$ cmake -DCMAKE_
$ make
$ ./pcbnew/pcbnew
Maciej Suminski (orsonmmz) wrote : | #35 |
Aurelio,
I have tested your changes on Linux and Windows and I have found no problems. It seems that not every platform supports GLVND equally well, so it might be better to follow the legacy way for the time being.
I intend to apply your modifications to the master branch, so please give me your e-mail address if you would like to have the patch attributed to you. Thank you for your cooperation.
Stefan Krueger (z-mail-i) wrote : | #36 |
@Aurelio
so i tried to compile from source :-)
- i first had to install all dependencies..
$ sudo apt build-dep kicad
(with the nightly package sources enabled)
fixed the dependencies..
and also needed to run
$ sudo ./scripts/
to install NGSPICE libraries (this script was mentioned by cmake)
after an long long time (i forget to specify a make -j 8 for multi-core usage..) build finished.
i started pcb new and switched to 'Modern Toolset (Accelerated)' - but this greeted me with the already known 'Could not find shader uniform: SMAA_RT_METRICS' message..
but the 3D View worked.
so i switched to 'No Antialiasing' and it worked.
i also checked the other options and the Supersampling* worked..
thanks for your persistence to trac this all down... ;-)
if someone of you do need any other info from me - or if i should try to recompile something else let me know...
Maciej Suminski (orsonmmz) wrote : | #37 |
Aurelio,
I did not want to wait longer with applying the fix, so I simply put your name with a 'thanks' line. We appreciate your help!
Changed in kicad: | |
status: | Incomplete → Fix Committed |
importance: | Undecided → High |
milestone: | none → 5.0.1 |
assignee: | nobody → Aurelio Lucchesi (0rel) |
Alex (knapik1227) wrote : | #38 |
Yep, I just build the latest version of KiCAD for my GNU/Linux install and I can confirm that openGL mode is working great now. Thank you very much!
Stefan Krueger (z-mail-i) wrote : | #39 |
me to.
i updated through the nightly ppa and its working fine.
Stefan Krueger (z-mail-i) wrote : | #40 |
additionally i have now created
Bug #1788456 'Could not find shader uniform: SMAA_RT_METRICS'
so we could find out what is the case for the SMAA messagae found in comment 24...
Aurelio Lucchesi (0rel-deactivatedaccount) wrote : | #41 |
Thanks everyone for all the testing and the feedback, it's great to hear that it works now in most cases! :D
KiCad is great!
Sorry for the long delay, I was away.
@Maciej
That makes sense yes. I do not know though what kind of limitations come with using LEGACY OpenGL_
Thanks a lot for applying the fix, and mentioning me.
I'm glad that we were able to find a solution!
(BTW: You should be able to see my mail address on the launchpad profile page.)
@Stefan:
Happy to hear that! - Yes it takes quite a while to build KiCad, I was surprised as well, it's big. You could also abort a build process (with Ctrl-C) and continue it by invoking make with new parameters like -j9 a second time. It usually works, without losing previously compiled object files.
(Still have to test the NGSPICE simulation features soon...)
@Bug #1788456 'Could not find shader uniform: SMAA_RT_METRICS'
Since I also have this problem, we could try to track this one down as well. (But I'm not sure if I will work on Linux next week already. - I hope to get to work on a new project with KiCad 5.0.0+ soon...)
@Alex:
Thanks for testing it!
Are you going to update the ticket, when the new version 5.0.1 is released? ("Fix Released")
Changed in kicad: | |
status: | Fix Committed → Fix Released |
Probably related: https:/ /bugs.launchpad .net/kicad/ +bug/1775995