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

error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch DSI official display #413

Closed
7aku8 opened this issue Apr 24, 2024 · 7 comments · Fixed by #416

Comments

@7aku8
Copy link

7aku8 commented Apr 24, 2024

Hey, I'm kinda noob in embedded programming so sorry if that's a trivial issue.
I've been struggling for few hours, trying to run Flutter app with flutter-pi on Raspberry pi 5 [4gb and Debian GNU/Linux 12 (bookworm)] with official touch screen display.

I skipped 4. step from "Configuring your Raspberry PI" as I wasn't able to find this setting in raspi-config. I also wasn't able to find GL driver settings so I enabled fake KMS manually by changing dtoverlay=vc4-kms-v3d to dtoverlay=vc4-fkms-v3d in config.txt file.

Display itself works fine.

I built an app with this command:

flutterpi_tool build --arch=arm64 --release

And then tried to run it with command:

flutter-pi --release /home/pi/ui

And I ended up with that error:

modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported
flutter-pi.c: Could not create drmdev from device at "/dev/dri/card0". Continuing.
flutter-pi.c: Device "/dev/dri/card2" doesn't have a display connected. Skipping.
egl_gbm_render_surface.c: Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: Invalid argument
egl_gbm_render_surface.c: Will retry without modifiers
modesetting.c: Couldn't add buffer as DRM fb. drmModeAddFB2WithModifiers: Invalid argument
egl_gbm_render_surface.c: Couldn't add GBM buffer as DRM framebuffer.
window.c: Couldn't present flutter layer on screen. surface_present_kms: Input/output error

I tried several different config.txt changes without any success. Setting option display_auto_detect to 0 disables whole screen.
What I can add is that it used to work just fine with HDMI display.

Do you guys have any ideas whether that's a library issue or I'm doing something wrong?

@7aku8 7aku8 changed the title error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch official screen error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch official display Apr 24, 2024
@7aku8 7aku8 changed the title error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch official display error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch DSI official display Apr 24, 2024
@ardera
Copy link
Owner

ardera commented Apr 25, 2024

Can you try without the fkms change? Could be that no longer works on Pi 5, though it shouldn't be necessary anymore anyway.

If the issue persists, can you post the output of the raspinfo command?

@7aku8
Copy link
Author

7aku8 commented Apr 25, 2024

Sure, so I reinstalled OS to make sure that other changes I did will not affect it. I went through the setup process once again, skipping fkms change. Finally I ran into exactly same issue as before.

raspinfo output

@7aku8
Copy link
Author

7aku8 commented Apr 30, 2024

@ardera FYI I tried to use Pi4 with 64-bit Raspbian Bullseye instead of Pi5 and it works perfectly fine.

@ardera ardera linked a pull request Apr 30, 2024 that will close this issue
@anirudh-walia
Copy link

running it on a rpi5 with a 3.5 inch tft display
getting this same error

modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported
flutter-pi.c: Could not create drmdev from device at "/dev/dri/card0". Continuing.
flutter-pi.c: Device "/dev/dri/card1" doesn't have a display connected. Skipping.
Segmentation fault

@ardera
Copy link
Owner

ardera commented May 2, 2024

@anirudh-walia That's not the same error. How is your TFT display connected to the Pi? What model?

@anirudh-walia
Copy link

My bad just saw the first few lines it's a 3.5-inch TFT display connected via GPIO pins the display is working fine with touch and everything.

LCD Type	
TFT

Interface	
SPI

Touch Screen Type	
Resistive Screen

Touch Controller	
XPT2046

Colors	
65536

Backlight	
Yes, LED

Resolution (Pixel)	
320*480

Aspect Ratio	
8:5

@mhnowak
Copy link

mhnowak commented Sep 25, 2024

Hi @ardera! I have similar issues like the ones above:

modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported
flutter-pi.c: Could not create drmdev from device at "/dev/dri/card0". Continuing.
flutter-pi.c: Device "/dev/dri/card2" doesn't have a display connected. Skipping.
egl_gbm_render_surface.c: Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: Invalid argument
egl_gbm_render_surface.c: Will retry without modifiers

I didn't worry about it earlier, but I noticed I cannot change colors in the app, so for example if I run the app with such code:

Scaffold(
      backgroundColor: Colors.red,
      body: ..
)

the background color stays the same default (white or whitish).

I also skipped these 2 steps on the Raspberry Pi configuration steps, as I couldn't find them in the raspi-config (I thought maybe they're configured like so by default? Idk, I'm a bit new to this)

3. You can skip this if you're on Raspberry Pi 4 with Raspbian Bullseye
Enable the V3D graphics driver:
Advanced Options -> GL Driver -> GL (Fake KMS)

4. Configure the GPU memory Performance Options -> GPU Memory and enter 64.

I feel like the errors, especially the ones to the surface.c might be related to lack of these configuration changes. Is there any other way to set those? Like you mentioned above some configuration file.

Possibly related to: #443 (comment)

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 a pull request may close this issue.

4 participants