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

CR-1142391 - Programming xclbin immediately after xbutil reset fails on V70/VCK5000 #7150

Merged
merged 4 commits into from
Nov 16, 2022

Conversation

rbramand-xilinx
Copy link
Collaborator

Signed-off-by: rbramand [email protected]

Problem solved by the commit

xbutil reset triggers reboot of apu and boot services are relaunched.
apu-boot service writes to a register indicating that it is ready. Programming xclbin from host just after reset fails because soft kernel daemon which is started by another boot service is not finished yet but apu-boot service indicated that system is ready. This pr solves this synchronization issue.

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

It was discovered in local regression testing by filer

How problem was solved, alternative solutions (if any) and why they were rejected

Added skd service as dependency to apu-boot service which will be started only after skd service is finished.

Risks (if any) associated the changes in the commit

Low

What has been tested and how, request additional testing if necessary

Tested by running regression with the newly generated apu package on V70 device.

Documentation impact (if any)

NA

@gbuildx
Copy link
Collaborator

gbuildx commented Nov 3, 2022

Build Failed! :(

@stsoe stsoe removed their request for review November 3, 2022 14:44

[Service]
Type=forking
User=softkernel
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did we remove the user?
@jeffli-xilinx , please review this change

Copy link
Collaborator

@jeffli-xilinx jeffli-xilinx left a comment

Choose a reason for hiding this comment

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

@rbramand-xilinx
Please keep User=softkernel

You can modify apu-boot and move all the lines that come after rpm-channel/ready to before the if statement.

Original:
if [ -e /sys/bus/platform/devices/rpu-channel/ready ]; then
echo 1 > /sys/bus/platform/devices/rpu-channel/ready
# Add softkernel user for PS kernel daemon to run as
useradd softkernel
# Work-around for AIE as it defaults root access only
chmod 666 /dev/aie0
# Create default xrt.ini
echo "# xrt.ini generated by apu-boot script" > /usr/bin/xrt.ini
echo "[Runtime]" >> /usr/bin/xrt.ini
echo "verbosity=5" >> /usr/bin/xrt.ini
echo "runtime_log=syslog" >> /usr/bin/xrt.ini
fi

Update:
# Add softkernel user for PS kernel daemon to run as
useradd softkernel
# Work-around for AIE as it defaults root access only
chmod 666 /dev/aie0
# Create default xrt.ini
echo "# xrt.ini generated by apu-boot script" > /usr/bin/xrt.ini
echo "[Runtime]" >> /usr/bin/xrt.ini
echo "verbosity=5" >> /usr/bin/xrt.ini
echo "runtime_log=syslog" >> /usr/bin/xrt.ini
if [ -e /sys/bus/platform/devices/rpu-channel/ready ]; then
echo 1 > /sys/bus/platform/devices/rpu-channel/ready
fi

> Added init-apu service for doing initialization tasks
> This service also creates softkernel user which is used to run skd.
> Added changes to decide order in which services run
> init-apu -> skd -> apu-boot

Signed-off-by: rbramand <[email protected]>
@gbuildx
Copy link
Collaborator

gbuildx commented Nov 15, 2022

Build Failed! :(

@chvamshi-xilinx
Copy link
Collaborator

retest this please

@gbuildx
Copy link
Collaborator

gbuildx commented Nov 15, 2022

Build Passed!

Copy link
Collaborator

@jeffli-xilinx jeffli-xilinx left a comment

Choose a reason for hiding this comment

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

Just some minor updates requested.
Thanks!

@@ -0,0 +1,34 @@
SUMMARY = "PS Kernel Daemon"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the summary here.
Thanks!

[Service]
ExecStart=/usr/bin/init-apu
StandardOutput=journal+console
MemoryLimit=1G
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is MemoryLimit needed here?
If so, it should probably be less than 1G.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @jeffli-xilinx for pointing it, memory limit is not needed. Made changes please approve

Signed-off-by: rbramand <[email protected]>
@gbuildx
Copy link
Collaborator

gbuildx commented Nov 16, 2022

Build Passed!

@chvamshi-xilinx chvamshi-xilinx merged commit db6a4dc into Xilinx:master Nov 16, 2022
@chvamshi-xilinx
Copy link
Collaborator

Please mark the CR fixed and backport to 2022.2

chvamshi-xilinx pushed a commit that referenced this pull request Nov 16, 2022
…on V70/VCK5000 (#7150) (#7172)

* CR-1142391 - Programming xclbin immediately after xbutil reset fails on V70/VCK5000

Signed-off-by: rbramand <[email protected]>

* Add new service to do initialization tasks

> Added init-apu service for doing initialization tasks
> This service also creates softkernel user which is used to run skd.
> Added changes to decide order in which services run
> init-apu -> skd -> apu-boot

Signed-off-by: rbramand <[email protected]>

* Add missing softkernel user

Signed-off-by: rbramand <[email protected]>

* Fix comments

Signed-off-by: rbramand <[email protected]>

Signed-off-by: rbramand <[email protected]>
(cherry picked from commit db6a4dc)

Signed-off-by: rbramand <[email protected]>

Signed-off-by: rbramand <[email protected]>
rajkumar-xilinx pushed a commit to rajkumar-xilinx/XRT that referenced this pull request Feb 7, 2023
…on V70/VCK5000 (Xilinx#7150)

* CR-1142391 - Programming xclbin immediately after xbutil reset fails on V70/VCK5000

Signed-off-by: rbramand <[email protected]>

* Add new service to do initialization tasks

> Added init-apu service for doing initialization tasks
> This service also creates softkernel user which is used to run skd.
> Added changes to decide order in which services run
> init-apu -> skd -> apu-boot

Signed-off-by: rbramand <[email protected]>

* Add missing softkernel user

Signed-off-by: rbramand <[email protected]>

* Fix comments

Signed-off-by: rbramand <[email protected]>

Signed-off-by: rbramand <[email protected]>
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.

4 participants