PCB not visible in "Accelerated"

Bug #1778203 reported by Nikolas Quaade Gonzalez on 2018-06-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
High
Maciej Suminski

Bug Description

Hi Guys

Im pretty new to Kicad, so hopefully this is not just a mistake by me.

I just upgraded to V5 nightly, And when trying to load a board with accelerated, the screen is simply empty. If I select an area it turns visible but as soon as I deselect it, it disappears again.

Kind regards
Nikolas Quaade Gonzalez

Application: kicad
Version: (5.0.0-rc2-193-gdd436b6), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.43.0 SecureTransport zlib/1.2.5
Platform: Mac OS X (Darwin 15.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.61.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.43.0
    Compiler: Clang 7.3.0 with C++ ABI 1002

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

Nick Østergaard (nickoe) wrote :

Does this also happen in fallback mode?

tags: added: gal pcbnew
Changed in kicad:
milestone: none → 5.0.0-rc3

It only happens when i run the file in "Accelerated".

It works when fine in Fallback, and Legacy.

Maciej Suminski (orsonmmz) wrote :

Nikolas, does it happen with every board? Can you try demo projects shipped with KiCad?
If it is board dependent, could you attach the board file that exposes the bug?

Hi Orson,

It seems to be board specific, since i can load other projects and KiCad demos. Since it is company property i can't post it here.

But i can send it to you by private mail. Can you send me the address?

Frank Severinsen (shack) wrote :

Nikolas' colleague here:
I just tested the board with following setup, with no issue.
Perhaps it's a MacOS thing?

Application: kicad
Version: 5.0.0-rc2-unknown-147c1e6~65~ubuntu18.04.1, release build
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-23-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    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_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

Maciej Suminski (orsonmmz) wrote :

Nikolas,

Please send me the board file, it will help us investigate the problem. You can find my e-mail in the Launchpad profile.

Maciej Suminski (orsonmmz) wrote :

I have succesfully opened the board on recent Arch Linux, Windows 7 and macOS 10.13.4.
Could you give some more details about the hardware, particularly the video card model? What macOS version do you use?

okay, i can see im running versin "10.11.6". I might be outdated.

My video card is a "intel HD Graphics 3000 512 MB"

Maciej Suminski (orsonmmz) wrote :

I suggest doing an update, but my gut feeling tells me you might be running out of video RAM. Try to disable zone filling display and antialiasing, perhaps it may help. Is there a discrete video card in your Mac?

Orson, i will start an update now. I dont think it has a discrete video card. It's from 2013.

Nick, I used the Nightly version.

Ill see if the update helps and let you know.

thank you :)

I have now updated my macbook pro to 10.13.5 with no results.

Stil has the same issue.

When i select an area with the mouse i can see what i've selected. if i click blindly and i hit a footprint right, it will light up. if i use the find option it will also light up.

any other ideas of what could cause this?

Seth Hillbrand (sethh) wrote :

Can you plot this file to Gerber and open it in GerbView using Accelerated? Also please try the steps that Orson suggested about unfilling the zones.

If it doesn't plot in GerbView either, then I think Orson is on the right track.

Maciej Suminski (orsonmmz) wrote :

There is one difference between displaying selected and unselected items: the former ones are displayed using Vertex Buffer Object, while the latter ones - Vertex Array. It might be a hint that there is a problem with the VBO method. It is a bit surprising though, as you say it works fine for simpler boards.

Nikolas, are you able to build KiCad manually? I can create a few patches that may help pinpoint the cause.

Wayne Stambaugh (stambaughw) wrote :

@Orson, it seems like this should be fixed for rc3. Any idea when you might have this fixed?

orson, I'm not able to build KiCad manually. Haven't gotten to that point yet i guess

If you have a .dmg you can upload or send me, it would be greatly appreciated :)

Maciej Suminski (orsonmmz) wrote :

Wayne, I am afraid it will take a lot of time. All machines I have handy (including a Macbook) display the board correctly even on integrated GPUs, so all I can do is to blindly throw patches at the problem and that is never fast or efficient. The discussed issue does not cause a crash and the board is still editable with Cairo, though I admit it is not very convenient with 6 layers.

Most likely it is a problem of lacking video memory or poorly implemented video driver, especially that the OP is able to load other, simpler boards. A potential solution involves rendering engine optimization which I would rather avoid in such late stage of the development cycle. Anyway, optimization will let us handle slightly complex boards with the same video card, but you will always find a design that will torture a video card.

Nikolas, could you try what Seth and I have suggested? Did you try unfilling the zones (please save and reload the board after doing so) or exporting gerbers and loading them in gerbview? It is an important data point for us.

Changed in kicad:
assignee: nobody → Maciej Suminski (orsonmmz)

Hi Orson and Seth

Antialiasing has always been off.
Removing the Zonefills did not make any difference except for ratsnets appearing.

When trying to load the Gerbers in Gerbview I had the exact same issue.

@Orson, fair enough. I will go ahead and tag rc3 once there is a fix
for the segfault bug Seth just reported. Thanks for looking into this.

On 6/25/2018 3:23 AM, Maciej Suminski wrote:
> Wayne, I am afraid it will take a lot of time. All machines I have handy
> (including a Macbook) display the board correctly even on integrated
> GPUs, so all I can do is to blindly throw patches at the problem and
> that is never fast or efficient. The discussed issue does not cause a
> crash and the board is still editable with Cairo, though I admit it is
> not very convenient with 6 layers.
>
> Most likely it is a problem of lacking video memory or poorly
> implemented video driver, especially that the OP is able to load other,
> simpler boards. A potential solution involves rendering engine
> optimization which I would rather avoid in such late stage of the
> development cycle. Anyway, optimization will let us handle slightly
> complex boards with the same video card, but you will always find a
> design that will torture a video card.
>
> Nikolas, could you try what Seth and I have suggested? Did you try
> unfilling the zones (please save and reload the board after doing so) or
> exporting gerbers and loading them in gerbview? It is an important data
> point for us.
>
> ** Changed in: kicad
> Assignee: (unassigned) => Maciej Suminski (orsonmmz)
>

Maciej Suminski (orsonmmz) wrote :

Hi Orson

Im gonna test those when I have some time (later today).
I tried deleting: zones, outline, tracks, vias and the problem was the same. if I removed enough pads (footprint) the board would load again. 1972ish seemed to be the cut. dont know if this is relevant knowledge in any way.

Board 1: Same issue
Board 2: Same issue untill I go -> Fallback -> Accelerated it works
Board 3: Same issue
Board 3: Same issue

This might just be a matter of lacking ressources

Maciej Suminski (orsonmmz) wrote :

Thank you for prompt response, it is indeed very useful information. Unfortunately, it may take some time before I come up with a potential solution.

One thing that still puzzles me is that you are still able to see the board when all items are selected. It seems as if there was a VBO size limit or mapped video memory size limit. I would expect a critical error when a video card runs out of memory.

Maciej Suminski (orsonmmz) wrote :

DISCLAIMER: The following advice might be risky and I do not take any responsibility if things go sideways. Proceed only if you know how to revert the mod.

If you feel adventurous, there is a mod that increases the amount of RAM assigned to the video card: https://forums.macrumors.com/threads/2011-intel-hd-3000-macbook-pro-1024mb-vram-kext-work.1977308/

Frank Severinsen (shack) wrote :

Hi @Orson

Im gonna bring Niko's laptop home with me today, in case you want me to test something for you.

Changed in kicad:
milestone: 5.0.0-rc3 → 6.0.0-rc1
Maciej Suminski (orsonmmz) wrote :

Hi Frank,

Thank you for the offer. Right now I do not have any patches to test, so you may only try luck with the mod I posted in #25. We have managed to determine that the problem is not board specific, but rather dependent on the number of displayed vertices. It means that only optimization may help, but it will take more time, most likely during v6 development cycle.

Seth Hillbrand (sethh) wrote :

Hi Orson/Frank-

The attached patch may help this situation. The theory is that the intel 3000 is forcing a software render due to bad pipeline (in Intel's driver) handling of the RGBA/UNSIGNED_BYTE combo.

Caveat: I can't recreate the issue, so this is spitballing at the moment.

Seth Hillbrand (sethh) wrote :

Second important caveat: I have not evaluated this patch for suitability beyond checking that it doesn't mess up my rendering under Linux. If it fixes the Mac issue, we will need to look closely for possible knock-on effects before merging.

Frank Severinsen (shack) wrote :

Just talked to Nick, he's gonna help me compile a version with Seth's patch. Ill report back later with the results

Maciej Suminski (orsonmmz) wrote :

Seth, how did you figure it out? It sounds plausible, but I wonder how one discovers such issues.

Seth Hillbrand (sethh) wrote :

Well, let's see if this works. The older Intels only used BGRA (actually ARGB) ordering to match the DirectX ordering and everything else went through software.

The alternative explanation might be https://bugs.webkit.org/show_bug.cgi?id=131867 But we check GL_MAX_TEXTURE_SIZE, so I'm less inclined to think that this is causing it.

Adam Wolf (adamwolf) wrote :

I added the patch and uploaded it to http://downloads.kicad-pcb.org/osx/frankie/kicad-unified-frank-20180629-132641-bbe81b0b3.dmg. Please use that for testing.

Hopefully it helps, otherwise hit me up and I can build new versions.

Hi Adam link gives me "nginx error!
The page you are looking for is not found.
Website Administrator"

Adam Wolf (adamwolf) wrote :

Sometime between last night and this morning, the whole directory was deleted from the server :( I am not sure who or what did that. I will try to get it uploaded again today.

Nick Østergaard (nickoe) wrote :

Mm, I deleted the frankie dir as I was makimg more space on the downloads server. I did't verify its contents.

Adam Wolf (adamwolf) wrote :

No problem.

Frank Here:

Here is what I get when I try to open your build @Adam:

pcbnew cannot be opened because of a problem.

Check with the developer to make sure pcbnew works with this version of macOS. You may need to reinstall the application. Be sure to install any available updates for the application and macOS.

Click Report to see more detailed information and send a report to Apple.

Seth Hillbrand (sethh) wrote :

Hi Frank-

Can you click "Report" and attach the report here?

Process: pcbnew [901]
Path: /private/var/folders/*/pcbnew.app/Contents/MacOS/pcbnew
Identifier: org.kicad-pcb.pcbnew
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: pcbnew [901]
User ID: 501

Date/Time: 2018-07-01 17:03:20.761 +0200
OS Version: Mac OS X 10.13.5 (17F77)
Report Version: 12
Anonymous UUID: 25F483EA-B50F-CA62-E090-69309A6CAA8E

Time Awake Since Boot: 2000 seconds

System Integrity Protection: enabled

Notes: Translocated Process

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @executable_path/../Frameworks/libwx_osx_cocoau_gl-3.0.0.dylib
  Referenced from: /private/var/folders/*/pcbnew.app/Contents/MacOS/pcbnew
  Reason: image not found

Binary Images:
       0x101514000 - 0x101586ff7 +org.kicad-pcb.pcbnew (??? - ???) <A59DFC7E-877E-3721-ABDC-48D0C3675F69> /var/folders/*/pcbnew.app/Contents/MacOS/pcbnew
       0x1021c5000 - 0x10220f9df dyld (551.3) <AFAB4EFA-7020-34B1-BBEF-0F26C6D3CA36> /usr/lib/dyld
    0x7fff4839a000 - 0x7fff48627ff7 com.apple.audio.toolbox.AudioToolbox (1.14 - 1.14) <4545D879-3520-36D1-A83D-F3993CC2FA6B> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7fff48cfb000 - 0x7fff48cfbfff com.apple.Carbon (158 - 158) <F8B370D9-2103-3276-821D-ACC756167F86> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x7fff4920d000 - 0x7fff4920dfff com.apple.Cocoa (6.11 - 22) <4CF8E31C-B5C7-367B-B73D-1A8AC8E41B7F> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x7fff4c226000 - 0x7fff4c2c1ff7 com.apple.framework.IOKit (2.0.2 - 1445.60.1) <7C16F358-1F63-349F-AD58-F7B287C7B7B7> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff53f64000 - 0x7fff53f73fff com.apple.opengl (16.5.10 - 16.5.10) <D51C7DE3-ABE0-3CED-BB9C-7D71C3205FB6> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff6f595000 - 0x7fff6f596ffb libSystem.B.dylib (1252.50.4) <CDA73F3E-2A7D-3354-818A-580317A03255> /usr/lib/libSystem.B.dylib

Frank here:

After some time I could open it from kicad -> PCBnew
The issue does however remain the same :/

Seth Hillbrand (sethh) wrote :

Thanks everyone for the effort in testing. I'm sorry that the issue doesn't appear to have an easy fix apart from falling back to Cairo.

Seth Hillbrand (sethh) wrote :

@Nikolas- Can you test a recent nightly build and see if the issue remains?

Frank Severinsen (shack) wrote :

@Seth
Niko tested the latest nightly and the issue still persist

Seth Hillbrand (sethh) wrote :

OK, thanks.

Jeff Young (jeyjey) wrote :

I'm going to bump up the importance of this at least until: (a) we find out what the issue is or (b) decide there's nothing we can do about it.

Changed in kicad:
importance: Undecided → High
staviq (staviq) wrote :

I think this might be related, and possibly can give you some clue:

I had this problem twice, but was unable to find a reproducible way to trigger this.

OSX Nightly builds ( happened in two different ones in the past month ).

Both times i have left kicad opened for a significant amount of time ( like days ), i never shutdown my macbook, and rarely close apps.

When i brought kicad window to the top to do something, i have noticed the board seems empty, but if i click randomly, some component becomes selected and visible, but if i esc the selection the board appears empty again.

Switching to fallback and again to accelerated fixed this issue right away both times.

I suspect, in my case, this happened after system hibernated and went back, the gpu memory was somehow purged, and kicad process was unaware of that, but it's just a wild guess.

staviq (staviq) wrote :

Forgot to add, i have the exact same gpu, osx 10.13.6.

Nick Østergaard (nickoe) wrote :

This looks slightly stale, could you please try to test with the latest nightly builds for the 5.0 branch.

http://downloads.kicad-pcb.org/osx/testing/5.0/

It looks like this issue is only seen for macos.

tags: added: macos
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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