Closed jasvinderkhurana closed 3 years ago
Thanks for raising the ticket @jasvinderkhurana. See:
qemu-system-aarch64: Could not reopen file: Permission denied
Do you have your file system set with the permissions to launch this? I suspect not.
I tried with root permissions as well but then I get failed to allocate memory, and I think my PC has enough available memory:
root@xhdjasvinde41:/scratch/Work/Ros2/krs_ws# colcon acceleration emulation sw_emu install-kv260
SECURITY WARNING: This class invokes explicitly a shell via the shell=True argument of the Python subprocess library, and uses admin privileges to manage raw disk images. It is the user's responsibility to ensure that all whitespace and metacharacters passed are quoted appropriately to avoid shell injection vulnerabilities.
- Verified that install/ is available in the current ROS 2 workspace
- Confirmed availability of raw image file at: /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/sd_card.img
- Finished inspecting raw image, obtained UNITS and STARTSECTOR P1/P2
- Image mounted successfully at: /tmp/sdcard_img_p2
- Successfully cleaned up prior overlay ROS 2 workspace at: /tmp/sdcard_img_p2/ros2_ws
- Copied 'install-kv260' directory as a ROS 2 overlay workspace in the raw image.
- Umounted the raw image.
- Generated PMU and QEMU files.
- Launching emulation...
cd /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation && /proj/xbuilds/SWIP/2020.2_1118_1232/installs/lin64/Vitis/2020.2/bin/launch_emulator -device-family ultrascale -target sw_emu -qemu-args-file /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/qemu_args.txt -pmc-args-file /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/pmu_args.txt -sd-card-image /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/sd_card.img -enable-prep-target $*
Running SW Emulation
INFO : [LAUNCH_EMULATOR] pl_sim_dir option is not provided.
Starting QEMU
- Press <Ctrl-a h> for help
Waiting for QEMU to start. qemu_port 8013
Qemu_pids 2203336 2203337
qemu-system-aarch64: -chardev socket,path=./qemu-rport-_pmu@0,server,id=pmu-apu-rp: info: QEMU waiting for connection on: disconnected:unix:./qemu-rport-_pmu@0,server
QEMU started. qemu_pid=2203336.
Waiting for PMU to start. Qemu_pids 2203342 2203343
qemu-system-aarch64: -chardev socket,id=pl-rp,host=127.0.0.1,port=8011,server: info: QEMU waiting for connection on: disconnected:tcp:127.0.0.1:8011,server
PMC started. pmc_pid=2203342
Starting PL simulation.Generating PLLauncher commandline
running PLL Launcher
Failed to allocate memory: Cannot allocate memory
qemu-system-microblazeel: /pmu@0: Disconnected clk=8279495343 ns
/scratch/Work/Ros2/krs_ws/acceleration/firmware/kv260/emulation/emu_qemu_scripts/start_qemu.sh: line 3: 2203338 Aborted (core dumped) $QEMU_GDB_COMMAND /proj/xbuilds/SWIP/2020.2_1118_1232/installs/lin64/Vitis/2020.2/data/emulation/qemu/unified_qemu_v5_0/sysroots/x86_64-petalinux-linux/usr/bin/qemu-system-aarch64 -M arm-generic-fdt -serial /dev/null -serial mon:stdio -display none -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../bl31.elf,cpu-num=0 -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../u-boot.elf -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../device_tree/u-boot.dtb,addr=0x00100000,force-raw -gdb tcp::9000 -net nic -net nic -net nic -net nic -net user,hostfwd=tcp:127.0.0.1:2222-10.0.2.15:22 -hw-dtb /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../zynqmp-qemu-multiarch-arm.dtb -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -m 4G "" -hw-dtb /proj/xbuilds/SWIP/2020.2_1118_1232/installs/lin64/Vitis/2020.2/data/emulation/dtbs/zynqmp/zynqmp-arm-cosim.dtb -drive "file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/sd_card.img,if=sd,format=raw,index=1" -display "none" -machine-path "." -chardev "socket,path=./qemu-rport-_pmu@0,server,id=pmu-apu-rp" -chardev "socket,id=pl-rp,host=127.0.0.1,port=8011,server"
[LAUNCH_EMULATOR] INFO: 15:07:19 : PS-QEMU exited
[LAUNCH_EMULATOR] INFO: 15:07:21 : PS-QEMU exited
[LAUNCH_EMULATOR] INFO: 15:07:21 : PMU/PMC-QEMU exited
[LAUNCH_EMULATOR] INFO: 15:07:21 : Trying to kill PLLauncher forcefully because QEMU exited
[LAUNCH_EMULATOR] INFO: 15:07:21 : PLLauncher exited by force
Please refer PS /simulate logs at /scratch/Work/Ros2/krs_ws/acceleration/firmware/kv260/emulation for more details.
DONE!
INFO: Emulation ran successfully
Finalized successfully.
Yeah, @jasvinderkhurana, sounds like an issue with your system:
Failed to allocate memory: Cannot allocate memory
qemu-system-microblazeel: /pmu@0: Disconnected clk=8279495343 ns
/scratch/Work/Ros2/krs_ws/acceleration/firmware/kv260/emulation/emu_qemu_scripts/start_qemu.sh: line 3: 2203338 Aborted (core dumped) $QEMU_GDB_COMMAND /proj/xbuilds/SWIP/2020.2_1118_1232/installs/lin64/Vitis/2020.2/data/emulation/qemu/unified_qemu_v5_0/sysroots/x86_64-petalinux-linux/usr/bin/qemu-system-aarch64 -M arm-generic-fdt -serial /dev/null -serial mon:stdio -display none -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../bl31.elf,cpu-num=0 -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../u-boot.elf -device loader,file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../device_tree/u-boot.dtb,addr=0x00100000,force-raw -gdb tcp::9000 -net nic -net nic -net nic -net nic -net user,hostfwd=tcp:127.0.0.1:2222-10.0.2.15:22 -hw-dtb /scratch/Work/Ros2/krs_ws/acceleration/firmware/select/emulation/../zynqmp-qemu-multiarch-arm.dtb -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -m 4G "" -hw-dtb /proj/xbuilds/SWIP/2020.2_1118_1232/installs/lin64/Vitis/2020.2/data/emulation/dtbs/zynqmp/zynqmp-arm-cosim.dtb -drive "file=/scratch/Work/Ros2/krs_ws/acceleration/firmware/select/sd_card.img,if=sd,format=raw,index=1" -display "none" -machine-path "." -chardev "socket,path=./qemu-rport-_pmu@0,server,id=pmu-apu-rp" -chardev "socket,id=pl-rp,host=127.0.0.1,port=8011,server"
Note nevertheless that as highlighted in the docs, sw_emu
capabilities are limited to the file system inspection itself, since Vitis 2020.2
does not provide support for running sw_emu
kernels for KV260. This is a roadmap item as far as I'e been told.
So in a nutshell, I'd encourage you to move forward to hardware and report issues there (or alternatively, try the ZCU102 one which is polished).
You can open another ticket if you encounter another hurdle @jasvinderkhurana. Can we close this one for now?
Ping @jasvinderkhurana, can we close this ticket since the initial issue seems resolved?
@vmayoral I am trying the same on a different machine.. gimme some more time.. to check if the issue persists there as well, and then we can close the ticket
@vmayoral , I tried on another machine and emulation works as expected. Closing the ticket! Thanks for the support!
I am trying to run Emulation for kv260, but I get below error:
I have executed below steps to run emulation:
Please guide what possibly I am doing wrong.