Open hermancollin opened 3 years ago
Hi @hermancollin, I'm wondering if your desktop environment is using Wayland? What version of wxpython do you have installed?
If you're using wayland, and have an older version of wxpython, you might be able to get things working by setting the GDK_BACKEND
variable, e.g.:
GDK_BACKEND=x11 fsleyes
Or, if you update to the latest version of wxpython (4.1.1), it should work under wayland without any extra configuration needed.
Hmm my desktop environment is KDE 5.82.0 / Plasma 5.21.5. Not sure about wayland. Anyway I saw that GDK_BACKEND=x11
trick in an older issue but it doesn't help on my side.
Also, I have the latest version of wxpython installed (4.1.1). Currently, I'm trying to install fsleyes in an isolated conda environment. Here is pip freeze
output:
Did you install wxpython via conda-forge as well?
The default behaviour of the conda-forge / pypi wxpython releases changed between 4.1.0 and 4.1.1 - 4.1.0 tries to interact with OpenGL via GLX, whereas 4.1.1 tries to interact with OpenGL via EGL. So if you are experiencing the error as reported (noting that the wxwidgets code pathway is hitting functions in unix/glx11.cpp
, and thus using GLX), this suggests that you were using wxPython 4.1.0 or older, or you are using a wxPython from somewhere other than pypi / conda-forge.
At the moment, controlling whether wxPython/wxWidgets uses GLX or EGL to interface with OpenGL is a compile-time choice - there is a bit more information in this issue
Thanks you for your feedback @pauldmccarthy
wxpython was installed via conda-forge as well. Still not sure how to fix the issue. My linux distro is arch-based. I tried installing the latest FSL version from AUR but there is an issue on arch with the required gcc9 package so I can't install FSL either...
Would you be able to post the output of conda list
, just to double check the sources of all of the installed packages? As I explained earlier, it doesn't make sense that wxpython 4.1.1 would be trying to use GLX, as EGL/GLX selection is a compile-time choice, and the wxpython conda-forge package is compiled to use EGL.
To create an isolated conda environment that just contains FSLeyes and wxPython should be as simple as:
conda create -c conda-forge -p ./fsleyes.env python=3.9 fsleyes
conda activate ./fsleyes.env
# or maybe this, depending on how you have configured conda
source <miniconda>/bin/activate ./fsleyes.env
fsleyes
Right now I have wxpython 4.1.0 but I tried with the latest 4.1.1 as well.
And what error do you get when running against 4.1.1? I can't see how you would get the reported error if you are using 4.1.1
I get the reported error with 4.1.1:
WARNING idle.py 579: __idleLoop - Idle task create crashed - wxAssertionError: C++ assertion ""tempContext"" failed at /home/conda/feedstock_root/build_artifacts/wxpython_1614187172070/work/ext/wxWidgets/src/unix/glx11.cpp(498) in wxGLContext(): glXCreateContext failed
Traceback (most recent call last):
File "/home/herman/.conda/envs/fsleyes_venv/lib/python3.7/site-packages/fsl/utils/idle.py", line 576, in __idleLoop
task.task(*task.args, **task.kwargs)
File "/home/herman/.conda/envs/fsleyes_venv/lib/python3.7/site-packages/fsleyes/gl/__init__.py", line 681, in create
self.__createWXGLContext()
File "/home/herman/.conda/envs/fsleyes_venv/lib/python3.7/site-packages/fsleyes/gl/__init__.py", line 883, in __createWXGLContext
self.__context = wxgl.GLContext(self.__canvas, **kwargs)
wx._core.wxAssertionError: C++ assertion ""tempContext"" failed at /home/conda/feedstock_root/build_artifacts/wxpython_1614187172070/work/ext/wxWidgets/src/unix/glx11.cpp(498) in wxGLContext(): glXCreateContext failed
Interestingly, switching back to 4.1.0 and trying to launch fsleyes, I get additionnal informations and a "hard" crash (it crashed instead of hanging):
The program 'fsleyes' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
(Details: serial 544 error_code 2 request_code 152 minor_code 3)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
If I launch fsleyes again, the program will hang.
Sorry, I made a mistake - there is actually another factor at play here, which is the version of GTK that the wxPython build was compiled against - all versions compiled against GTK2 will use GLX, whereas the versions compiled against GTK3 will use EGL. So both of the versions of wxpython that you have tried will be using GLX.
Can we simpliffy things a bit? Instead of trying to run fsleyes
, can you try and run glxgears
and glxinfo
(and post the output of the latter)? You may need to install them, although I don't know how the Manjaro/Arch package manager works, so can't help you with that.
Both glxgears
and glxinfo
were already installed. Here is the output:
Sorry, I'm stumped. Do you get the same errors against both wxpython versions when running FSLeyes with the GDK_BACKEND
variable set? i.e.
GDK_BACKEND=x11 fsleyes
Unfortunately I get the same error with both wxpython versions and the GDK_BACKEND
variable set.
At this point, should I try building wxpython from source?
I'm afraid you might have to, unless by chance one of the pre-built wheels at https://extras.wxpython.org/wxPython4/extras/linux/ is compatible with your system..
Building wxpython isn't too complicated, as long as you have all of the dependencies installed. I have a script for Ubuntu platforms, which should work against the wxPython-4.1.1
tag on the Phoenix repository: https://github.com/pauldmccarthy/fsleyes/blob/master/.docker/scripts/compile_wxpython4.sh
Hey there. fsleyes hangs on startup on my side. I'm on linux 5.10.35-1-rt39-MANJARO. The team I work with have an older version of fsleyes (0.33.1) running inside a conda venv and everything works fine for them but I can't get it to work anymore. I tried installing the latest fsleyes version from conda-forge but still no luck. This is the error I got:
What do you guys think of this? Seems to be an issue with wxPython