Bug 262802 - cad/kicad: opengl related problems + 3d view does not work in 6.0.3/6.0.4 but works in kicad-devel.
Summary: cad/kicad: opengl related problems + 3d view does not work in 6.0.3/6.0.4 but...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-25 16:45 UTC by Tomasz "CeDeROM" CEDRO
Modified: 2022-05-08 11:33 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (cmt)


Attachments
3d view problems also in footprint properties editor (346.84 KB, image/jpeg)
2022-03-26 01:07 UTC, Tomasz "CeDeROM" CEDRO
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz "CeDeROM" CEDRO 2022-03-25 16:45:45 UTC
Hello world :-)

There seems to be a problem with KiCAD 6.0.3 and 6.0.4:
1. It does not work with OpenGL render. Fallback to non-accelerated works. Clearing out the configuration files does not help.
2. 3D View does not work at all in 6.0.3 and 6.0.4.
3. 3D View does work with no problem in kicad-devel.
4. OpenGL works fine on the machine, 13-STABLE latest kernel + drm + amdgpu, some games work and acceleration is okay.

Below is attached version info on KiCAD 6.0.4 built from latest ports. Screenshot of a problem is attached.

Best regards :-)
Tomek


Application: KiCad Footprint Editor

Version: 6.0.4, release build

Libraries:
	wxWidgets 3.1.5
	libcurl/7.81.0 OpenSSL/1.1.1k zlib/1.2.11 libssh2/1.10.0 nghttp2/1.46.0

Platform: FreeBSD 13.1-STABLE amd64, 64 bit, Little endian, wxGTK, , 

Build Info:
	Date: Mar 25 2022 16:39:11
	wxWidgets: 3.1.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.72.0
	OCC: 7.6.0
	Curl: 7.81.0
	ngspice: 36
	Compiler: Clang 11.0.1 with C++ ABI 1002

Build settings:
	KICAD_USE_OCC=ON
	KICAD_USE_EGL=ON
	KICAD_SPICE=ON
	KICAD_STDLIB_DEBUG=OFF
	KICAD_STDLIB_LIGHT_DEBUG=OFF
	KICAD_SANITIZE_ADDRESS=OFF
	KICAD_SANITIZE_THREADS=OFF
Comment 1 Tomasz "CeDeROM" CEDRO 2022-03-26 01:07:25 UTC
Created attachment 232725 [details]
3d view problems also in footprint properties editor

3d view problems also in footprint properties editor
Comment 2 Tomasz "CeDeROM" CEDRO 2022-03-26 01:16:37 UTC
I have reported that bug in KiCAD upstream:
https://gitlab.com/kicad/code/kicad/-/issues/11237
Comment 3 Torfinn Ingolfsen 2022-04-15 13:14:44 UTC
I can confirm this problem. FreeBSD 13.0-release, quarterly packages. Details:

root@kg-core2:~ # freebsd-version -ku
13.0-RELEASE-p11
13.0-RELEASE-p11
root@kg-core2:~ # pkg -vv | grep url
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",
root@kg-core2:~ # pkg info kicad\*
kicad-6.0.4,2
kicad-library-footprints-6.0.4
kicad-library-packages3d-6.0.4
kicad-library-symbols-6.0.4
kicad-library-tmpl-6.0.4

3D viewer does not work at all.
Comment 4 Torfinn Ingolfsen 2022-04-15 13:16:22 UTC
(In reply to Torfinn Ingolfsen from comment #3)
Kicad info
Application: KiCad Schematic Editor

Version: 6.0.4, release build

Libraries:
	wxWidgets 3.1.5
	libcurl/7.82.0 OpenSSL/1.1.1k zlib/1.2.11 libssh2/1.10.0 nghttp2/1.46.0

Platform: FreeBSD 13.0-RELEASE-p11 amd64, 64 bit, Little endian, wxGTK, , 

Build Info:
	Date: Apr  5 2022 11:33:15
	wxWidgets: 3.1.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.72.0
	OCC: 7.6.0
	Curl: 7.82.0
	ngspice: 36
	Compiler: Clang 11.0.1 with C++ ABI 1002

Build settings:
	KICAD_USE_OCC=ON
	KICAD_USE_EGL=ON
	KICAD_SPICE=ON
	KICAD_STDLIB_DEBUG=OFF
	KICAD_STDLIB_LIGHT_DEBUG=OFF
	KICAD_SANITIZE_ADDRESS=OFF
	KICAD_SANITIZE_THREADS=OFF
Comment 5 Torfinn Ingolfsen 2022-04-15 13:30:20 UTC
Interesting enough, KiCad 6.0.4 package on Debian 11 (from bullseye-backports) has a working 3D viewer (both board and footprint). KiCad details:
Application: KiCad Schematic Editor

Version: 6.0.4+dfsg-1~bpo11+1, release build

Libraries:
	wxWidgets 3.0.5
	libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3

Platform: Linux 5.10.0-13-amd64 x86_64, 64 bit, Little endian, wxGTK, lightdm-xsession, x11

Build Info:
	Date: Mar 29 2022 16:51:55
	wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.74.0
	OCC: 7.5.1
	Curl: 7.74.0
	ngspice: 34
	Compiler: GCC 10.2.1 with C++ ABI 1014

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON

So it is not a generic problem with KiCad 6.0.4 (it could be that Debian folks was better / more lucky in picking a packaging point in time).
Comment 6 Tomasz "CeDeROM" CEDRO 2022-04-21 03:02:11 UTC
I have switched to port kicad-devel (r20220320001656). It works like a charm.

No problems with 3D Viewer and finally the Accelerated Video works as expected. This is really a hyperjump in user experience and work quality to have more than 1FPS hahah ;-)

What is more. After recent updates of GTK system packages some additional assertions and crashes showed up in 6.0.4 release. But also these are gone in kicad-devel.

With a monthly timeframe of minor releases KiCAD 6.0.5 should show up any time soon I hope all would work well with that release. I will report back when it shows up :-)

ps/2: I also observe bad video performance with current FreeCAD and Blender ports. Simple rebuild does not fix the problem. Something else needs to be fixed also on the upstream (build?) part. This KiCAD issue may be the hint :-)
Comment 7 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2022-05-06 12:50:50 UTC
I've update kicad to 6.0.5 a few days back - does that help? (there's some opengl related fixing in there...)
The 3d part doesn't really work for me at all (and I never checked it before) - I believe that's because my graphics driver lies about it's capabilities (maybe Linus was right, after all)
Comment 8 Tomasz "CeDeROM" CEDRO 2022-05-06 13:00:06 UTC
Thanks CMT! At last 6.0.5 showed up two days ago (20220504).. we still have 6.0.4 in packages.. but there is a port for 6.0.5 already!

The biggest problem with switching from a release to master is file format changes that are not backward compatible, so it is usually impossible to go back to a release :-( Also other folks using 6.0.4 could not open my PCB design made with devel.

I will check the 6.0.5 out and report back :-)
Comment 9 Tomasz "CeDeROM" CEDRO 2022-05-06 13:03:50 UTC
Regarding the 3D view it works like a charm in KiCAD-DEVEL port for me. Clearly it has 3D acceleration. I am using AMDGPU DRM. Other programs like WM (Enlightenment) videos etc also have hardware acceleration. Maybe you can review your DRM+Xorg configuration? :-)
Comment 10 Tomasz "CeDeROM" CEDRO 2022-05-06 13:45:08 UTC
Results are NEGATIVE for 6.0.5 :-(
1. 3D Viewer still drops "Unknown Error" and is inoperational.
2. File formats created with kicad-devel package are not compatible with kicad-6.0.5.

Looks like I am tied to devel for a while.

This 3D part is essential in my project because in iterations PCB is exported to 3D models that are then used by a mechanical team to create/adjust the casing then fixes are introduced to PCB that is then updated to match the casing etc.
Comment 11 Tomasz "CeDeROM" CEDRO 2022-05-06 13:52:01 UTC
I have updated the upstream report that 3D View issue still exists in 6.0.5 on FreeBSD:
https://gitlab.com/kicad/code/kicad/-/issues/11237
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-05-07 15:31:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4f80881f60588b2d02541647ceb7d635928faac9

commit 4f80881f60588b2d02541647ceb7d635928faac9
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2022-05-07 15:29:23 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2022-05-07 15:29:23 +0000

    cad/kicad: attempt to fix 3D-Viewer by using bundled GLEW

    The 3D-Viewer (e.g. from the Footprint Editor) may fail to start
    with an "Unknown error" message. Investigation indicates that
    kicad really needs it's bundles libGLEW, using the system one
    was a mistake.
    While here, fix a possible nullpointer dereference in the 3D cache
    destructor - this is only relevant when the 3D viewer fails unexpectedly,
    but then it is quite annoying during debugging.

    PR:             262802
    Reported by:    Tomasz "CeDeROM" CEDRO

 cad/kicad/Makefile                                           |  5 +++--
 .../files/patch-3d-viewer_3d__cache_3d__cache.cpp (new)      | 12 ++++++++++++
 cad/kicad/files/patch-thirdparty_glew_CMakeLists.txt (new)   | 10 ++++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)
Comment 13 Tomasz "CeDeROM" CEDRO 2022-05-08 11:33:52 UTC
Thank You CMT! 3D View now works fine! :-)