OpenGL & OpenCL Ubuntu 18.04 and AMDGPU-PRO driver

Hi,
I am trying to use accelerated graphics with KiCad 5.0.0. I am prompted with a ‘Minimum OpenGL 2.1’ dialogue.
Under further investigation and reading previous posts I assumed this could be resolved perhaps by calling the libGL.so directly. However I think this is not the case and this does not work. It seems that KiCad is trying to call the open-source driver directly:

libGL error: failed to load driver: radeonsi

AFAIK this is only available to the system if AMDGPU is loaded. The PRO drivers do not seem to use this and it crashes out. Is this hard-coded into KiCad, or is the error coming from the driver itself? Can it be resolved.

I would consider reverting to the fully open source drivers, but then I will not have an OpenCL support which I need for other software.

Any suggestions?
Aidan

Looks to be a driver issue. Googling by that error message there are other reports on other softwares.
You may try to run KiCad in the command line
$ LIBGL_ALWAYS_SOFTWARE=1 kicad
and see if it runs openGL in software mode.

For some people the error was caused by 32-bit-only drivers installed with 64-bit Kicad.

Tom

Hmm, actually no.
libGL error: failed to load driver: swrast

So seems that the AMDGPU-PRO driver is not playing very nice with the system. I could try going back to the fully open-source drivers and see if this all resolves. However I posted to AMD about the issue and I will probably wait and see if they have any comments.
Aidan

It looks like it’s trying to load a software rasterizer driver instead of AMD’s glx.

Tom

Are you able to run other openGL programs? eg glxgears ? Is there a way to track which library kicad is calling and what glxgears is calling?

Looks like it is defo the AMDGPU-PRO driver at the root.
I just went ahead and went back to the fully open AMDGPU driver which I am keeping fully updated from the ppa:

When I have these installed I see no problems, seems all the KiCad programs are happy to use acceleration and I see no errors on the log.

So, whatever AMD have done they seem not to offer a suitable API. Maybe you have some useful info that I can throw at them.

Now I suppose I have to decide, do I want OpenCL or OpenGL. I think the reason for this is that the current OpenCL implementation which I think is offered by the package ‘mesa-opencl-icd’ (Mesa 18.3.0-devel) seems to only offer a OpenCL 1.1 framework. My app requires 1.2.

Although googling this seems to reveal that perhaps this is not entirely true. To say that this is rather convoluted is an under statement. But I see folks doing all sorts of funky stuff to try and get this working. I remember having troubles in the past trying to patch together a functional graphics driver environment and to be honest, it was not pretty.

So a quick question. How long do you think the legacy support for non-accelerated graphics will remain in place within Kicad. If this gets removed it will leave me without any options.
Aidan

To answer your question about other OpenGL software. Yes!! and very much a yes. I of course ran glxgears and received no errors. I also then ran some heavier tests using other kinda gaming oriented test suites and all seemed happy and report no problems with GL.

So…why do they work with the AMDGPU-PRO driver but Kicad does not?
Aidan

As far as I know KiCad there is no special treatment related to OpenGL. looks to me regular.
There maybe other libraries that are calling libGL.

If you found that it works on other OpenGL applications but not on KiCad, I suggest you create an issue in launchpad ( check the kicad website how to create a bug report ) and give a link to this thread and as much information as possible.

I think it would be useful to trace somehow the kicad and see where / which module is calling the lib.

Oh dear. It seems my choice is now being made for me. If I want to run Kicad that is.
Having just re-installed the AMDGPU-PRO 18.30 driver. I now crash out of Kicad (actually gerbview without warning and pcbnew if I try acceleration) with the following:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: radeonsi
mesa: for the -simplifycfg-sink-common option: may only occur zero or one times!
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: radeonsi
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Segmentation fault (core dumped)

Ah well, the old question now stands, who is to blame. Best stick with fully open and accept the lack of OpenCL support.
Aidan

Hi,
A quick update. I have worked around the issue by installing the AMDGPU-PRO driver using the --headless option. This installs AMDs kernel modules but AFAIK keeps the OpenGL implementation using the Ubuntu maintainers code base, as well as other things like Mesa and acceleration. OpenCL however uses the AMD driver and works as expected. Therefore I now have all applications playing together.

Thanks for the support. and I hope others have similar satisfactory experiences.
Aidan

2 Likes

Aidan,

Your issue might have already been resolved in 5.0 nightlies (see a related bug report). Try out 5.0 PPA, which will soon become 5.0.1 release.

Thanks for the suggestions, but I think I will stay with my current set-up. I think it makes sense, everything seems to be working and AFAIK it stays as close as possible to the fully open driver configuration. Though to be honest I am not quite sure whos code is doing what.
AMD say that the configuration I have opted for uses:
Base kernel drivers ( no accelerated graphics drivers) + Pro OpenCL (headless mode)

However what they mean by base kernel drivers is unclear to me. During install their script compiles kernel modules against the current running kernel, so I don’t see why they would do this unless the ‘All-open’ AMD kernel modules are different from the maintainers kernel modules. Which I’m pretty sure they are as I do see some differences in graphics outputs when running them. Subtle changes in mode switching etc. Having said this they seem to suggest that this configuration does not offer accelerated graphics, by which I’m not sure what they actually mean. Certainly the OpenCL framework is working and clearly accelerated a 5x improvement over software rendering. However I am not so clear about the OpenGL performance. Again glxgears works fine, KiCad loads and no longer complains about the OpenGL framework, but do I actually have any kind of acceleration. Dunno? Maybe is features such as video decode that are affected. I simply don’t know.

I read briefly that some functions of pcbnew actually require OpenGL to function, cant remember what that was, maybe you could give me some suggestions about how to thoroughly test the KiCad features against my current OpenGL configuration.

Sorry for the long winded response and your help so far.
Aidan

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.