Skip to content
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

fix typo in the requested limit name of the wgpu device #679

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jcafhe
Copy link

@jcafhe jcafhe commented Nov 22, 2024

Hi,

when running different examples involving images, the following exception is raised:

Traceback (most recent call last):
  File "***\fastplotlib\examples\gridplot\gridplot_non_square.py", line 20, in <module>
    figure[0, 0].add_image(data=im)
  File "***\fastplotlib\fastplotlib\layouts\_graphic_methods_mixin.py", line 75, in add_image
    return self._create_graphic(
           ^^^^^^^^^^^^^^^^^^^^^
  File "***\fastplotlib\fastplotlib\layouts\_graphic_methods_mixin.py", line 24, in _create_graphic
    graphic = graphic_class(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "***\fastplotlib\fastplotlib\graphics\image.py", line 126, in __init__
    self._data = TextureArray(data, isolated_buffer=isolated_buffer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "***\fastplotlib\fastplotlib\graphics\_features\_image.py", line 24, in __init__
    self._texture_limit_2d = shared.device.limits["max-texture-dimension2d"]
                             ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'max-texture-dimension2d'

It fails for the following examples (non-exhaustive list), on windows10, python 3.12.6, pygfx 0.6.0, wgpu 0.19.1 (can't test right now on linux because of an error related to imgui):

  • example/gridplot/*
  • heatmap/heatmap.py
  • image/*

I believe there's a typo in the string passed to the limits property of the wgpu.Device object. From the wgpu documentation (Rust), the constant is named 'max_texture_dimension_2d', at least since wgpu-0.10.1:
https://docs.rs/wgpu/latest/wgpu/struct.Limits.html#structfield.max_texture_dimension_2d

By appling the lower-case style, the examples now work by adding an hyphen before "2d". I don't know if it is specific to my setup, but this fix seems to be aligned with the wgpu API.

@kushalkolar
Copy link
Member

Thanks! Looks like this change in wgpu is now in the release: pygfx/wgpu-py#617

@jcafhe
Copy link
Author

jcafhe commented Nov 22, 2024

Nice find! This explains why there were no errors before. I didn't think to look at the issue tracker of pygfx.

@kushalkolar
Copy link
Member

test failures are due to pygfx/wgpu-py#644, need to wait for the next release of wgpu with pygfx/wgpu-py#645

@kushalkolar
Copy link
Member

If you can update the test as well it should be good to go! https://github.com/fastplotlib/fastplotlib/actions/runs/11975376261/job/33491202021?pr=679#step:8:24

@jcafhe
Copy link
Author

jcafhe commented Nov 26, 2024

That should be ok, all tests pass on my machine, with pygfx installed from its main branch, to be aligned with the CI setup :
pip install git+https://github.com/pygfx/pygfx.git@main.

Do you think that the required pygfx version should be updated too, in the setup.py?

@jcafhe
Copy link
Author

jcafhe commented Nov 26, 2024

Sorry, there are still some errors. I will investigate ...

@kushalkolar
Copy link
Member

Looks like there are no imgui wheels for python 3.10 so it's trying to build but it requires libxrandr-dev, you can add it to the same place where all other apt packages are installed here and here

@jcafhe
Copy link
Author

jcafhe commented Nov 27, 2024

Thanks. I've added the installation of xorg-dev which should contain libxrandr for ubuntu, as suggested in GLFW documentation.

@kushalkolar
Copy link
Member

had to update the CI timeout, it takes longer since it has to build imgui 1.5.2 for python 3.10. Anyways this PR will fix all those issues: pygfx/wgpu-py#649

@kushalkolar
Copy link
Member

kushalkolar commented Dec 2, 2024

ok now it looks like the latest release of pyav 14 hours ago breaks imageio https://github.com/PyAV-Org/PyAV/releases

posted in imageio: imageio/imageio#1111

@jcafhe
Copy link
Author

jcafhe commented Dec 5, 2024

ok, no problem, so we just have to wait I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants