Bad 3D render of circular pads

Bug #1782852 reported by Hildo Guillardi Júnior
42
This bug affects 10 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Unassigned

Bug Description

Some times (appear random until now) but reproduced on different machines with Ubuntu 16.04 running KiCad 6.0rc1 the circles from the pads and vias are rendered as squares.

Tags: 3d-viewer
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Full version information.

Application: kicad
Version: 6.0.0-rc1-unknown-da35b16~65~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-130-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Jeff Young (jeyjey) wrote :

This bug has been around a long time, but was never reliably reproducible (https://bugs.launchpad.net/kicad/+bug/1670849).

Do you have a board which always exhibits this?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

@Jeff, I remember of read this in older reports, but is the first time on my machines.
But really the same problem for me (about the reliably to reproduce).

But I don't now why I tried to open a second 3D KiCad project view with the first 3D opened yet. And now I could reproduce 3 by 3 times that I tested (with different boards in different order).

So try (steps to reproduce):

1) Open KiCad project that you have;
2) Open it PCB;
3) View on 3D and keep opened;
4) Open a second board project that you have;
5) Open it PCB;
6) View it 3D.
7) Check the the 3D for the first project (in my tests) always render the circles as squares.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Also, after this I tried to render by the Raytracing the board (item 3) that was 3D-squared (after item 6) and the bug was being showed at the second board of the procedure above.

The bug never happens on Raytracing mode, just in the normal visualization.

Jeff Young (jeyjey)
summary: - Bad 3D reden of circles
+ Bad 3D render of circular pads
tags: added: 3d-viewer
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Was there some change in the 3D render code in last release? (list bellow)
Since than, that for me fixed https://bugs.launchpad.net/kicad/+bug/1783181, I try to reproduce the issue with the reported steps and something interesting:
1) I could not reproduce opening the second project in the 3D view;
2) But I reproduced not opening a thirty project with 3D;
3) The first 3D was not affected and the issue happens on the second and thirty in the same time.

Appear, I don't know how, after some MB of use by the 3D render motor this problem appear?

Since I can reproduce this yet, the developer want that I create some `gdb` report?

Application: kicad
Version: 6.0.0-rc1-unknown-994a9c5~65~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-130-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Just to keep tracking, still on 201808240852+51473d9~66~ubuntu16.04.1

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Hildo- Recent commit may address this issue. Please let use know if you still experience it with Sept 3rd's nightly builds.

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

Hi Seth, could you link here the related commit? I would like to have a look on it.

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Mario, I think this is the commit

https://git.launchpad.net/kicad/commit/?id=a6325aab291c74213597f96469ce0df58ca1d553

This is currently the latest commit on master.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

This really got some improvement! (version 201809031208+0d09128~66~ubuntu16.04.1)

But I still can reproduce it. Before was when I opened the second 3D visualization on my PC (another project). Now in the 4th project opened. The graph and the camera change are also more smooth now.

My version:
Application: pcbnew
Version: 6.0.0-rc1-unknown-0d09128~66~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-134-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Changed in kicad:
status: New → In Progress
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

From my point of view, there should be no relation with the commit "Replacing Tesselation", unless there are any cross memory corruption or something..
My guess cause of this issue is at: https://bugs.launchpad.net/kicad/+bug/1670849/comments/4

Revision history for this message
Seth Hillbrand (sethh) wrote :

@mrluzeiro-

I'm not familiar with the 3d pipeline. My comment was based on the CINFO3D_VISU::createNewPadWithClearance() function. Perhaps this is not used?

If it is, then the pad triangulation might affect the issue. Given Hildo's report, I suspect that this may be a limitation on resources. Otherwise, I wouldn't expect a difference when open 1 at a time vs. 4 at a time.

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

I've just installed ubuntu enviroment ( disclamer: on a Linux distro ) and I manage to get the issue but after tried it a lot. The simple reproduce steps didn't produced any issue.
After that I tried again for a long time with up to 4 board open in 3D Viewer and I didn't get the issue.
My GPU is about 6 or more years old and is a basic OEM NVidia that comes from desktop PC vendor.
What are your GPUs and drivers?

@Seth: Generally only polygons are triangulated on 3D Viewer. On this case, the circular pads are rendered as 2 textured masked triangles. Thats why we see it in the bug as square points, because pads are rendered as a square with a texture mask.

So it is possible that this texture is being corrupted (or outdated?) in GPU or the handler ID is corrupted on CPU.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

The computer that I can't reproduce it anymore is a 8 year old, so possible because I can open a lot of projects.

$ lspci -vnn | grep VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07) (prog-if 00 [VGA controller])
 Subsystem: Dell Mobile 4 Series Chipset Integrated Graphics Controller [1028:02aa]
 Flags: bus master, fast devsel, latency 0, IRQ 16
 Memory at f6c00000 (64-bit, non-prefetchable) [size=4M]
 Memory at e0000000 (64-bit, prefetchable) [size=256M]
 I/O ports at efe8 [size=8]
 [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
 Capabilities: <access denied>
 Kernel driver in use: i915
 Kernel modules: i915

00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)
 Subsystem: Dell Mobile 4 Series Chipset Integrated Graphics Controller [1028:02aa]

The other one is a this year computer. Also Itel Graphics, I can post more informations and debugs after, but I am happy because now I have to open more than three project for reproduce the issue, before was always at the second 3D.
Basically both notebooks use the same software and OS distro (Ubuntu 16.04), the hardware is the same base (of course, new Intel processor and GPU) plus 1 external display (I don't know if this can affect this issue).

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Notebook which I can reproduce the issue yet:

lspci -vnn | grep VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:5916] (rev 02) (prog-if 00 [VGA controller])
 DeviceName: Onboard IGD
 Subsystem: Dell Device [1028:0782]
 Flags: bus master, fast devsel, latency 0, IRQ 280
 Memory at d4000000 (64-bit, non-prefetchable) [size=16M]
 Memory at b0000000 (64-bit, prefetchable) [size=256M]
 I/O ports at f000 [size=64]
 Expansion ROM at <unassigned> [disabled]
 Capabilities: <access denied>
 Kernel driver in use: i915_bpo
 Kernel modules: i915_bpo

00:04.0 Signal processing controller [1180]: Intel Corporation Skylake Processor Thermal Subsystem [8086:1903] (rev 02)

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Hildo- Can you downgrade the i915 kernel driver on your new machine (with the problem) from i915_bpo to i915? Or does the card not work with the stock 16.04 i915?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

How to do that, can you link some tutorial?

Revision history for this message
Seth Hillbrand (sethh) wrote :

1) Add the following line to /etc/modprobe.d/blacklist.conf

blacklist i915_bpo

2) Run `sudo update-initramfs -u`
3) Reboot

To revert the changes, remove the added line and re-run the command in step 2.

Revision history for this message
Jeff Young (jeyjey) wrote :

We've had quite a few people run into this so I'm bumping up the importance at least until (a) we figure out what's causing it or (b) we throw up our hands.

Changed in kicad:
importance: Undecided → High
status: In Progress → Triaged
status: Triaged → Confirmed
Revision history for this message
Jeff Young (jeyjey) wrote :

(I also knocked of the "In Progress" as no developer is assigned. If someone is working on it, feel free to correct. ;)

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

I am still try to reproduce it on a reproducible manner. I tried on two different hardware PCs with ubuntu unity manager.

Last time I managed to get the issue after open the 3rd board but I tried again and I could't reproduce again with 4 or more boards.

@jeyjey Jeff: do you know other people experience the issue, could you get information about the environment and hardware of their systems?

Revision history for this message
Jeff Young (jeyjey) wrote :

@Mario, I'm afraid I can't be much help. I only know it from the other bug report (which is likely a duplicate): https://bugs.launchpad.net/kicad/+bug/1670849.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I can't change the drive of the computer that I can reproduce the issue. But is it possible and viable to add some code to debug the 3D viewer and check the internal statistics? (buffer size, number of points, parts, calculated triangular parts, frame rate, ...)
Should this give us some clue?

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Hildo and @Mario-

Orson noted that a recent commit for lp:1817284 may have addressed this issue as well. Would you be able to check with tomorrow's (2/26) nightly build and see if the issue still reproduces for you?

The relevant commit is:
https://git.launchpad.net/kicad/patch/?id=269f420f8d338b1193c94f838eff2916d42d83bc

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I can't reproduce anymore at Ubuntu 16.04 (last Nightly released).
I even tried to open more than of 5 different projects.

Application: pcbnew
Version: 5.1.0-rc1-unknown-235f2c7~76~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-142-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009
Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

You can close this issue!
Now I am just getting https://bugs.launchpad.net/kicad/+bug/1817635 that may be related with some package.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

All Ok at 201902261031+036be7d~80~ubuntu16.04.1.

Revision history for this message
Seth Hillbrand (sethh) wrote :

OK. Thanks for reporting back! Glad to hear it's fixed.

Changed in kicad:
milestone: none → 5.1.0
status: Confirmed → Fix Committed
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

Hi Seth,
I checked the commit. Its a very minor change on GAL code, the code is not directly related with 3D Viewer but since the PCBnew GAL is using OpenGL and is managing the context, it may was related with the cause of this issue.

It would be great if this issue ( reported on other bug IDs ) could be tested on Windows platforms with this new build.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.