-
Notifications
You must be signed in to change notification settings - Fork 5
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
Cant run minimal example #16
Comments
Thanks for the report! It would appear that Could you run the following code for me and report the results? import pegl, platform
print('Python', platform.python_version(), 'on', platform.platform(terse=True))
dpy = pegl.Display()
print('EGL version:', dpy.version_string, 'by', dpy.vendor)
all_configs = dpy.get_configs()
print('Configs available:', len(all_configs))
if len(all_configs) > 0:
cfg = all_configs[0]
print('The first config...')
print('\tAPIs supported:', cfg.renderable_type)
print(f'\tColor buffer: {cfg.buffer_size}-bit', cfg.color_buffer_type.name)
else:
print('What kind of EGL implementation offers no configurations, anyway?!') For comparison, here's the results on the computer I'm currently at:
|
I get something pretty similar. Sorry I am not too familiar with this. Do not even know what configurations are! :').
|
Ok so I tried on my own laptop with integrated GPU that uses Mesa and it works. I am wondering if I can choose which vendor I want to use EGL from? Instead of NVIDIA I could choose Mesa, although it might come with decrease in rendering speeds? |
Well, colour me confused. To resolve the issue in your specific case, I'd suggest replacing the offending line with one of the following: # 1) Request configs that meet given requirements, but don't make API support
# one of the requirements. This one says a 32-bit colour buffer is required,
# but that's just for the sake of an example.
conf = dpy.choose_config({pegl.ConfigAttrib.BUFFER_SIZE: 32})[0]
# 2) Request configs that meet given requirements... and don't actually set any.
conf = dpy.choose_config({})[0]
# 3) Just grab the first available config and hope it works!
conf = dpy.get_configs(1)[0]
They're basically sets of graphics capabilities: "my program wants to use OpenGL ES 2 instructions to render into a 16-bit colour buffer that uses at least 1 bit for alpha", that sort of thing. I'd say you can browse the Pegl documentation for an explanation, but at present you'd have to build it yourself (clone repo, Even then, it's all written by me based on my own understanding and is in no way authoritative! You can check out the EGL specification for the official details; configs are covered in section 3.4. (Incidentally, looking that up has made me realise I mis-remembered how configs are sorted. Contrary to my off-hand comment in the test code earlier, the first config returned is not likely to be the most capable, but rather the reverse: it's likely to be the bare minimum that meets the given requirements. I'm just noting this here for my own reference, and for the sake of anyone who comes reading this issue later.)
This may be possible, but I'm afraid I don't know whether, or how well, it would work. You would need to make sure Mesa's EGL implementation is installed (something like |
Thanks for the explanation. Some updates. Following this tutorial from NVIDIA I was able to solve it. Basically, the default single attribute
Then, I bind |
Excellent! I'm glad you were able to find a solution. I still find it strange that they need all of that information (the EGL spec defines default search behaviour for when it's not supplied), but oh well. |
Hi,
Thanks for this code! Unfortunately I am not able to run the minimal example in the README. I get the following error. Any idea?
I have some
pyopengl
code which is usingglfw
at the moment but I would like to usepegl
to use in a headless server.The text was updated successfully, but these errors were encountered: