Bug 28352 - Bundled kicad 5.1.9 fails to enable HW acceleration
Summary: Bundled kicad 5.1.9 fails to enable HW acceleration
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: David GEIGER
QA Contact:
URL:
Whiteboard:
Keywords: IN_ERRATA8
: 28602 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-12 08:35 CET by Alexander Krylov
Modified: 2021-10-04 19:57 CEST (History)
5 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
inxi -bmG (1.19 KB, text/plain)
2021-02-12 08:38 CET, Alexander Krylov
Details
OpenGL error (247.05 KB, image/png)
2021-02-12 08:39 CET, Alexander Krylov
Details
3Dviewer error (416.91 KB, image/png)
2021-02-12 08:40 CET, Alexander Krylov
Details
Working kicad compiled from sources (277.34 KB, image/png)
2021-02-12 08:41 CET, Alexander Krylov
Details
kicad compiled against current wxWidgets git master with --with-opengl option enabled (57.67 KB, image/png)
2021-02-12 12:40 CET, Alexander Krylov
Details
Kicad error (47.05 KB, image/png)
2021-04-28 21:34 CEST, Alexander Krylov
Details
Working 3d viewer (636.47 KB, image/png)
2021-04-29 13:12 CEST, Alexander Krylov
Details

Description Alexander Krylov 2021-02-12 08:35:57 CET
Description of problem:
Current kicad in caludron/8 RC is barely usable without hardware acceleration.
Pcbnew program shows a warning "Could not use OpenGL, falling back to software rendering" right from the beginning as well as, when I try to switch to 'Modern Toolset' by pressing F11 key. That's half of the problem, the worst part is 3D viewer is not usable at all. When I open 3d viewer window with Alt+3 it shows a transparent window and spams me with "Unknown error" pop ups, so I have to kill pcbnew to regain control.

Whilst trying to figure out the cause, I have narrowed down the suspects to a bundled wxWidgets 3.1.5 package. Either wxWidgets v3.1.5 are not playing nice with kicad at all or this is happening because it was compiled without --with-opengl option, which is important according to kicad documentation.

Nevertheless, I ended up compiling kicad 5.1.9 and wxWidgets from source. I have used wxWidgets-3.0.5 sources and compiled them with --with-opengl option. Now everything works as it should.

Version-Release number of selected component (if applicable):
kicad-5.1.9-2.mga8.x86_64
wxgtk3.1-3.1.5-0.git20201230.1.mga8.x86_64


Steps to Reproduce:
1. Install kicad from repo
2. Run pcbnew
3. Press F11 key or Alt+3
Comment 1 Alexander Krylov 2021-02-12 08:38:44 CET
Created attachment 12333 [details]
inxi -bmG
Comment 2 Alexander Krylov 2021-02-12 08:39:24 CET
Created attachment 12334 [details]
OpenGL error
Comment 3 Alexander Krylov 2021-02-12 08:40:07 CET
Created attachment 12335 [details]
3Dviewer error
Comment 4 Alexander Krylov 2021-02-12 08:41:45 CET
Created attachment 12336 [details]
Working kicad compiled from sources
Comment 5 David GEIGER 2021-02-12 08:59:49 CET
Thanks for you report, I'm on it enabling the '--with-opengl' option in wxgtk3.0 and after that rebuilding kicad against it in mga8/Core/Updates_testing repo!

CC: (none) => geiger.david68210

Comment 6 David GEIGER 2021-02-12 09:18:11 CET
Build in progress, please test when they landed in Core/Updates_testing repo in few hours.
Comment 7 David GEIGER 2021-02-12 09:40:28 CET
Hmmm! kicad doesn't build with wxgtk 3.0.5 because of python3-wxpython4 which is built with wxgtk 3.1.5:

-- Found Phoenix 4.1.1/gtk3 (wxWidgets 3.1.5)
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find wxWidgets: Found unsuitable version "3.0.5", but required is
  at least "3.1.5"


how did you succeed  to build kicad against wxgtk 3.0.5?
Comment 8 Alexander Krylov 2021-02-12 09:47:39 CET
Ah, I disabled python scripting support during configuration step with -DKICAD_SCRIPTING=0 option, since I don't need it. Of course, this shouldn't be disabled for distro package, so I suggest trying to build kicad with wxWidgets 3.1.5 and --with-opengl option for now.
Comment 9 Alexander Krylov 2021-02-12 12:38:19 CET
Out of curiosity, I've rebuilt kicad locally against current wxWidgets 3.1.xx git master with --with-opengl option enabled. Well, the OpenGL error has returned.

So, kicad doesn't play nicely with new wxWidgets after all.
Comment 10 Alexander Krylov 2021-02-12 12:40:22 CET
Created attachment 12337 [details]
kicad compiled against current wxWidgets git master with --with-opengl option enabled
Comment 11 Lewis Smith 2021-02-12 21:53:09 CET
Since DavidG is already well embarked on this, assigning it to you. BugSquad cannot do much to help here!

Severity: normal => enhancement
Assignee: bugsquad => geiger.david68210

Comment 12 David GEIGER 2021-03-15 18:18:59 CET
*** Bug 28602 has been marked as a duplicate of this bug. ***

CC: (none) => andrf

Morgan Leijström 2021-03-15 18:50:04 CET

CC: (none) => fri

Comment 13 Jan Ciger 2021-04-25 00:05:47 CEST
Is there any news on this issue? 

KiCAD is currently pretty much unusable in Mageia because a lot of things need the OpenGL canvas. And not having the 3D view is a major pain in the backside, making sanity checking things a lot harder.

CC: (none) => jan.ciger

Comment 14 Morgan Leijström 2021-04-25 14:51:22 CEST
In the mean time, 
Have you tried if it works better as flatpak?

1) Install flatpak system into Mageia
 https://wiki.mageia.org/en/Ways_to_install_programs#Flatpak

2) Install KiCAD as flatpak by issuing the command given at
 https://kicad.org/download/flatpak/

3) Launch it with
 flatpak run org.kicad.KiCad


I tried just now and do not see that error message.
But i have no experience of using the program, so please try and report.
Comment 15 Jan Ciger 2021-04-26 09:09:03 CEST
Yes I have tried this weekend and the current flatpak works OK. It used to be broken too (same error message) but it seems it has been updated recently.
Comment 16 Morgan Leijström 2021-04-26 09:39:51 CEST
Thank you for the confirmation.

As I do  not remember having seen this when i tried it in Mageia 7, I put it under upgrade issues, pointing to this workaround.

https://wiki.mageia.org/en/Mageia_8_Errata#Various_upgrade_issues

The impact of the problem is severe enough I regard this as a normal bug - rising it from enhancement request.

Keywords: (none) => IN_ERRATA8
Severity: enhancement => normal

Comment 17 David GEIGER 2021-04-28 06:04:47 CEST
Is it possible to report this issue upstream at https://gitlab.com/kicad/code/kicad/-/issues ?

To see what is going wrong with wxgtk 3.1.5
Comment 18 Alexander Krylov 2021-04-28 18:51:13 CEST
Here's one created upstream: https://gitlab.com/kicad/code/kicad/-/issues/8320
Feel free to add something else in there.

As a side note, flatpack version that is suggested as workaround for now is built against old wxgtk-3.0.5 too. So yeah, something really went wrong in that kicad-5.1.9 + wxgtk-3.1.5 combo.
Comment 19 Alexander Krylov 2021-04-28 19:01:29 CEST
Ian McInerney replied:

"You must build wxWidgets 3.1.5+ with the --disable-glcanvasegl to use KiCad 5.1.9 with hardware acceleration since we do not support the EGL canvas backend, which is the default in wxWidgets 3.1.5.

Support for the EGl backend was added to 5.99 (the upcoming v6 release), and is non-trivial to backport to 5.1.9."

Anyone willing to build a testing package?
Comment 20 David GEIGER 2021-04-28 20:22:07 CEST
Build in progress in Core/Updates_testing repo: wxgtk-3.1.5-0.git20201230.1.1.mga8
Comment 21 Thomas Backlund 2021-04-28 21:10:11 CEST
Hm,

other packages depending on wxgtk needs to be tested if something breaks when glcanvasegl goes missing...
Comment 22 Alexander Krylov 2021-04-28 21:34:23 CEST
Created attachment 12684 [details]
Kicad error

Installed packages:
(source «Core Release»)
  kicad                          5.1.9        2.mga8        x86_64  
  kicad-doc                      5.1.9        2.mga8        noarch  
  kicad-i18n                     5.1.9        2.mga8        noarch  
  kicad-library                  5.1.9        2.mga8        noarch  
  python3-wx-siplib              4.19.24      1.mga8        x86_64  
  python3-wxpython4              4.1.1        1.mga8        x86_64  
(source «Core Updates Testing»)
  lib64wx_gtk3u_aui3.1_5         3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_gl3.1_5          3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_propgrid3.1_5    3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_ribbon3.1_5      3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_richtext3.1_5    3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_stc3.1_5         3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_xrc3.1_5         3.1.5        0.git2020123> x86_64 

Kicad shows an error: Failed to load shared library '/usr/bin/_pcbnew.kiface': /usr/bin-_pcbnew.kiface: undefined sybbol: xxxx, version WXU_3.1

See attached screenshot for error details. Looks like 'kicad' package needs a rebuild as well.
Comment 23 Alexander Krylov 2021-04-29 02:26:09 CEST
I've managed to rebuild kicad-5.1.9 source locally against wxgtk-3.1.5-0.git20201230.1.1.mga8 from testing repo and HW acceleration works now as expected. So, just rebuilding 'kicad' package against changed 'wxgtk' from testing repo should be enough to make it work.

On another hand, as Thomas pointed out in comment 21, there's quite a bunch of packages that should be tested and perhaps rebuild against changed 'wxgtk-3.1.5' if these fixes are going to be pushed into Core Updates.
Comment 24 David GEIGER 2021-04-29 05:30:12 CEST
hmmmm! you are right Thomas. This is another wxgtk issue in our stable release that is complicated to manage :(


So list of possibility packages that we should take care:

codeblocks
codelite
erlang-wx
flamerobin
freedv
freefilesync
guayadeque
kicad
opencpn
opencpn-ais-radar-plugin
opencpn-climatology-plugin
opencpn-polar-plugin
opencpn-squiddio-plugin
opencpn-watchdog-plugin
opencpn-weather-routing-plugin
python3-wxpython4
slade
tintii
urbanlightscape
wxformbuilder
wxhexeditor
wxmaxima
xchm
Comment 25 David GEIGER 2021-04-29 07:54:08 CEST
I think that only packages who use lib64wx_gtk3u_gl3.1_5 can be affected:

$ urpmq --whatrequires lib64wx_gtk3u_gl3.1_5
0ad
aegisub
erlang-wx
kicad
opencpn
opencpn-climatology-plugin
opencpn-watchdog-plugin
opencpn-weather-routing-plugin
python3-wxpython4
slade
vbam
Comment 26 David GEIGER 2021-04-29 11:13:15 CEST
kicad now rebuilded against wxgtk-3.1.5-0.git20201230.1.1.mga8 in Core/Updates_testing repo!
Comment 27 Alexander Krylov 2021-04-29 13:12:20 CEST
Created attachment 12688 [details]
Working 3d viewer

Installed packages:
(source «Core Release»)
  python3-wx-siplib              4.19.24      1.mga8        x86_64  
  python3-wxpython4              4.1.1        1.mga8        x86_64  
(source «Core Updates Testing»)
  kicad                          5.1.9        2.1.mga8      x86_64  
  kicad-doc                      5.1.9        2.1.mga8      noarch  
  kicad-i18n                     5.1.9        2.1.mga8      noarch  
  kicad-library                  5.1.9        2.1.mga8      noarch  
  lib64wx_gtk3u_aui3.1_5         3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_gl3.1_5          3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_propgrid3.1_5    3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_ribbon3.1_5      3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_richtext3.1_5    3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_stc3.1_5         3.1.5        0.git2020123> x86_64  
  lib64wx_gtk3u_xrc3.1_5         3.1.5        0.git2020123> x86_64 

Kicad works as expected, HW acceleration in place as well.
Comment 28 Jan Ciger 2021-04-29 14:37:10 CEST
I confirm, the test version works a treat here as well. Thanks a lot for solving this.
Comment 29 Morgan Leijström 2021-04-30 07:20:29 CEST
Mageia KiCAD seem to be working fine here too now.
Thank you guys :)

So next step is to update and verify other stuff affected by the wxgtk update.
Comment 30 David GEIGER 2021-05-06 17:05:06 CEST
Assigning to QA,


So now we have to be sure that the following packages still work as they should:

0ad
aegisub
erlang-wx
kicad
opencpn
opencpn-climatology-plugin
opencpn-watchdog-plugin
opencpn-weather-routing-plugin
python3-wxpython4
slade
vbam



And a list of possibility packages that we should also take care:

codeblocks
codelite
flamerobin
freedv
freefilesync
guayadeque
opencpn
opencpn-ais-radar-plugin
opencpn-polar-plugin
opencpn-squiddio-plugin
tintii
urbanlightscape
wxformbuilder
wxhexeditor
wxmaxima
xchm

Assignee: geiger.david68210 => qa-bugs

Comment 31 Aurelien Oudelet 2021-05-22 18:21:55 CEST
Advisory:
========================

Updated Kicad and wxgtk3.1 packages fix hardware acceleration missing

The updated KiCad and wxgtk3.1 packages fix hardware acceleration missing.
The wxWidgets 3.1.5 was build without the --disable-glcanvasegl to use KiCad 5.1.9 with hardware acceleration, since Kicad does not support the EGL canvas backend, which is the default in wxWidgets 3.1.5.

Support for the EGl backend will be added the upcoming v6 release, and is non-trivial to backport to 5.1.9.

References:
https://bugs.mageia.org/show_bug.cgi?id=28352
========================

Updated packages in 8/core/updates_testing:
========================
kicad-5.1.9-2.1.mga8
kicad-library-5.1.9-2.1.mga8
kicad-doc-5.1.9-2.1.mga8
kicad-i18n-5.1.9-2.1.mga8

lib(64)wx_gtk3u_html3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_xrc3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_baseu_net3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_aui3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_qa3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_core3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_gl3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_adv3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_propgrid3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wxgtku3.1-devel-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_stc3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_media3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_ribbon3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_richtext3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_baseu_xml3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_gtk3u_webview3.1_5-3.1.5-0.git20201230.1.1.mga8
lib(64)wx_baseu3.1_5-3.1.5-0.git20201230.1.1.mga8
wxgtk3.1-3.1.5-0.git20201230.1.1.mga8

from SRPMs:
========================
kicad-5.1.9-2.1.mga8
wxgtk3.1-3.1.5-0.git20201230.1.1.mga8


========================
For QA: Important remark: see also comment 30.

CC: (none) => ouaurelien

Comment 32 Morgan Leijström 2021-05-22 18:42:16 CEST
Released May 3: "The 5.1.10 stable version contains critical bug fixes and other minor improvements since the previous release."
( from https://www.kicad.org/blog/2021/05/KiCad-5.1.10-Release/ )

As upstream say critical, i think it is a good idea to consider shipping that in this bug directly.

List of fixed bugs:
 https://gitlab.com/groups/kicad/-/milestones/5

V6 is expected some time this year.

Assignee: qa-bugs => geiger.david68210

Comment 33 Jani Välimaa 2021-07-25 19:17:17 CEST
Updated wxgtk to 3.1.5 final.

SRPM(S)
wxgtk-3.1.5-1.mga8

RPM(S)
lib(64)wx_baseu3.1_5-3.1.5-1.mga8
lib(64)wx_baseu_net3.1_5-3.1.5-1.mga8
lib(64)wx_baseu_xml3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_adv3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_aui3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_core3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_gl3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_html3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_media3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_propgrid3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_qa3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_ribbon3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_richtext3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_stc3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_webview3.1_5-3.1.5-1.mga8
lib(64)wx_gtk3u_xrc3.1_5-3.1.5-1.mga8
lib(64)wxgtku3.1-devel-3.1.5-1.mga8
wxgtk3.1-3.1.5-1.mga8
Comment 34 Morgan Leijström 2021-07-26 13:13:42 CEST
Thanks Jani
I have pinged QA list for testing
Comment 35 Morgan Leijström 2021-07-26 14:17:33 CEST
$ urpmq -f kicad
kicad-5.1.9-2.mga8.x86_64|kicad-5.1.9-2.1.mga8.x86_64

Was working prior to wxgtk update

Now segmentation fault:

$ kicad
kicad: Symbol `_ZTV5wxPen' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV12wxHtmlWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV15wxMessageDialog' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV14wxBitmapButton' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV12wxAuiToolBar' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV10wxCheckBox' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV9wxControl' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV17wxMDIClientWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV26wxGenericRichMessageDialog' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV12wxButtonBase' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV17wxGenericTreeCtrl' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV16wxTopLevelWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV16wxScrolledWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV17wxTextEntryDialog' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV11wxDirDialog' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV8wxDialog' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV7wxPanel' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV18wxSashLayoutWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV12wxSashWindow' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV11wxAnyButton' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV10wxTreeCtrl' has different size in shared object, consider re-linking
kicad: Symbol `_ZTV8wxButton' has different size in shared object, consider re-linking
Segmenteringsfel (minnesutskrift skapad)

--------

BTW, KiCAD 6 seem to have some way to go to release, so packaging 5.1.10 would be nice.
critical fixes, see comment 32
Comment 36 Morgan Leijström 2021-07-26 22:00:56 CEST
boincmgr also segfaults with similar errors.
Comment 37 Morgan Leijström 2021-07-27 09:10:21 CEST
For those testing this wxgtk3.1 upgrade and want to get back:

 urpmi --media release --downgrade wxgtk3.1

---------

I suggest to split this bug:

* Release kicad-5.1.9-2 now

And in new bugs:

* kicad-5.1.10 update

* wxgtk-3.1.5 final
Morgan Leijström 2021-07-28 08:34:22 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=29291

Morgan Leijström 2021-07-31 19:13:34 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=29309

Comment 38 Morgan Leijström 2021-10-04 19:57:45 CEST
* Ping to prepare release kicad-5.1.9-2 as is now - without wxgtk update.

* This incompatible wxgtk-3.1.5-1.mga8 is still sitting in updates_testing.  What to do?   Dependent packages need recompile, how many?  And first see if even newer wxgtk version exist and update to that instead?  Or skip that?


Really, i think wxgtk update should better have been a separate bug to start with.


* Package kicad 5.1.10 - per above, in new bug; still currently latest, and have important fixes over 5.1.9

Note You need to log in before you can comment on or make changes to this bug.