Skip to content

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

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

Merged
merged 7 commits into from
Dec 25, 2024

Conversation

jcafhe
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor Author

jcafhe commented Dec 5, 2024

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

@kushalkolar kushalkolar changed the base branch from main to extinguish-fires December 25, 2024 04:35
@kushalkolar
Copy link
Member

I'm going to merge this into a temporary branch where we're updating things w.r.t. upstream changes like #686 where we're switching from pyav to ffmpeg.

@kushalkolar kushalkolar merged commit 0937309 into fastplotlib:extinguish-fires Dec 25, 2024
1 of 9 checks passed
clewis7 pushed a commit that referenced this pull request Jan 6, 2025
* use imageio[ffmpeg] instead of pyav (#686)

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

* fix typo in the requested limit name of the wgpu device.

* fix test config.

* fix examples/test and docs

* fix max-texture-dimension-2d limit name and replace underscore by hyphen for the other limits.

* fix missing dependency (libxrandr) to compile GLFW during building wheel for imgui-bundle.

* update CI timeout

* update timeout in non-nb test job

---------

Co-authored-by: Kushal Kolar <kushalkolar@gmail.com>

* update to use pygfx.TextureMap

* forgot to set imageio[ffmpeg] for all extras

* migrate to RenderCanvas, remove event_filter stuff for imgui since that was fixed in pygfx

* remove very old irrelevant example

* fix docstring

* update examples to use fpl.loop.run()

* update API docs

* black

* import ImageWidget only if imgui is installed

* enumerate_adapters() -> enumerate_adapters_sync()

* remove annoying warnings from cmap

* remove more cmap warnings

* black

---------

Co-authored-by: Jérémie Fache <jeremie.fache@netcourrier.com>
FlynnOConnell pushed a commit to FlynnOConnell/fastplotlib that referenced this pull request Jan 7, 2025
* use imageio[ffmpeg] instead of pyav (fastplotlib#686)

* fix typo in the requested limit name of the wgpu device (fastplotlib#679)

* fix typo in the requested limit name of the wgpu device.

* fix test config.

* fix examples/test and docs

* fix max-texture-dimension-2d limit name and replace underscore by hyphen for the other limits.

* fix missing dependency (libxrandr) to compile GLFW during building wheel for imgui-bundle.

* update CI timeout

* update timeout in non-nb test job

---------

Co-authored-by: Kushal Kolar <kushalkolar@gmail.com>

* update to use pygfx.TextureMap

* forgot to set imageio[ffmpeg] for all extras

* migrate to RenderCanvas, remove event_filter stuff for imgui since that was fixed in pygfx

* remove very old irrelevant example

* fix docstring

* update examples to use fpl.loop.run()

* update API docs

* black

* import ImageWidget only if imgui is installed

* enumerate_adapters() -> enumerate_adapters_sync()

* remove annoying warnings from cmap

* remove more cmap warnings

* black

---------

Co-authored-by: Jérémie Fache <jeremie.fache@netcourrier.com>
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy