CQ-Editor on Ubuntu 21.10

537 views
Skip to first unread message

Walt Z

unread,
Jan 8, 2022, 3:57:04 PM1/8/22
to CadQuery
I had CadQuery and CQ-Editor working on my Ubuntu machine, then I had to reinstall the OS and everything went south. 

In CQ-Editor, I'm now getting these errors:

Traceback (most recent call last):

File "cq_editor/widgets/occt_widget.py", line 131, in paintEvent

File "cq_editor/widgets/occt_widget.py", line 153, in _initialize

OCP.Aspect.Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: glXCreateContext failed.


If I run CQ-Editor from a command line, I see these:
walt:~$ CQ-editor.sh
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
Namespace(filename=None)
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast


The above mentions Wayland, but it doesn't matter if I'm using Wayland or X11.  I get the same error messages.

Any ideas???

Walt Z

unread,
Jan 8, 2022, 6:36:31 PM1/8/22
to CadQuery
Well, I seem to have stumbled on something.  Others have had similar issues with other apps.  One solution seems to be to tell the app to use a different C++ library by adding LD_PRELOAD to the CQ-editor line in CQ-editor.sh.  I did this, and now CQ-editor seems to be working.

So now the last line of my CQ-editor.sh file is this:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./CQ-editor/CQ-editor

Hopefully, this helps someone else in the future.

Adam Urbanczyk

unread,
Jan 9, 2022, 4:38:31 AM1/9/22
to CadQuery
Good to hear. Could you share some links? I'm interested in understanding the root cause. Do you know which C++ library was loaded without the LD_PRELOAD trick?

Walt Z

unread,
Jan 16, 2022, 5:14:59 PM1/16/22
to CadQuery
In Synaptic, I have libstdc++6 version  11.2.0-7ubuntu2

If I go find the library it's preloading, it's   libstdc++.so.6.0.29

Walt Z

unread,
Jan 16, 2022, 5:21:17 PM1/16/22
to CadQuery
Hmm...  So I have three libstdc++'s in Synaptic:

libstdc++-11-dev
libstdc++6 and
libstdc++6:i386

All are version 11.2.0-7ubuntu2

Zbyněk Winkler

unread,
Jan 26, 2024, 10:56:21 AM1/26/24
to CadQuery
I had the same problem and this solution worked for me. I have no idea why. I am on Debian 12 and I am running 0.2 release downloaded from github releases.

If I can help in anyway to debug this, feel free to give me some instructions.

Best regards,
Zbyněk

Zbyněk Winkler

unread,
Jan 27, 2024, 6:23:40 AM1/27/24
to CadQuery
When I run without the preload I get these errors in the terminal:
When I look at the loaded libraries at runtime, in the ok case the
iris_dri.so is loaded. Checking that with ldd I see it is linked with
libstdc++. The included version is probably too old for lib_dri.co to
load. Maybe just not including libstdc++ in the package would work? If
the system version is newer than the included one I guess.

Zbyněk
> --
> cadquery home: https://github.com/CadQuery/cadquery
> post issues at https://github.com/CadQuery/cadquery/issues
> run it at home at : https://github.com/CadQuery/CQ-editor
> ---
> You received this message because you are subscribed to the Google Groups "CadQuery" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/aea2de46-4d5e-4a06-84e9-425e72e98d2dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages