-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matplotlib 3.8.0 is unable to create a basic plot #1276
Comments
Thanks! I was just creating an issue, but you were faster ;-) |
I haven't looked into this at all, but I will note that there are many more
|
I will try installing 3.8.4 via pip3 with the dependent libraries from the spack-stack build and see if that resolves the issue. If not, I will try bumping other versions (e.g. numpy) to see if that resolves it. |
It not, I'll see if I can reopen the matplotlib GitHub issue. |
The issue appears to be with numpy, and specifically when compiled with Intel. It's a little tricky to replicate as well: module use /scratch1/NCEPDEV/nems/Alexander.Richert/spack-stack-py311-aug24/envs/test/install/modulefiles/Core
module load stack-intel stack-python py-matplotlib
python simple_plot.py # returns an error
module unload py-numpy/1.25.2
module load py-pip
python -m venv venv
. venv/bin/activate
pip install py-numpy==1.25.2
python simple_plot.py # success! |
I should mention that upgrading to matplotlib==3.8.4 did not resolve the issue. |
Thanks for looking into this. Just to confirm, this works fine if py-numpy is compiled with GNU? And this is on Hera, right? I'll try to build a GNU and Intel environment on another system at NRL to reproduce this. |
@climbfuji I'm not sure if this works with GNU or not, but probably. All I have confirmed is that it works when pip installs the binaries, which are almost certainly GNU-compiled. |
We always compiled numpy with openblas, with both GNU and Intel, for many releases of spack-stack. That hasn't changed on Hera as far as I know. |
@DavidHuber-NOAA Unfortunately I cannot reproduce this on Nautilus. The machine uses
|
I built a basic gcc environment on Hera with the following spack.yaml: # spack-stack hash: ac43a4c
# spack hash: d8de455f35
spack:
concretizer:
unify: when_possible
view: false
include:
- site
- common
definitions:
- compilers: ['%gcc']
- packages:
- [email protected]
- [email protected]
specs:
- matrix:
- [$packages]
- [$compilers]
packages:
all:
prefer: ['%gcc'] Numpy built with openblas and I was able to generate the plot. I then built this same environment with Intel and was unable to make the plot, receiving the same > module use /scratch1/NCEPDEV/global/David.Huber/SPACK/ss_matplotlib/envs/matplotlib_intel/install/modulefiles/Core
> module load stack-intel stack-python py-matplotlib
> module list
Currently Loaded Modules:
1) intel/2022.1.2 6) libxcrypt/4.4.35 11) stack-python/3.11.7 16) py-numpy/1.25.2 21) py-kiwisolver/1.4.5 26) py-six/1.16.0
2) stack-intel/2021.5.0 7) zlib-ng/2.1.6 12) libpng/1.6.37 17) py-pybind11/2.11.0 22) py-packaging/23.1 27) py-python-dateutil/2.8.2
3) glibc/2.28 8) sqlite/3.43.2 13) openblas/0.3.24 18) py-contourpy/1.0.7 23) libjpeg/2.1.0 28) qhull/2020.2
4) tar/1.26 9) util-linux-uuid/2.38.1 14) python-venv/1.0 19) py-cycler/0.11.0 24) py-pillow/9.5.0 29) py-matplotlib/3.8.0
5) gettext/0.21.1 10) python/3.11.7 15) py-setuptools/63.4.3 20) py-fonttools/4.39.4 25) py-pyparsing/3.1.2 |
Besides the openblas/mkl difference between Nautilus and Hera, the only other difference I see is |
@climbfuji I tried rebuilding the environment with
I have two more ideas: 1) try building again with |
external gettext? |
Building the environment with intel-MKL instead of openblas did not fix the issue. @climbfuji Good suggestion. I'll try an external gettext package. |
I'm also going to open a matplotlib issue. |
@climbfuji I'm unable to concretize with the system gettext:
buildable: false
externals:
- spec: [email protected]
prefix: /usr And here is the output of ==> Error: concretization failed for the following reasons:
1. cannot satisfy a requirement for package 'py-setuptools'. Any suggestions? |
Not really, but what I would try is to unpin py-setuptools or pin it to a different version if you get duplicates |
@climbfuji I wasn't able to unpin py-setuptools as I got duplicates and attempting to pin it to something newer caused conflicts with [email protected], so I updated py-numpy to 1.26.4 instead. This did not solve the issue. I then used the system gettext (0.19.8.1), but that also did not solve the issue. I accidentally installed this last round with openblas instead of Intel-MKL, but I doubt that is the issue given that the problem occurred previously with Intel-MKL/[email protected]. I'm not sure where to go from here, but would gladly take suggestions for you and/or @AlexanderRichert-NOAA. |
I'm going to try rebuilding the environment but pointing at the gcc-compiled version of py-numpy. |
@DavidHuber-NOAA I installed the spack-stack-1.8.0 release candidate on S4 for testing, and I was able to create simple plots with matplotlib. S4 uses [email protected]. |
Building with the gcc-compiled py-numpy was successful. I will wait for an official release candidate installation on Hera then try the test again. |
@DavidHuber-NOAA I need to correct my previous statement. I was able to plot a different, simple plot on S4. Your simple_plot.py fails in the same way on S4 as it does on Hera. |
OK, good to know. Thanks for the correction. I'll keep working with my installation on Hera, then. The matplotlib developers may have an idea on how to fix the issue 🤞 |
That would be great. I am changing py-numpy versions back by one major number at a time, in the hope that it will work with a somewhat more recent version than what we had in spack-stack-1.7.0. I am also checking on the oneapi compilers, and there are no problems with [email protected] and [email protected]. |
@DavidHuber-NOAA I got it to work with After all, Intel classic will be going away soon ... and there is no problem with the LLVM-based compilers with 1.25.2 / 3.8.0. |
Fantastic! Alright, that sounds like a plan to me. |
I'll keep working with the matplotlib folks and let them know of this workaround. |
We have a workaround in place for spack-stack-1.8.0: use We need to keep this issue open until the issue is fixed upstream (matplotlib/matplotlib#28762), or until we switch to the Intel LLVM compilers for C/C++. Whichever solution, hopefully it is in time for spack-stack-1.9.0. |
Describe the bug
The matplotlib python library is unable to generate a basic plot, i.e. https://matplotlib.org/stable/gallery/lines_bars_and_markers/simple_plot.html. There may be a bug between the version of matplotlib and another python library. Another user reported the same bug, though it was never resolved: matplotlib/matplotlib#23923.
To Reproduce
Expected behavior
A basic sine-wave plot would be generated.
System:
At least Hera
Additional context
Found while testing Python 3.11.7 upgrade #1217.
The text was updated successfully, but these errors were encountered: