Closed danschef closed 3 years ago
This is an issue for root
as well. Getting llvmlite
from pip
avoids the issue so I suspect it's an issue with how llvmlite is dynamically linking to LLVM.
Actually it's not that simple, it's still a problem if I switch to static linking by removing this line:
I can get a working binary if I:
--link-static
when calling llvm-config
hereThe CMake build can be fixed by applying:
diff --git a/ffi/CMakeLists.txt.old b/ffi/CMakeLists.txt
old mode 100644
new mode 100755
index d87735c..59f1b4b
--- a/ffi/CMakeLists.txt.old
+++ b/ffi/CMakeLists.txt
@@ -61,3 +61,4 @@ list(REMOVE_ITEM llvm_libs "OptRemarks")
# Link against LLVM libraries
target_link_libraries(llvmlite ${llvm_libs})
+set_property(TARGET llvmlite APPEND_STRING PROPERTY LINK_FLAGS "-Wl,--exclude-libs,ALL")
Probably something in the qgis
stack is statically linking LLVM and doesn't use a (correct) version script. Probably switching that component to dynamic LLVM linkage should help here.
Yup, that was the problem for root
(static linking is essential in this case but the symbols weren't being hidden correctly).
Creating the environment and grep
ing for symbols I don't notice anything suspicious. My best guess would be that it's an OpenGL issue on @danschef's machine with the graphics card driver linking to LLVM without hiding the symbols. Similar to the bug being reported here:
IIRC export LIBGL_ALWAYS_INDIRECT=1
can help in some cases as a workaround for the buggy drivers.
@chrisburr Thanks a lot for looking into this! I just installed qgis + numba again on another machine (Kubuntu 17.04) and there is no error when importing numba within the QGIS Python console. So, at least, this does not seem to be a Linux issue in general. Is there anything I can do to make sure it is not an OpenGL issue only on my machine as you guessed?
Here is the output of conda list on that second machine:
I am using a fresh MambaForge:
What GPU and driver do you have on the problematic machine?
Does the glxinfo output help?
Yup, that was very helpful. Did you try running with export LIBGL_ALWAYS_INDIRECT=1
?
Wow, that works!
Excellent! In that case it is the mesa bug I that I linked earlier. Upgrading mesa should fix it but you probably don't want to do that unless you're upgrading the entire VM for other reasons. 😄
There is not much that can be done from conda-forge's perspective unfortunately so I'll close this.
I updated all packages on that server and got no error anymore. Thanks a lot for all for your efforts, that was really helpful!
I did:
sudo apt update
# 170 packages upgradable
sudo apt upgrade
sudo apt update
# all packages up-to-date
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
# 14 packages upgradable
sudo apt upgrade
sudo apt update
# all packages up-to-date
sudo apt install mesa
# E: Unable to locate package mesa
I am not sure why mesa can´t be located in the last step, however everything seems to work fine now.
rolled back to the amdgpu-install and now clinfo works again so both intel gpu and radeon gpu are working with opencl and obs works.
I initially filed this issue in the numba-feedstock (see here). However, @henryiii pointed me to LLVM, so I re-open the issue here:
Issue:
I am currently involved in the development of a QGIS plugin that uses numba under the hood (requires llvmlite) and there seems to be a compatibility issue between numba and QGIS on Linux (at least on my Ubuntu 20.04 machine).
When installing qgis and numba from conda-forge into the same environment, qgis crashes when trying to import numba via the QGIS Python console. Here is a minimal environment that reproduces the issue:
$ conda create -n qgisnumba -c conda-forge qgis numba
This installs the following environment (
conda list
):QGIS can than be started by running
qgis
on the command line and everything works fine. However, as soon as I open a Python console within QGIS and import numba, QGIS crashes and raises the following error at the command line:Note that when I start a Python console directly on the command line (without QGIS), I can import qgis and numba without any issues. So the error only occurs when numba is imported from the QGIS command line (or by a QGIS plugin which uses numba). We also tested this with the same environment on Windows, without any issues.
Details about
conda
and system (conda info
):