lv_binding_micropython: Crash when using Nvidia cards with the SDL driver

Hi, I’m trying to run the example on linux (ubuntu 18.04), and when I run the micropython from https://github.com/littlevgl/lv_micropython I get only a black screen and the script stop running without any alert or errors.

This is the code that Im trying with the master branch.

import lvgl as lv
lv.init()
import SDL
SDL.init()

# Register SDL display driver.

disp_buf1 = lv.disp_buf_t()
buf1_1 = bytearray(480*10)
lv.disp_buf_init(disp_buf1,buf1_1, None, len(buf1_1)//4)
disp_drv = lv.disp_drv_t()
lv.disp_drv_init(disp_drv)
disp_drv.buffer = disp_buf1
disp_drv.flush_cb = SDL.monitor_flush
disp_drv.hor_res = 480
disp_drv.ver_res = 320
lv.disp_drv_register(disp_drv)

# Regsiter SDL mouse driver

indev_drv = lv.indev_drv_t()
lv.indev_drv_init(indev_drv)
indev_drv.type = lv.INDEV_TYPE.POINTER;
indev_drv.read_cb = SDL.mouse_read;
lv.indev_drv_register(indev_drv);

# Create a screen with a button and a label

scr = lv.obj()
btn = lv.btn(scr)
btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0)
label = lv.label(btn)
label.set_text("Hello World!")

# Load the screen

lv.scr_load(scr)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

@embeddedt yes, its something with nvidia, maybe with SDL and nvidia. I’m running the latest drivers (one of the reasons for using 18.04). But ok, its easy to change to intel and I only need to run in my machine to create screens. Thanks for the help!

@tve In the meantime, the v6 and v7 versions of the web simulator are alive and well, and aren’t that much more limited than the PC simulator if you’re just looking to experiment with the API. Do be aware that v7 runs significantly closer to native speed on the web than v6 does.

It crashes somewhere inside the Nvidia driver and not our code, but no further debugging information is available, which makes it nearly impossible to pinpoint the issue. I assume you are using the latest drivers?

Then run gdb micropython.

And then type run in the gdb prompt to actually run MicroPython.

@amirgon Thanks, yeah the prompt is working fine. I just run the code with ctrl + e and ctrl +d and got segfault.

In that case, the next step is to build it with debug symbols (clean the build, and build again with DEBUG=1 on the make command line). Then run gdb micropython.

You should get a stack trace that could shed some light on what’s going on.
My wild guess would be - something with the SDL driver.

Hi @luckcfm !

Let’s start by making sure the REPL (interactive console) is working. When you run micropython without any parameter, do you get a prompt? Something like:

MicroPython v1.11-435-g2940838-dirty on 2019-09-27; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> 

If you do, try the following:

  • Click <kbd>CTRL</kbd>+<kbd>e</kbd>
  • Paste the simple example code above.
  • Click <kbd>CTRL</kbd>+<kbd>d</kbd>

You should get this: image

Let me know how far you got.