Skip to content

Conversation

@nashif
Copy link
Contributor

@nashif nashif commented Jul 13, 2022

This moves (not deleted in zephyr yet) the SOF app into SOF, where it belongs.
No need for duplicated overlays and one place to build everything.

You now use scripts or west directly to build this and able to make all changes needed in the configuration files without having go via zpehyr or go through the complexity of a second layer of configurations (overlays)

  • zephyr: use zephyr prefix for includes
  • zephyr: app: move main SOF app from zephyr samples
  • zephyr: module: point to where the app is
  • app: zephyr: remove overlays and adapt script

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you @nashif

@marc-hb @keqiaozhang @wszypelt does anything need to be done for CI to use this update ?

@aborisovich good for you and Windows ?

@nashif nashif marked this pull request as ready for review July 13, 2022 11:08
Copy link
Contributor

@aborisovich aborisovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick review, two minor python issues.
Going to test Windows build in a minute,
As I understand the idea we are going to use overlays as common for everyone?
I am not sure this is right.
Yes we can do this for debug_overlay.conf but it does not make sense to use IPC4 overlay with anothing older than TGL - it probably won't even build and nobody did it before.
I would go back to old approach with platform names, something like this:
image
Then we can see which overlays are what for. Also please note that "platform" is better term here because we have some platforms in SOF that are build without Zephyr.
One more thing - I would change a name from "app" to "cSOF" maybe?
Like "Converged SOF" so it matches our official name :-)

@nashif nashif force-pushed the zephyr_app branch 2 times, most recently from 704d6cf to 06ccfac Compare July 13, 2022 13:45
@nashif
Copy link
Contributor Author

nashif commented Jul 13, 2022

Yes we can do this for debug_overlay.conf but it does not make sense to use IPC4 overlay with anothing older than TGL - it probably won't even build and nobody did it before.

Sure, this can be put in a strucutre with platform names.

I would go back to old approach with platform names, something like this:

boards/ is a preset folder name in the zephyr build system, the right configuration file is pulled automatically based on what you are building, so, no need for overlay magic, very useful if you are not building using the python script.

One more thing - I would change a name from "app" to "cSOF" maybe?
Like "Converged SOF" so it matches our official name :-)

app is just a placeholder, you guys decide what name to use...

@marc-hb
Copy link
Collaborator

marc-hb commented Jul 13, 2022

Thanks Anas for helping with this, much appreciated.

@marc-hb @keqiaozhang @wszypelt does anything need to be done for CI to use this update ?

Sorry I don't know why the Zephyr build was successful in https://github.com/thesofproject/sof/runs/7322499212 but failed in https://sof-ci.01.org/sofpr/PR6004/build891/build (error below). The changes to sof/scripts/xtensa-build-zephyr.py are small and simple; they look good to me.

SOF_TOP=/srv/home/jenkins/workspace/sof_generic_build
west_top=/srv/home/jenkins/workspace
In dir: /srv/home/jenkins/workspace; running command: west status hal_xtensa sof
FATAL ERROR: file not found: /srv/home/jenkins/workspace/sof_generic_build/west.yml

@keqiaozhang, @XiaoyunWu6666 ?

Jenkins does a bit more with sof/scripts/xtensa-build-zephyr.py, I found other suspicious errors in jenkins job 3667:

07:05:26 Traceback (most recent call last):
07:05:26   File "scripts/xtensa-build-zephyr.py", line 631, in <module>
07:05:26     main()
07:05:26   File "scripts/xtensa-build-zephyr.py", line 624, in main
07:05:26     run_clone_mode()
07:05:26   File "scripts/xtensa-build-zephyr.py", line 594, in run_clone_mode
07:05:26     raise RuntimeError("Zephyr found already! Not downloading it again")
07:05:26 RuntimeError: Zephyr found already! Not downloading it again
07:05:26 fatal: cannot change to 'zephyrproject/zephyr': No such file or directory

Copy link
Contributor

@aborisovich aborisovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delays in testing Windows build (i need to configure my environment).
I'll let you know as soon as its verified.
Meanwhile found one more thing to python (enable MTL build).
Rest of changes looks pretty good to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added configuration for MTL board, please add missing python dictionary so we can build it too:
{
"name": "mtl",
"PLAT_CONFIG": "intel_adsp_ace15_mtpm",
"XTENSA_CORE": "ace10_LX7HiFi4_RI_2020_5",
"XTENSA_TOOLS_VERSION": f"RI-2020.5{xtensa_tools_version_postfix}",
"RIMAGE_KEY": pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key_3k.pem
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will probably remove it and leave it to you to add this alongside other mtl related changes.

@keqiaozhang
Copy link
Collaborator

SOFCI TEST

@keqiaozhang
Copy link
Collaborator

Jenkins does a bit more with sof/scripts/xtensa-build-zephyr.py, I found other suspicious errors in jenkins job 3667:

@marc-hb , this build failure is not caused by this PR. I checked the Jenkins log and found that our sofbld10 failed to clone zephyrporject, because there's .west folder in /srv/home/jenkins/workspace/. I have deleted this folder and zephyr build passed.

@aborisovich
Copy link
Contributor

Sorry for delays in testing Windows build (i need to configure my environment). I'll let you know as soon as its verified. Meanwhile found one more thing to python (enable MTL build).

Confirmed Windows build working (built TGL successfully).

@aborisovich
Copy link
Contributor

aborisovich commented Jul 14, 2022

@marc-hb , this build failure is not caused by this PR. I checked the Jenkins log and found that our sofbld10 failed to clone zephyrporject, because there's .west folder in /srv/home/jenkins/workspace/. I have deleted this folder and zephyr build passed.

It may be my fault as I'm messing around with processes in PR6005, sorry.

@marc-hb
Copy link
Collaborator

marc-hb commented Jul 14, 2022

It may be my fault as I'm messing around with processes in #6005, sorry.

Thanks @aborisovich , very good catch I didn't realize 6005 could break CI even before getting merged but because of big west differences then yes of course it can! Ideally it shouldn't but in practice it can because our workers clean but don't clone everything from scratch. I prefixed the Github PR title with [SKIP CI] to stop sof-jenkins from looking at it. This affects sof-jenkins CI ONLY, ignored by everything else. You do not need to change any commit message or anything.

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://sof-ci.01.org/sofpr/PR6004/build896/devicetest/ is all green expect one unrelated and unfortunately common suspend/resume failure.

The Python, CMake and C changes LGTM, thanks! The checkpatch warnings seem harmless, someone should check.

I don't know about the overlays and .conf files but I blindly trust @nashif with that :-) But @aborisovich must approve.

@marc-hb marc-hb self-requested a review July 14, 2022 22:39
@lgirdwood
Copy link
Member

@aborisovich good for you now ?

Copy link
Contributor

@aborisovich aborisovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never trust anyone blindly, we are all developers ;-)
I just wanted to remove boards/intel_adsp_ace15_mtpm.conf from this PR just for consistency (or add it to python so it is buildable). But maybe it does not matter that much.
Everything else looks perfect, windows build works too, approving.

@nashif
Copy link
Contributor Author

nashif commented Jul 15, 2022

I just wanted to remove boards/intel_adsp_ace15_mtpm.conf from this PR just for consistency (or add it to python so it is buildable).

removed

nashif added 2 commits July 15, 2022 06:51
Zephyr includes are now under a zephyr namespace, so use this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make the main SOF app part of SOF, where it belongs. No need for any
overlays (which just duplicated the sample .conf anyways) and one place
to build everything.

This now does not depend on zephyr samples, which have a different
purpose completely.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
nashif added 2 commits July 15, 2022 06:51
This allows building SOF from zephyr for CI and testing purposes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove overlays as they are the same board configurations available in
app/.
Keep common overlays and change script to reflect those changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
@lgirdwood
Copy link
Member

@wszypelt can you check CI, this should not break runtime tests

@wszypelt
Copy link

@lgirdwood
It seems to me that everything should be working properly now, I have made retests for this and other PR

@lgirdwood
Copy link
Member

@lgirdwood It seems to me that everything should be working properly now, I have made retests for this and other PR

Thanks for checking @wszypelt - I will rerun as the CI error log is still not loading for me.

@lgirdwood
Copy link
Member

SOFCI TEST

@lgirdwood
Copy link
Member

@wszypelt I've rerun the CI and still getting empty logs for the test failures. Are we good to merge ?

@marc-hb
Copy link
Collaborator

marc-hb commented Jul 15, 2022

@lgirdwood the magic comment "SOFCI TEST" is scanned by SOFCI TEST only, QB does not care.

I looked at the internal 9877300 logs for https://sof-ci.01.org/sof-pr-viewer/#/build/PR6004/build9877263 and this can merged. I confirm that the build in QB was successful, only the deployment to 2 devices (TGL and WHL) failed:

pytest tests/sof/fw_00_basic/test_00_load_fw_basic.py::TestLoadFwBasic   --fw="C:\Testing\Builds\pull-6004-merge_740929\CNL\sof-cnl.ri" --ldc-file="C:\Testing\Builds\pull-6004-merge_740929\CNL\sof-cnl.ldc" --zabbix --tests-startup-label='SMOKE_pull-6004-merge_740929' ...
...
04:34:51,363 INFO  - INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/execnet/gateway_socket.py", line 91, in create_io
04:34:51,363 INFO  - INTERNALERROR>     sock.connect((host, port))
04:34:51,363 INFO  - INTERNALERROR> ConnectionRefusedError: [Errno 111] Connection refused

I doubt this PR even affects QB at all.

(https://sof-ci.01.org/sofpr/PR6004/build906/devicetest/ is all green except for one unfortunately common suspend/resume failure.)

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.

6 participants