VISHNU RAMADAS has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/70078?usp=email )

Change subject: dev-amdgpu: Update vega10_kvm.py to add checkpointing instruction
......................................................................

dev-amdgpu: Update vega10_kvm.py to add checkpointing instruction

The vega10_kvm.py script configures a system to run in GPUFS mode. To
create a checkpoint, an m5 checkpoint instruction has to be added to the
script manually. This commit automatically adds the instruction if the
checkpoint-dir flag is set

Change-Id: I552fae6e98f6ec33a70a5b384242e87edb0e9526
---
M configs/example/gpufs/vega10_kvm.py
1 file changed, 26 insertions(+), 1 deletion(-)



diff --git a/configs/example/gpufs/vega10_kvm.py b/configs/example/gpufs/vega10_kvm.py
index 9c7e457..e2531fd 100644
--- a/configs/example/gpufs/vega10_kvm.py
+++ b/configs/example/gpufs/vega10_kvm.py
@@ -41,7 +41,7 @@
 from ruby import Ruby


-demo_runscript = """\
+demo_runscript_without_checkpoint = """\
 export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
 export HSA_ENABLE_INTERRUPT=0
 dmesg -n8
@@ -58,6 +58,24 @@
 /sbin/m5 exit
 """

+demo_runscript_with_checkpoint = """\
+export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
+export HSA_ENABLE_INTERRUPT=0
+dmesg -n3
+dd if=/root/roms/vega10.rom of=/dev/mem bs=1k seek=768 count=128
+if [ ! -f /lib/modules/`uname -r`/updates/dkms/amdgpu.ko ]; then
+    echo "ERROR: Missing DKMS package for kernel `uname -r`. Exiting gem5."
+    /sbin/m5 exit
+fi
+modprobe -v amdgpu ip_block_mask=0xff ppfeaturemask=0 dpm=0 audio=0
+echo "Running {} {}"
+echo "{}" | base64 -d > myapp
+chmod +x myapp
+/sbin/m5 checkpoint
+./myapp {}
+/sbin/m5 exit
+"""
+

 def addDemoOptions(parser):
     parser.add_argument(
@@ -79,6 +97,7 @@

     # Parse now so we can override options
     args = parser.parse_args()
+    demo_runscript = ""

     # Create temp script to run application
     if args.app is None:
@@ -97,6 +116,12 @@
         print("Could not find applcation", args.app)
         sys.exit(1)

+    # Choose runscript Based on whether any checkpointing args are set
+    if args.checkpoint_dir is not None:
+        demo_runscript = demo_runscript_with_checkpoint
+    else:
+        demo_runscript = demo_runscript_without_checkpoint
+
     with open(os.path.abspath(args.app), "rb") as binfile:
         encodedBin = base64.b64encode(binfile.read()).decode()


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70078?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I552fae6e98f6ec33a70a5b384242e87edb0e9526
Gerrit-Change-Number: 70078
Gerrit-PatchSet: 1
Gerrit-Owner: VISHNU RAMADAS <vrama...@wisc.edu>
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to