3D rendering not working reliably

Bug #1815286 reported by Ken Lowe
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

I’ve just upgraded from 4.07 to 5.0.2 on a Windows 10 x64 machine, and have run into a strange issue with 3D rendering using OpenGL. It all worked fine on 4.0.7.

If I start KiCad in Legacy mode and open up the 3D viewer, the PCB will render correctly. However, if I then close down the 3D viewer and open it back up again I just get a transparent via / pad view of the PCB. To get it working properly again I need to shut down KiCad completely and reopen it.

If I start KiCad in Modern Toolset mode I just get a transparent via / pad view of the PCB. I need to switch to Legacy mode, completely shut down KiCad again, and then reopen it to get the rendering to work.

I’ve tried completely uninstalling KiCad and then re-installing, but that didn’t make any difference. I've also tried various versions, including Stable version 5.0.2-1, and nightly builds.

I've also tried on another Win x64 machine, and it's worked on that machine without any problem.

The setup it fails on is:

Application: kicad
Version: (5.0.2)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    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

Graphics card is an AMD FirePro M6000 Mobility Pro, and I downloaded and installed the latest driver for this yesterday, but it didn’t make any difference.

Further details: https://forum.kicad.info/t/3d-rendering-not-working-reliably/15115

Tags: 3d-viewer
Revision history for this message
Ken Lowe (chaser2001) wrote :
Revision history for this message
Ken Lowe (chaser2001) wrote :
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :
tags: added: 3d-viewer
Ken Lowe (chaser2001)
description: updated
Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, any chance your recent fix handles this?

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

There's a good chance that the recent fix will change this behavior.

@Ken- Could you test with a new nightly build (2/26 or newer)?

Revision history for this message
Ken Lowe (chaser2001) wrote :

Just installed and tested the latest nightly:

2019-02-26T23:27:22.717Z 897.9 MB kicad-r12456.73f0b3087-x86_64.exe

but unfortunately I'm still seeing this problem.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ken, would you please post the board and 3D models files that cause the problem. Since the recent opengl fixes did not seem to resolve the issue. Perhaps it is an issue with your board and/or 3D models. If you cannot post it publicly, you can send it to me directly.

Revision history for this message
Ken Lowe (chaser2001) wrote :

Hi. Simply creating a new PCB, and adding a basic footprint creates the problem for me. In the attached example, I've run up Pcbnew.exe and added footprint DIP-28_W15.24mm to a blank PCB. This pulls in the standard 3D image Package_DIP.3dshapes/DIP-28_W15.24mm.wrl.

As before, if I start Pcbnew.exe in Legacy mode, the 3d image generates correctly first time in the 3d viewer. But if I shut down the 3d viewer and reopen it, I just get a transparent via / pad view and need to completely restart Pcbnew.exe (or Kicad, if I've started Pcbnew.exe via Kicad) in Legacy mode to get the 3D viewer working again.

Even if I just add the footprint to the board and then press 'E' to get to the 3D settings in the Footprint Properties, I get the same problem. First time I go into the properties, it renders correctly. Second time it fails and requires me to restart Pcbnew.exe.

My 3D images are located at:

C:\Program Files\KiCad\share\kicad\modules\packages3d

KISYS3DMOD is set to:

C:\Program Files\KiCad\share\kicad\modules\packages3d\

This has all just been tested on the latest nightly build:

Application: pcbnew
Version: (5.1.0-22-g7e34a5a10), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

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

Revision history for this message
Ken Lowe (chaser2001) wrote :
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ken, I tested the sample board you provided and I'm still not seeing this no matter how many times I open and close the 3D viewer. I'm thinking it might be a video driver issue. Do you have the latest video driver installed on your system? If not, updating them may help resolve your issue. Does your system use one of the older Intel video chips (the model number escapes me at the moment)? I know we've had some issues with them in the past.

Revision history for this message
Ken Lowe (chaser2001) wrote :

Thank you for looking into this for me. I'm running Kicad on a Dell Precision M6700 laptop with an AMD FirePro M6000 Mobility Pro graphics adaptor. I downloaded and installed the latest driver for this from AMD the other week, but it didn’t make any difference.

According to the AMD control centre, this is what I'm running:

Radeon Pro and AMD FirePro Software Version - 18.Q4.1
Radeon Pro and AMD FirePro Software Edition - Radeon Pro Software Enterprise Edition
Windows Version - Windows 10 (64 bit)
System Memory - 16 GB
CPU Type - Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz

I notice from the Dell support page that a new driver was released Feb 19. I'll try installing that one instead of the one I downloaded from the AMD site, and report back.

Revision history for this message
Ken Lowe (chaser2001) wrote :

Just installed the Dell driver, but it's exactly the same. Here's some more details from the AMD control centre, if it's of any help:

Radeon Pro and AMD FirePro Settings Version - 2018.1220.1801.32454
Driver Packaging Version - 18.30.28-181220a-337843C-RadeonProEnterprise
Provider - Advanced Micro Devices, Inc.
2D Driver Version - 8.1.1.1634
Direct3D® Version - 9.14.10.01359
OpenGL® Version - 24.20.11000.13543
OpenCL™ Version - 24.20.13028.22
AMD Mantle Version - 9.1.10.0278
AMD Mantle API Version - 102400
AMD Audio Driver Version - 10.0.1.7
Vulkan™ Driver Version - 2.0.49
Vulkan™ API Version - 1.1.77

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ken, thanks for the information. I believe we started using opengl shaders in version 5.0 which may be the issue. This requires opengl 2.1 or later. I cannot tell from the AMD version info what version of opengl support is provided by this driver. The latest opengl version is 4.6 so I'm not sure what 24.20.11000.13543 is telling me. Anyone else out there successfully using kicad 5.0 or 5.1 with an ATI/AMD graphics card?

Revision history for this message
Ken Lowe (chaser2001) wrote :
Download full text (39.3 KiB)

@Wayne - According to OpenGL Extensions Viewer, my laptop is running OpenGL v4.6 (although it appears to be using shading language version 4.50). It's worth noting that I have been able to get Kicad 5 running on another PC with an AMD graphics card without any problem.

Here's a detailed report from OpenGL Extensions Viewer running on the laptop that doesn't render correctly:

Renderer: AMD FirePro M6000 Mobility Pro Graphics
Vendor: ATI Technologies Inc.
Memory: 1792 MB
Version: 4.6.13543 Core Profile Forward-Compatible Context FireGL 24.20.13028.22
Shading language version: 4.50

Max texture size: 16384 x 16384
Max vertex texture image units: 32
Max texture image units: 32
Max geometry texture units: 32
Max anisotropic filtering value: 16
Max viewport size: 16384 x 16384
Max Clip Distances: 8
Max samples: 8

GL Extensions: 317
\i0

GL_ARB_tessellation_shader
GL_ARB_parallel_shader_compile
GL_ARB_half_float_pixel
GL_EXT_compiled_vertex_array
GL_AMD_shader_stencil_value_export
GL_WIN_swap_hint
GL_EXT_packed_depth_stencil
GL_EXT_texture_lod_bias
GL_EXT_provoking_vertex
GL_EXT_direct_state_access
GL_ARB_color_buffer_float
GL_ARB_shader_image_load_store
GL_ARB_texture_compression_bptc
GL_ARB_texture_compression_rgtc
GL_AMD_interleaved_elements
GL_ARB_draw_instanced
GL_ARB_derivative_control
GL_EXT_draw_buffers2
GL_ARB_viewport_array
GL_ARB_gpu_shader_fp64
GL_ARB_pipeline_statistics_query
GL_EXT_texture_shared_exponent
GL_ARB_draw_elements_base_vertex
GL_ARB_arrays_of_arrays
GL_ARB_vertex_type_10f_11f_11f_rev
GL_ARB_window_pos
GL_ARB_explicit_attrib_location
GL_EXT_texture_env_dot3
GL_ARB_texture_float
GL_AMD_blend_minmax_factor
GL_ARB_texture_snorm
GL_ARB_point_parameters
GL_ARB_texture_compression
GL_KHR_no_error
GL_AMD_transform_feedback3_lines_triangles
GL_EXT_transform_feedback
GL_ARB_depth_buffer_float
GL_EXT_bindable_uniform
GL_ARB_shader_ballot
GL_EXT_timer_query
GL_ARB_vertex_buffer_object
GL_AMD_pinned_memory
GL_EXT_packed_float
GL_ARB_pixel_buffer_object
GL_EXT_texgen_reflection
WGL_NV_float_buffer
GL_NV_texture_barrier
GL_ATI_envmap_bumpmap
GL_ARB_separate_shader_objects
GL_ARB_buffer_storage
GL_AMD_seamless_cubemap_per_texture
GL_ARB_query_buffer_object
WGL_EXT_framebuffer_sRGB
GL_AMD_draw_buffers_blend
GL_ARB_fragment_program_shadow
GL_EXT_texture_object
WGL_EXT_swap_control
GL_ARB_shading_language_100
GL_ARB_program_interface_query
WGL_ARB_extensions_string
GL_KHR_debug
GL_ARB_compute_shader
GL_KTX_buffer_region
GL_ARB_get_texture_sub_image
GL_ARB_texture_storage
GL_EXT_packed_pixels
GL_EXT_memory_object
GL_EXT_blend_func_separate
GL_ARB_shader_viewport_layer_array
GL_ARB_gpu_shader5
GL_EXT_texture3D
GL_ARB_texture_env_crossbar
GL_AMD_name_gen_delete
GL_EXT_stencil_wrap
GL_ATI_fragment_shader
GL_ARB_ES3_compatibility
GL_EXT_subtexture
GL_ARB_texture_swizzle
GL_ARB_transpose_matrix
GL_EXT_semaphore
GL_EXT_shader_image_load_store
GL_AMD_conservative_depth
GL_EXT_texture_compression_bptc
GL_EXT_texture_compression_latc
GL_EXT_texture_compression_s3tc
GL_EXT_texture_compression_rgtc
GL_ARB_vertex_program
GL_EXT_texture_sRGB
GL_NV_copy_depth_to_color
WGL_EXT_pixel_format_packed_float
WGL_EXT_swap_control_tear
GL_NV_float_buffer
GL_A...

Revision history for this message
Brice Hope (grape8pe) wrote :

I'm having the same issues. All the problems go away when I pull the WX 3100 from my PC and run everything using the integrated Intel HD 530 graphics.

Below is some information about my setup. I've also posted to the linked KiCad forum post. Let me know if you need additional information.

Dell Optiplex 7040
i7-6700
48GB RAM
KiCad version: 5.1.2_1, release build
Windows 10 version 1809
AMD Radeon Pro WX 3100, driver set Radeon Pro version 19.Q1.2

Revision history for this message
Brice Hope (grape8pe) wrote :
Revision history for this message
Brice Hope (grape8pe) wrote :
Revision history for this message
Brice Hope (grape8pe) wrote :

This shows there are 3D parts to be rendered with RayTracing enabled but the OpenGL engine is failing to load the PCB correctly. All parts load correctly when I remove my AMD WX 3100 graphics card and run KiCad using integrated graphics (Intel HD 530).

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Brice, thanks for the extra data point. This definitely seems like a driver issue. I used to use AMD/ATI cards a long time ago but found their opengl support to be spotty so I switched to nvidia. I'm not sure we can do anything about this.

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

The OpenGL engine on 3D Viewer works differently on version 5. It is using some (legacy) OpenGL capabilities to speedup the load and render of the board polygons so it does not need to compute some boolean operations between layers.

As it was implemented using +10 years old OpenGL(considered legacy) it may be that the new GPU drivers are implementing something different, or did I implement something incorrectly that is now show up with this drivers..

Revision history for this message
Ken Lowe (chaser2001) wrote :

The problem I have seems to be more to do with some form of 3D initialisation.

If I start Kicad in Legacy mode I can always get the OpenGL rendering to work until such times as I close down the 3D viewer. If I then restart the 3D viewer the rendering fails. I need to close down Kicad completely, and restart it again (in Legacy mode) to get the OpenGL rendering to work again.

Why should 3D rendering work when starting Kicad in Legacy mode, but fail when starting in Modern toolset mode? This behaviour is very consistent.

Revision history for this message
Brice Hope (grape8pe) wrote :

I can confirm Ken's comments. My system is having very similar features. Sometimes 3D content will load, but once it fails once, KiCad has to be restarted.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ken, are you using KiCad 5.1.2? I'm not sure Brice's issues are the same as yours although they may be related. The legacy canvas is disable in 5.1.2 so your starting in legacy canvas may be a different issue.

Revision history for this message
Ken Lowe (chaser2001) wrote :

I'm currently running 5.1.0-22-g7e34a5a10.

However, I must apologise. I have just tried starting Kicad again in Modern Toolset (Fallback) mode and 3D rendering does actually work on initial startup. But again it only works until I shut down the 3D viewer. Thereafter I just get the skeleton view.

I've just downloaded the latest nightly, and will install it now and test again.

Revision history for this message
Ken Lowe (chaser2001) wrote :

That's confused me a little bit. I've just installed the latest nightly, and its still reporting a version 5.1.0 (467-gb7e67073e). Same result, so I'm now downloading the latest stable release 5.1.2 and will try it instead.

Also, I've just re-tested Kicad startup on the three different toolsets. 3D rendering fails completely with the Modern Toolset (Accelerated) only. If I startup in Legacy or Modern Toolset (Fallback) modes, then 3D rendering works; but only until I shut down the 3D viewer. If I reopen the viewer, it then fails to render correctly until I completely restart Kicad.

Revision history for this message
Ken Lowe (chaser2001) wrote :

Exactly the same with 5.1.2 stable build.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I don't think any of our windows devs have an AMD/ATI graphics card that they can test with so I'm not sure if we can resolve this issue any time soon. I didn't notice but I'm assuming you are using the latest and greatest drivers for your graphics cards.

Revision history for this message
Brice Hope (grape8pe) wrote :

I'm using the latest drivers from AMD.

Revision history for this message
Ken Lowe (chaser2001) wrote :

As am I.

Revision history for this message
Brice Hope (grape8pe) wrote :

An interesting note is that when browsing the PCB using 3D Viewer using the RayTracing option, everything works fine, even the pre-rendering when moving the object. But my guess is the pre-rendering when in RayTracing is CPU generated and doesn't leverage the GPU (OpenGL).

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

Hi Brice.
Its true that Raytracing is mostly is CPU generated but still is using some openGL commands to render the image.

Regarding the OpenGL issue, could you clarify: are you able to render the 3D models (footprint 3d shapes) correctly while getting the transparent board bug?

Revision history for this message
Brice Hope (grape8pe) wrote :

Hi Mario,
No, STEP files do not render (Footprint Properties->3D Settings). The only thing that renders is a transparent PCB and copper pads.

Revision history for this message
Ken Lowe (chaser2001) wrote :

Same here. Once it breaks, both footprint 3d shapes, and the 3D board viewer stop working, and render only the transparent PCB and copper pads.

Revision history for this message
Brice Hope (grape8pe) wrote :

Crazy theory here, could this just be a problem with Radeon Pro hardware? Is anyone out there with a consumer ATI card having issues?

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

So it sounds stranger.
There may be other bugs here not just GPU related or it maybe that at some point there is some disturbance on the OpenGL machine, as you can see, even the axis arrows are not rendered :\

Revision history for this message
Ken Lowe (chaser2001) wrote :

@Brice - it could be hardware related, but the fact that we can get it working again by just fully restarting the application tells me that it's something that can be fixed in software. Why does a restart of the application fix it? As I said before, it sounds like an OpenGL (re)initialisation issue in Kicad.

@Mario - Have you been able to test on AMD hardware to see the axis arrows aren't rendering, or did you pick this up from one of the attachments?

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

I just saw it in the attachments.

I dind't tested recently with a new AMD GPU on Windows.
I had one "recent" ( +5 years old ) AMD GPU but it stoped to work :/

But since I did the 3D Viewer some years ago, there were some changes globaly related with OpenGL contexts issues and GAL.
So it may triggered this bug and we are only now seeing the first reports of it.

Would anyone sponsor me a more recent AMD GPU where I can reproduce the bug so I may give some tests? :)

Revision history for this message
Jaroslav Kašpar (jkaspar) wrote :

Same issue on AMD FirePro W6150M, windows 10. Ray tracing works, however it is not being rendered by GPU at all. Only by CPU.

Revision history for this message
Brice Hope (grape8pe) wrote :

@Jaroslav - I actually removed my WX3100 GPU and running my system using the integrated Intel GPU. KiCad is much slower but at least 3D rendering works properly.

Revision history for this message
wenmao (wenmao) wrote :

Hi.Every one,
I am a new user of the KiCAD software and my display card is the AMD Redeon W4300. I found the 3D viewer module of the current version KiCAD (v5.1.5) can not work on my computer. On the default display driver configuration, it just displayed the PCB with Pads and wire in the 3D viewer without the 3D component, like the above mentioned.

I think it's definitely the driver issue and the AIDA64 says that the display card can support the OpenGL v2.1 as the system requirements of the KiCAD software.So I decided to make a display card with more powerful options than the default display card configuration.

I tried many times and finally found a workable way as the attachment. And I think my experience could help about this issue. Please kindly note that my operation system is Microsoft Windows 10.

By the way, I am a Chinese user and my system language is Chinese. I found a funny thing that it just work when I change the display language of the <AMD Redeon Pro Setting> program to Chinese. I don't know why but I think when the language changes the program will be restart, and maybe the restart is the reason.

Revision history for this message
wenmao (wenmao) wrote :

Hi. Everyone,
I cannot attach more than 1 pictures in a comment. So I create more than one comments to make a detailed description.
This is the 3D preview that with the default setting of my display card. Of course it did not work.

Revision history for this message
wenmao (wenmao) wrote :

Hi. Everyone,
I cannot attach more than 1 pictures in a comment. So I create more than one comments to make a detailed description.
This is the 3D preview that with the enhanced setting of my display card. Of course it works.

Revision history for this message
wenmao (wenmao) wrote :

Hi. Everyone,
I cannot attach more than 1 pictures in a comment. So I create more than one comments to make a detailed description.
This is the 3D viewer with the enhanced display card setting. It also works.

Revision history for this message
Ian McInerney (imcinerney) wrote :

The KiCad project has moved to GitLab for its bug tracking. You can follow this bug report here: https://gitlab.com/kicad/code/kicad/issues/2547.

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

Hi Wenmao, could you follow the Ian sugestion and report there the your findings?
Also, could you post a configuration of your GPU when it was not working? so.. what did you changed to make it work?

Revision history for this message
Ken Lowe (chaser2001) wrote :

@wenmao - Thank you for the pointer. I've just created a KiCad profile, making only a single change to the default setting, and it's now working for me too! The only change I made was to switch Anti-aliasing Mode from 'Override application settings' to 'Use application settings' and it's now rendering correctly!!! :)

I'll make a similar post over at gitlab.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/2547

Changed in kicad:
status: New → Expired
Changed in kicad:
importance: Undecided → Unknown
status: Expired → 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.