Skip to content

Conversation

@andiradulescu
Copy link
Collaborator

@andiradulescu andiradulescu commented Oct 22, 2025

Redo of #489 adding:


Problems:

  • raylib still wants libffi6
  • EGL Wayland driver needs to be kept in agnos-display
  • qmake is missing (can't build qt ui) - probably needs an openpilot branch without qt ui

Wi-fi works fine. Will put this ready for review if I manage to solve the problems above.


$ journalctl -u magic
Jul 11 18:53:03 comma systemd[1]: Starting magic.service - Magic...
Jul 11 18:53:03 comma-9539449f systemd[1]: Started magic.service - Magic.
Jul 11 18:53:04 comma-9539449f bash[3421]: RAYLIB STATIC 5.5.0.2 LOADED
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO: Initializing raylib 5.6-dev
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO: Platform backend: COMMA
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO: Supported raylib modules:
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rcore:..... loaded (mandatory)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rlgl:...... loaded (mandatory)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rshapes:... loaded (optional)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rtextures:. loaded (optional)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rtext:..... loaded (optional)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > rmodels:... loaded (optional)
Jul 11 18:53:04 comma-9539449f bash[3421]: INFO:     > raudio:.... loaded (optional)
Jul 11 18:53:04 comma-9539449f bash[3421]: gbm_create_device(156): Info: backend name is: msm_drm
Jul 11 18:53:04 comma-9539449f bash[3421]: WARNING: COMMA: Failed to get an EGL display
Jul 11 18:53:04 comma-9539449f bash[3421]: FATAL: COMMA: Failed to initialize EGL
Jul 11 18:53:04 comma-9539449f systemd[1]: magic.service: Main process exited, code=exited, status=1/FAILURE
Jul 11 18:53:04 comma-9539449f systemd[1]: magic.service: Failed with result 'exit-code'.
scons: Reading SConscript files ...
FileNotFoundError: [Errno 2] No such file or directory: 'qmake':
  File "/data/openpilot/SConstruct", line 183:
    qt_install_prefix = subprocess.check_output(['qmake', '-query', 'QT_INSTALL_PREFIX'], encoding='utf8').strip()
  File "/usr/lib/python3.12/subprocess.py", line 466:
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.12/subprocess.py", line 548:
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.12/subprocess.py", line 1026:
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1955:
    raise child_exception_type(errno_num, err_msg, err_filename)

@adeebshihadeh
Copy link
Contributor

Nice! FYI, we'll probably wait to merge this until after 0.10.1 is out to mitigate any extra risk.

@adeebshihadeh
Copy link
Contributor

Qt has been deleted from openpilot!

@adeebshihadeh
Copy link
Contributor

  • EGL Wayland driver needs to be kept in agnos-display

Why?

@andiradulescu
Copy link
Collaborator Author

andiradulescu commented Oct 23, 2025

  • EGL Wayland driver needs to be kept in agnos-display

Why?

Otherwise magic fails with:

Jul 11 18:53:04 comma-9539449f bash[3421]: WARNING: COMMA: Failed to get an EGL display
Jul 11 18:53:04 comma-9539449f bash[3421]: FATAL: COMMA: Failed to initialize EGL

I assume this happens because magic uses the weston/wayland socket that EGL Wayland driver opens. It's just an assumption.

I installed agnos-display_0.0.1.deb and magic works fine, doesn't throw that error anymore.

That was the only change needed to display the comma background. FYI, I have a custom bootloader splash, so I notice if it shows or not.

I will check what .so file(s) are needed for magic to work and only keep that/those. I assume it's libwayland-egl.so.

@andiradulescu
Copy link
Collaborator Author

$ ps aux | grep -E '4454|magic'
  ⎿ comma       4454  0.2  1.0 276300 37780 ?        Ssl  19:03   0:01 /usr/local/venv/bin/python -u /usr/comma/magic.py
     comma      53998  0.0  0.0   7044  1672 ?        Ss   19:13   0:00 bash -c ps aux | grep -E '4454|magic'
     comma      54000  0.0  0.0   6136   852 ?        S    19:13   0:00 grep -E 4454|magic

$ lsof -p 4454 | grep '\\.so'
  ⎿ python  4454 comma  mem       REG                8,7    10048 93704 /usr/lib/aarch64-linux-gnu/libwayland-egl.so.1
     python  4454 comma  mem       REG                8,7   197632 93696 /usr/lib/aarch64-linux-gnu/libeglSubDriverWayland.so
     python  4454 comma  mem       REG                8,7   452624 38040 /usr/local/venv/lib/python3.12/site-packages/_cffi_backend.cpython-312-aarch64-linux-gnu.so
     python  4454 comma  mem       REG                8,7    67512 16089 /usr/lib/aarch64-linux-gnu/libgthread-2.0.so.0.8000.0
     python  4454 comma  mem       REG                8,7   592328 16440 /usr/lib/aarch64-linux-gnu/libpcre2-8.so.0.11.2
     python  4454 comma  mem       REG                8,7    67944 15951 /usr/lib/aarch64-linux-gnu/libffi.so.8.1.4
     python  4454 comma  mem       REG                8,7     9976 16637 /usr/lib/aarch64-linux-gnu/libsync.so.0
     python  4454 comma  mem       REG                8,7   247648 93701 /usr/lib/aarch64-linux-gnu/libpcre.so.1.2.6
     python  4454 comma  mem       REG                8,7  1445440 16033 /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0.8000.0
     python  4454 comma  mem       REG                8,7    67512 16559 /usr/lib/aarch64-linux-gnu/librt.so.1
     python  4454 comma  mem       REG                8,7    30920 93669 /usr/lib/aarch64-linux-gnu/libffi.so.6.0.4
     python  4454 comma  mem       REG                8,7    68632 16787 /usr/lib/aarch64-linux-gnu/libwayland-client.so.0.22.0
     python  4454 comma  mem       REG                8,7   134376 16796 /usr/lib/aarch64-linux-gnu/libwayland-server.so.0.22.0
     python  4454 comma  mem       REG                8,7   133696 16000 /usr/lib/aarch64-linux-gnu/libgcc_s.so.1
     python  4454 comma  mem       REG                8,7  2633224 16634 /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.33
     python  4454 comma  mem       REG                8,7    38888 16244 /usr/lib/aarch64-linux-gnu/liblog.so.0
     python  4454 comma  mem       REG                8,7    67440 15873 /usr/lib/aarch64-linux-gnu/libdl.so.2
     python  4454 comma  mem       REG                8,7  1125816 93698 /usr/lib/aarch64-linux-gnu/libgsl.so
     python  4454 comma  mem       REG                8,7    59320 15834 /usr/lib/aarch64-linux-gnu/libcutils.so.0
     python  4454 comma  mem       REG                8,7    67440 16505 /usr/lib/aarch64-linux-gnu/libpthread.so.0
     python  4454 comma  mem       REG                8,7    59128 93693 /usr/lib/aarch64-linux-gnu/libadreno_utils.so
     python  4454 comma  mem       REG                8,7   133616 15878 /usr/lib/aarch64-linux-gnu/libdrm.so.2.4.0
     python  4454 comma  mem       REG                8,7   108536 93697 /usr/lib/aarch64-linux-gnu/libgbm.so
     python  4454 comma  mem       REG                8,7   119624 93688 /usr/lib/aarch64-linux-gnu/libEGL_adreno.so
     python  4454 comma  mem       REG                8,7 20152176 93690 /usr/lib/aarch64-linux-gnu/libGLESv2_adreno.so
     python  4454 comma  mem       REG                8,7  4837496 67870 /usr/local/venv/lib/python3.12/site-packages/raylib/_raylib_cffi.cpython-312-aarch64-linux-gnu.so
     python  4454 comma  mem       REG                8,7  1722920 15773 /usr/lib/aarch64-linux-gnu/libc.so.6
     python  4454 comma  mem       REG                8,7   198712 15933 /usr/lib/aarch64-linux-gnu/libexpat.so.1.9.1
     python  4454 comma  mem       REG                8,7   133272 16890 /usr/lib/aarch64-linux-gnu/libz.so.1.3
     python  4454 comma  mem       REG                8,7   591800 16264 /usr/lib/aarch64-linux-gnu/libm.so.6

So libwayland-egl.so.1, libeglSubDriverWayland.so are needed by magic.py. Those were removed in agnos-display 0.0.2 - will put them back.

@maxime-desroches
Copy link
Contributor

We need libgbm which needs libwayland-server and libwayland-client. Haven't looked into removing that dependency yet

@andiradulescu
Copy link
Collaborator Author

We need libgbm which needs libwayland-server and libwayland-client. Haven't looked into removing that dependency yet

Yes, it can be seen in my previous comment. This PR removes old libwayland-* 1.9.0 libraries, but it's working since it's using libwayland from 24.04 and libgbm.

I'm running latest openpilot on this branch as I write this comment.

@andiradulescu andiradulescu marked this pull request as ready for review October 23, 2025 21:46
@andiradulescu
Copy link
Collaborator Author

andiradulescu commented Oct 25, 2025

Branch drives fine! 🚀also displays openpilot raylib UI fine while driving, with no crashes or obvious issues.

Tested it today with openpilot remove qt commit.

Will continue to update openpilot master/nightly while keeping this custom AGNOS built from this branch.

Will tackle the removal of armhf dependencies in another branch, but after this gets merged.

@adeebshihadeh adeebshihadeh merged commit 3762ea1 into commaai:master Oct 25, 2025
2 checks passed
@maxime-desroches
Copy link
Contributor

Sadly we will have to revert this for now, at least for a couple releases untill we decide to break backward compatibility between AGNOS versions.

The updater from previous releases is dependent on Qt and needs to be runable on newer AGNOS versions. Removing Qt prevents that.

@adeebshihadeh
Copy link
Contributor

@maxime-desroches let's make a cleanup branch in the meantime that we can continue this in? I'm sure @andiradulescu is as excited as we are for these nice cleanups :)

maxime-desroches added a commit that referenced this pull request Oct 29, 2025
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 this pull request may close these issues.

3 participants