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

Use Upstream Weston #16

Open
VirtuallyChris opened this issue Nov 15, 2021 · 15 comments
Open

Use Upstream Weston #16

VirtuallyChris opened this issue Nov 15, 2021 · 15 comments
Labels
bounty enhancement New feature or request

Comments

@VirtuallyChris
Copy link

We currently use the closed source Thundercomm version of Weston.

Get open source Weston working in AGNOS for a $5000 bounty.
https://github.com/wayland-project/weston

@VirtuallyChris VirtuallyChris added the enhancement New feature or request label Nov 15, 2021
@geohot
Copy link

geohot commented Nov 16, 2021

Has to run openpilot as normal to qualify

@robbederks
Copy link
Contributor

robbederks commented Nov 18, 2021

It actually turns out all the code we use (except for some minor internal changes) is in fact open source, albeit horribly outdated.
For reference, these are the public remotes used to build the weston we use now:

The toolchain we use to build these is closed source and a little hacked together though.

kfatehi added a commit to kfatehi/agnos-builder that referenced this issue Nov 21, 2021
kfatehi added a commit to kfatehi/agnos-builder that referenced this issue Nov 22, 2021
@kfatehi
Copy link

kfatehi commented Nov 22, 2021

Hi. I took a shot at this out of curiosity and failed, but I got some potentially useful output and scripts out of it, having been able to execute a custom built weston 9 on the tici at the end of it. Documented a post-mortem of my attempt here with the relevant error logs: https://github.com/kfatehi/agnos-builder/blob/16_use_upstream_weston/weston/README.md

@houqp
Copy link
Contributor

houqp commented Dec 5, 2021

@robbederks is the corresponding mesa freedreno gallium driver source also open-sourced?

@robbederks
Copy link
Contributor

@robbederks is the corresponding mesa freedreno gallium driver source also open-sourced?

We aren't using freedreno, but rather the proprietary Adreno shared libraries (see the content of the display deb package). Making this part open source is obviously not in the scope of this bounty.

@houqp
Copy link
Contributor

houqp commented Dec 6, 2021

OK, turns out unlike the open-source mesa gbm, the proprietary version has the gbm driver backend statically linked into the provided libgbm.so shared library. @kfatehi your setup linked weston with ubuntu provided gbm lib, which loads driver backend from lib/dri/*_dri.so files. This is why you are were getting that MESA-LOADER: failed to open msm_drm error.

@robbederks is the proprietary gbm.h header file available for share to help with the linking?

UPDATE: looking at the weston fork, it looks like the proprietary gbm is a fork of minigbm, not the one in mesa.

@robbederks
Copy link
Contributor

OK, turns out unlike the open-source mesa gbm, the proprietary version has the gbm driver backend statically linked into the provided libgbm.so shared library. @kfatehi your setup linked weston with ubuntu provided gbm lib, which loads driver backend from lib/dri/*_dri.so files. This is why you are were getting that MESA-LOADER: failed to open msm_drm error.

@robbederks is the proprietary gbm.h header file available for share to help with the linking?

UPDATE: looking at the weston fork, it looks like the proprietary gbm is a fork of minigbm, not the one in mesa.

Everything we can open source is either in this repo (agnos-builder) or in the repos I've linked before, and this should be enough afaik.

I do remember looking into this some time ago that there is libgbm and libgralloc (the android version), and I believe they wrote a libgbm-like interface to libgralloc, since that's what adreno uses internally.

@robin-reckmann
Copy link
Contributor

Rather than forcing upstream Weston into the current AGNOS with the Thundercomm kernel, porting to mainline Kernel is the better options I guess. Then we will get open source graphics drivers and upstream weston for free. I'm currently trying to get everything else also running with mainline. https://github.com/robin-reckmann/comma3_mainline

@geohot
Copy link

geohot commented Mar 15, 2022

The open source graphics drivers don't support OpenCL afaik, which we need to run the model. The other issue with mainline kernel is the lack of well tested camera support.

@zorrobyte
Copy link

zorrobyte commented Apr 27, 2022

From the 96boards discord (regarding OpenCL/SNPE)
image

@martinl
Copy link
Contributor

martinl commented May 31, 2023

I will slowly start defining the scope and steps required for getting this done by going mainline route.

Here is the current state for mainline c3 development https://github.com/robin-reckmann/linux/tree/comma3/v6.3

We also have at least one kernel developer (with some previous experience) interested in developing open source camera drivers for c3 sensor.

Missing OpenCL support in open source drivers is the big question. I have looked at available options and I think using something like http://portablecl.org as base for adding hw acceleration since it should be possible to enable dsp using https://gitlab.com/postmarketOS/pmaports/-/merge_requests/4050

It's currently beoyond my skillset and I would need some help with figuring it out if it is possible at all. In my opinion and from general perspective it looks promising and worth figuring out as a challenge.

This CDSP guide for 845 might also be relevant https://git.linaro.org/people/srinivas.kandagatla/ImagenetCv.git/tree/README but I'm not sure yet. We'll see.

@martinl
Copy link
Contributor

martinl commented May 31, 2023

TODO

  • find a path forward for OpenCL
  • get serial console adapter and c3
  • get Robin's mainline branch booting on c3
  • get gpu working
  • get ssc / sensors working
  • get cdsp up and running
  • start initial development on opensource camera driver for c3 sensor
  • get additional c3 or camera for Tooniis for driver development and testing
  • develop camera drivers for c3 sensor

@robin-reckmann
Copy link
Contributor

afaik there's nothing connected to the ssc. Most sensors are accessible via i2c and upstream drivers.

@martinl
Copy link
Contributor

martinl commented May 31, 2023

afaik there's nothing connected to the ssc. Most sensors are accessible via i2c and upstream drivers.

yes, but at least hexagonrpcd and accessing dsp via qmi and protobuf might be relevant for using adsp and cdsp later

@robbederks
Copy link
Contributor

afaik there's nothing connected to the ssc. Most sensors are accessible via i2c and upstream drivers.

correct

@andiradulescu andiradulescu mentioned this issue Jul 4, 2024
20 tasks
@adeebshihadeh adeebshihadeh changed the title [$5000 Bounty] Use Upstream Weston Use Upstream Weston Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty enhancement New feature or request
Projects
Status: Locked
Development

No branches or pull requests

9 participants