Ubuntu-frame not starting on device using imx-drm

Hi,

Working on a arm dev board that supports a imx8mp, which has a small touch screen connected via a MIPI DSI. Thought I would try running ubuntu-frame, but it’s failing to start fully.

Final error seems to be Mir fatal error: Failed to perform buffer swap , but I will include the full log below in case there are other clues.

If anyone has any pointers to getting it working it would be appreciated :+1:

Here is the log:

2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: + exec /snap/ubuntu-frame/3901/usr/local/bin/frame
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.440422] <information> mirserver: Starting
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.441553] < - debug - > mirserver: Using Linux VT subsystem for session management
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.442082] <information> mircommon: Loading modules from: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.442259] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.442345] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/server-x11.so.20
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.442386] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/input-evdev.so.8
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.445350] <information> mirserver: Found display driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.448943] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver galcore
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.449326] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card0 supports KMS, continuing with lower confidence
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.449766] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver imx-drm
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.449969] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card1 supports KMS, continuing with lower confidence
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450263] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450729] <information> mirserver: Driver supports:
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450789] <information> mirserver: 	/devices/platform/40000000.mix_gpu_ml/drm/card0 (priority 128)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450814] <information> mirserver: 	/devices/platform/display-subsystem/drm/card1 (priority 128)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450856] <information> mirserver: Found display driver: mir:x11 (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.450929] <information> mirserver: (Unsupported by system environment)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.451124] <information> mirserver: Selected display driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.452412] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver galcore
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.452673] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card0 supports KMS, but continuing anyway
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.452755] <information> gbm-kms: Using DRM device /dev/dri/card0
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.453113] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver imx-drm
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.453310] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card1 supports KMS, but continuing anyway
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.453376] <information> gbm-kms: Using DRM device /dev/dri/card1
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: MESA-LOADER: failed to open vivante: /snap/ubuntu-frame/3901/graphics/dri/vivante_dri.so: cannot open shared object file: No such file or directory (search paths /snap/ubuntu-frame/3901/graphics/dri, suffix _dri)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: failed to load driver: vivante
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.519218] <information> mirserver: Selected display driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.520732] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver galcore
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.521315] < -warning- > gbm-kms: Failed to open DRM device node /dev/dri/card0: /build/mir-p5QAkY/mir-2.9.0/src/server/console/linux_virtual_terminal.cpp(167): Throw in function {anonymous}::DRMDevice::DRMDevice(mir::VTFileOperations&, const char*, std::unique_ptr<mir::Device::Observer>, const std::shared_ptr<mir::LinuxVirtualTerminal::DeviceList>&)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: Dynamic exception type: boost::wrapexcept<std::system_error>
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: std::exception::what: Failed to claim DRM master: Device or resource busy
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [boost::errinfo_file_name_*] = /dev/dri/card0
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.521796] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver imx-drm
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.522125] < -warning- > gbm-kms: Failed to open DRM device node /dev/dri/card1: /build/mir-p5QAkY/mir-2.9.0/src/server/console/linux_virtual_terminal.cpp(167): Throw in function {anonymous}::DRMDevice::DRMDevice(mir::VTFileOperations&, const char*, std::unique_ptr<mir::Device::Observer>, const std::shared_ptr<mir::LinuxVirtualTerminal::DeviceList>&)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: Dynamic exception type: boost::wrapexcept<std::system_error>
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: std::exception::what: Failed to claim DRM master: Device or resource busy
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [boost::errinfo_file_name_*] = /dev/dri/card1
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.523002] <information> mircommon: Loading modules from: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.523225] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.523334] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/server-x11.so.20
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.523386] <information> mircommon: Loading module: /snap/ubuntu-frame/3901/usr/lib/aarch64-linux-gnu/mir/server-platform/input-evdev.so.8
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.526580] <information> mirserver: Found rendering driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.528408] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver galcore
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.528908] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/renderD128, driver galcore
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: MESA-LOADER: failed to open vivante: /snap/ubuntu-frame/3901/graphics/dri/vivante_dri.so: cannot open shared object file: No such file or directory (search paths /snap/ubuntu-frame/3901/graphics/dri, suffix _dri)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: failed to load driver: vivante
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.550179] <information> gbm-kms: Detected software renderer: llvmpipe (LLVM 12.0.0, 128 bits)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.552451] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver imx-drm
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.992778] <information> gbm-kms: Detected software renderer: llvmpipe (LLVM 12.0.0, 128 bits)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.994882] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995045] <information> mirserver: Driver supports:
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995075] <information> mirserver: 	/devices/platform/40000000.mix_gpu_ml/drm/renderD128 (priority 128)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995098] <information> mirserver: 	/devices/platform/display-subsystem/drm/card1 (priority 128)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995137] <information> mirserver: Found rendering driver: mir:x11 (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995163] <information> mirserver: (Unsupported by system environment)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995326] <information> mirserver: Selected rendering driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.995479] <information> mirserver: Selected rendering driver: mir:gbm-kms (version 2.9.0)
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.996614] < - debug - > gbm-kms: No EDID data available on connector 35
2022-10-12T19:31:30Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:30.996804] < -warning- > gbm-kms: Unable to determine the current display mode.
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009515] <information> gbm-kms: DRM device details:
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009652] <information> gbm-kms: /dev/dri/card0: using driver vivante [vivante DRM] (version: 1.0.0 driver date: 20170808)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009773] <information> gbm-kms: 	KMS not supported (Couldn't get DRM resources: Operation not supported)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009823] <information> gbm-kms: /dev/dri/card1: using driver imx-drm [i.MX DRM graphics] (version: 1.0.0 driver date: 20120507)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009934] <information> gbm-kms: 	Output: DSI-1 (connected)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009966] <information> gbm-kms: 		Mode: 720×1280@60.21
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.009998] < - debug - > miral: Display config using layout: 'default'
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.010138] <information> miral: Display config:
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: 8>< ---------------------------------------------------
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: layouts:
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: # keys here are layout labels (used for atomically switching between them)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: # when enabling displays, surfaces should be matched in reverse recency order
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:   default:                         # the default layout
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:     cards:
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:     # a list of cards (currently matched by card-id)
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:     - card-id: 0
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:       DSI-1:
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # This output supports the following modes: 720x1280@60.2
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         #
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # Uncomment the following to enforce the selected configuration.
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # Or amend as desired.
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         #
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # state: enabled	# {enabled, disabled}, defaults to enabled
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # mode: 720x1280@60.2	# Defaults to preferred mode
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # position: [0, 0]	# Defaults to [0, 0]
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # orientation: normal	# {normal, left, right, inverted}, defaults to normal
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # scale: 1
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]:         # group: 0	# Outputs with the same non-zero value are treated as a single display
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: 8>< ---------------------------------------------------
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: [2022-10-12 19:31:31.010299] < -warning- > gbm-kms: drmModeCrtcSetGamma failed: Function not implemented
2022-10-12T19:31:31Z ubuntu-frame.daemon[2076]: Mir fatal error: Failed to perform buffer swap
2022-10-12T19:31:31Z systemd[1]: snap.ubuntu-frame.daemon.service: Main process exited, code=killed, status=6/ABRT

Cheers, Just

Hi @jocado,

The driver requirements for Frame are described here:

I can’t find much information on the Mesa imx-drm drivers, but I suspect that they are not capable of supporting Frame.

[edit]

The best approach to getting Frame working on a board like this would be to package the propitiatory Vivante drivers as a content snap using the graphics-core20 interface. Technically, that should “just work”, but you’d need to check the legality of distributing these drivers.

the free evnativ driver should be enough to get working GLES …

Thanks Both. I’m hunting around for info about the Vivante drivers atm.

@ogra I’m not familiar with the driver you mentioned - can you share a link to point me in the right direction ?

Cheers, Just

oops, sorry, i did a dyslexic typo :slight_smile: it is etnaviv

it should be in the kernel tree since 2016 though:

https://lists.freedesktop.org/archives/dri-devel/2015-December/096202.html

Let’s just say I can very much relate to that :slightly_smiling_face:

Great - thanks for the info, will dig into it :+1:

Cheers, Just

@jocado you might find the Etnaviv drivers in kisak-core20. This is essentially an updated version of Mesa compared to the mesa-core20 snap that Frame uses by default:

snap install --edge kisak-core20
snap disconnect ubuntu-frame:graphics-core20
snap connect ubuntu-frame:graphics-core20 kisak-core20

Thanks @alan_g

I installed that, and it does contain etnaviv_dri.so. However, I’m not seeing an obvious way to specify which driver to try and use for a given card, and it still tries to load imx-drm_dri.so

I have checked both:

…and various forum posts.

Are you able to give me a pointer ?

Cheers, Just

What host OS are you using? You probably need a kernel configured with Vivante GPU support.

It’s Ubuntu Core 20, but with a custom kernel. I will try adding that configuration now :+1:

Cheers, Just

Hi Jocado,

I have the same behaviour on IMX8MP SOC. Kernel is compiled with Galcore version 6.4.3.p2.336687( Vivante driver ) . Did you solve the issue ?

Unfortunately not.

After making sure the kernel option was in place CONFIG_DRM_ETNAVIV=y , it still didn’t work. I intended to dig into it a bit more, but haven’t had the time yet I’m afraid.

Cheers, Just