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

No acceleration on Linux #3073

Closed
rafaelcp opened this issue Aug 20, 2024 · 2 comments
Closed

No acceleration on Linux #3073

rafaelcp opened this issue Aug 20, 2024 · 2 comments
Labels

Comments

@rafaelcp
Copy link

I'm using Pygame on Ubuntu 22.04 (pygame-ce 2.5, SDL 2.30.6, Python 3.12.4, tried with legacy pygame before and same thing) and noticed that it was way slower than Pyglet. After a bit of search, I found about pygame.display.Info(), and here is its output:

<VideoInfo(hw = 0, wm = 1,video_mem = 0
blit_hw = 0, blit_hw_CC = 0, blit_hw_A = 0,
blit_sw = 0, blit_sw_CC = 0, blit_sw_A = 0,
bitsize = 32, bytesize = 4,
masks = (0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000),
shifts = (16, 8, 0, 0),
losses = (0, 0, 0, 8),
current_w = 640, current_h = 480
pixel_format = PIXELFORMAT_RGB888)

It seems it can't detect anything, it can't even do software acceleration. I have an RTX 3090 installed and being used normally by other applications. Any hints about what's happening and how to fix it?

@Starbuck5
Copy link
Member

I believe pyglet uses OpenGL.

Pygame-ce does not use OpenGL, which is why it is more portable than pyglet (it runs on raspberry pi). Our backend is SDL, and we use SDL_Surface based rendering, which is on the CPU. SDL has a gpu backend with SDL_Renderer and we are experimenting with bringing that API into pygame-ce, but it would be a separate API, outside of pygame.Surface.

Looking through our source code I don't see a path where video_mem would ever be populated.

@ankith26
Copy link
Member

I think this issue can be closed now that the question has been addressed. It isn't technically feasible to add hardware acceleration to the current API so as starbuck said, it will be implemented separately.

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

No branches or pull requests

3 participants