[gem5-dev] [XS] Change in gem5/gem5[develop]: util: '-eq' -> '-ge' for if in vm_manager.sh

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/71499?usp=email )


Change subject: util: '-eq' -> '-ge' for if in vm_manager.sh
..

util: '-eq' -> '-ge' for if in vm_manager.sh

A small nit-pick change that ensures that cases where the number of
arguments being >1 does not result in the argument checking being
skipped (NOTE: arguments after the first are never processed and are
ignored).

Change-Id: If7e9c16c2c3581ea95ed888586736618d1ae5f5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71499
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Reviewed-by: Daniel Carvalho 
Tested-by: kokoro 
---
M util/github-runners-vagrant/vm_manager.sh
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  kokoro: Regressions pass
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved




diff --git a/util/github-runners-vagrant/vm_manager.sh  
b/util/github-runners-vagrant/vm_manager.sh

index 1cae8d2..0e2f4b7 100755
--- a/util/github-runners-vagrant/vm_manager.sh
+++ b/util/github-runners-vagrant/vm_manager.sh
@@ -9,7 +9,7 @@
 export VAGRANT_HOME=${SCRIPT_DIR}

 param="up"
-if [[ $# -eq 1 ]]; then
+if [[ $# -ge 1 ]]; then
 param=$1
 if [[ "${param}" != "destroy" ]]; then
 echo "Only valid parameter is 'destroy', to destroy all VMs"

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


Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If7e9c16c2c3581ea95ed888586736618d1ae5f5f
Gerrit-Change-Number: 71499
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby Bruce 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-CC: kokoro 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [XS] Change in gem5/gem5[develop]: util: Add 'shutdown' argument option to vm_manager.sh

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/71500?usp=email )


Change subject: util: Add 'shutdown' argument option to vm_manager.sh
..

util: Add 'shutdown' argument option to vm_manager.sh

This allows for the VMs to be shutdown rather than destroyed. The can be
rebooted with `./vm_manager.sh` after shutdown.

Change-Id: I58329ec835af664bfb970b029e09ad16c5472015
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71500
Reviewed-by: Bobby Bruce 
Maintainer: Bobby Bruce 
Tested-by: kokoro 
---
M util/github-runners-vagrant/vm_manager.sh
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Bobby Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/util/github-runners-vagrant/vm_manager.sh  
b/util/github-runners-vagrant/vm_manager.sh

index 0e2f4b7..ce46eb3 100755
--- a/util/github-runners-vagrant/vm_manager.sh
+++ b/util/github-runners-vagrant/vm_manager.sh
@@ -11,8 +11,8 @@
 param="up"
 if [[ $# -ge 1 ]]; then
 param=$1
-if [[ "${param}" != "destroy" ]]; then
-echo "Only valid parameter is 'destroy', to destroy all VMs"
+if [[ "${param}" != "destroy" ]] && [[ "${param}" != "shutdown" ]];  
then
+echo "Only valid parameters are 'destroy' and 'shutdown' to  
destroy all VMs or shutdown all VMs"

 exit 1
 fi
 fi
@@ -23,6 +23,8 @@
 sed -i "s/  config.vm.hostname.*/  config.vm.hostname =  
\"${RUNNER_PREFIX}${i}\"/g" Vagrantfile-runner

 if [[ "${param}" == "destroy" ]]; then
 VAGRANT_VAGRANTFILE=Vagrantfile-runner vagrant destroy -f
+elif [[ "${param}" == "shutdown" ]]; then
+VAGRANT_VAGRANTFILE=Vagrantfile-runner vagrant halt -f
 else
 VAGRANT_VAGRANTFILE=Vagrantfile-runner vagrant up  
--provider=libvirt

 fi
@@ -33,6 +35,8 @@
 sed -i "s/  config.vm.hostname.*/  config.vm.hostname =  
\"${BUILDER_PREFIX}${i}\"/g" Vagrantfile-builder

 if [[ "${param}" == "destroy" ]]; then
 VAGRANT_VAGRANTFILE=Vagrantfile-builder vagrant destroy -f
+elif [[ "${param}" == "shutdown" ]]; then
+VAGRANT_VAGRANTFILE=Vagrantfile-builder vagrant halt -f
 else
 VAGRANT_VAGRANTFILE=Vagrantfile-builder vagrant up  
--provider=libvirt

 fi

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


Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I58329ec835af664bfb970b029e09ad16c5472015
Gerrit-Change-Number: 71500
Gerrit-PatchSet: 3
Gerrit-Owner: Bobby Bruce 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-CC: kokoro 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [XS] Change in gem5/gem5[develop]: util: Add 'swapspace' daemon to runner VM.

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/71680?usp=email )


Change subject: util: Add 'swapspace' daemon to runner VM.
..

util: Add 'swapspace' daemon to runner VM.

As these VMs, particularly the runners, don't have much memory, the
'swapspace' daemon allows for dynamic swap spaces to be created for when
more memory is required.

Change-Id: Ie8e734a8fde54e122df33dda187c6c4aafdcd006
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71680
Maintainer: Bobby Bruce 
Tested-by: kokoro 
Reviewed-by: Bobby Bruce 
---
M util/github-runners-vagrant/Vagrantfile-builder
M util/github-runners-vagrant/Vagrantfile-runner
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Bobby Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/util/github-runners-vagrant/Vagrantfile-builder  
b/util/github-runners-vagrant/Vagrantfile-builder

index cd36e78..c0c2380 100644
--- a/util/github-runners-vagrant/Vagrantfile-builder
+++ b/util/github-runners-vagrant/Vagrantfile-builder
@@ -20,6 +20,9 @@
   # sets up vm
   config.vm.provision :shell, path: "provision_root.sh"
   config.vm.provision :shell, privileged: false,  
path: "provision_nonroot.sh"
+  # To ensure we don't run out of memory, we enable dynamic Swap Space.  
This is
+  # done via the "swapspace" daemon:  
https://pqxx.org/development/swapspace/

+  config.vm.provision :shell, inline: "sudo apt install swapspace -y"
   # The provision_root.sh adds the vagrant user to the docker group, so we  
need to reload the VM.

   config.vm.provision :reload
   config.vm.provision :shell, run: 'always', inline: <<-SHELL
diff --git a/util/github-runners-vagrant/Vagrantfile-runner  
b/util/github-runners-vagrant/Vagrantfile-runner

index 854e5f5..eb4054e 100644
--- a/util/github-runners-vagrant/Vagrantfile-runner
+++ b/util/github-runners-vagrant/Vagrantfile-runner
@@ -20,6 +20,9 @@
   # sets up vm
   config.vm.provision :shell, path: "provision_root.sh"
   config.vm.provision :shell, privileged: false,  
path: "provision_nonroot.sh"
+  # To ensure we don't run out of memory, we enable dynamic Swap Space.  
This is
+  # done via the "swapspace" daemon:  
https://pqxx.org/development/swapspace/

+  config.vm.provision :shell, inline: "sudo apt install swapspace -y"
   # The provision_root.sh adds the vagrant user to the docker group, so we  
need to reload the VM.

   config.vm.provision :reload
   config.vm.provision :shell, run: 'always', inline: <<-SHELL

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


Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie8e734a8fde54e122df33dda187c6c4aafdcd006
Gerrit-Change-Number: 71680
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby Bruce 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: kokoro 
Gerrit-CC: kokoro 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[develop]: util: Update GitHub Runners Vagrant to overcommit memory

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/71498?usp=email )


Change subject: util: Update GitHub Runners Vagrant to overcommit memory
..

util: Update GitHub Runners Vagrant to overcommit memory

SE mode tests were failing in some cases where the VM did not have
enough memory to satisfy the constraints of the simulated system. This
change ensures the VM allows overcommitting of memory.

Change-Id: I1800288e16146bdae612a401c2ff282d8664892d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71498
Reviewed-by: Jason Lowe-Power 
Tested-by: kokoro 
Maintainer: Jason Lowe-Power 
---
M util/github-runners-vagrant/Vagrantfile-builder
M util/github-runners-vagrant/Vagrantfile-runner
2 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/util/github-runners-vagrant/Vagrantfile-builder  
b/util/github-runners-vagrant/Vagrantfile-builder

index 242e094..cd36e78 100644
--- a/util/github-runners-vagrant/Vagrantfile-builder
+++ b/util/github-runners-vagrant/Vagrantfile-builder
@@ -22,6 +22,11 @@
   config.vm.provision :shell, privileged: false,  
path: "provision_nonroot.sh"
   # The provision_root.sh adds the vagrant user to the docker group, so we  
need to reload the VM.

   config.vm.provision :reload
+  config.vm.provision :shell, run: 'always', inline: <<-SHELL
+# When running gem5 in SE mode we must overcommit memory.
+# This is run on every startup of the VM.
+/sbin/sysctl vm.overcommit_memory=1
+  SHELL
   config.vm.provision :shell, privileged: false, run: 'always', inline:  
<<-SHELL

 if [ -d ~/actions-runner ]; then
 # This will be run everytime the VM is run (once created).
diff --git a/util/github-runners-vagrant/Vagrantfile-runner  
b/util/github-runners-vagrant/Vagrantfile-runner

index ab601cd..854e5f5 100644
--- a/util/github-runners-vagrant/Vagrantfile-runner
+++ b/util/github-runners-vagrant/Vagrantfile-runner
@@ -22,6 +22,11 @@
   config.vm.provision :shell, privileged: false,  
path: "provision_nonroot.sh"
   # The provision_root.sh adds the vagrant user to the docker group, so we  
need to reload the VM.

   config.vm.provision :reload
+  config.vm.provision :shell, run: 'always', inline: <<-SHELL
+# When running gem5 in SE mode we must overcommit memory.
+# This is run on every startup of the VM.
+/sbin/sysctl vm.overcommit_memory=1
+  SHELL
   config.vm.provision :shell, privileged: false, run: 'always', inline:  
<<-SHELL

 if [ -d ~/actions-runner ]; then
 # This will be run everytime the VM is run (once created).

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


Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1800288e16146bdae612a401c2ff282d8664892d
Gerrit-Change-Number: 71498
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby Bruce 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-CC: kokoro 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Check for Change-Id in GitHub Actions

2023-07-06 Thread Melissa Jost (Gerrit) via gem5-dev
Melissa Jost has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email )



Change subject: misc: Check for Change-Id in GitHub Actions
..

misc: Check for Change-Id in GitHub Actions

This adds a check to our continous integration tests that ensures
that every single commit in a pull request has a Change-Id, and
instructs you to add one if that check fails.  This ensures all
commits on GitHub are still compatible with Gerrit.

Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
---
M .github/workflows/ci-tests.yaml
1 file changed, 26 insertions(+), 3 deletions(-)



diff --git a/.github/workflows/ci-tests.yaml  
b/.github/workflows/ci-tests.yaml

index 61ba4b5..c3188b8 100644
--- a/.github/workflows/ci-tests.yaml
+++ b/.github/workflows/ci-tests.yaml
@@ -16,10 +16,33 @@
 - uses: actions/setup-python@v3
 - uses: pre-commit/action@v3.0.0

+  # ensures we have a change-id in every commit, needed for gerrit
+  check-for-change-id:
+# runs on github hosted runner
+runs-on: ubuntu-latest
+container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
+steps:
+  - uses: actions/github-script@v6
+env:
+  token: "Change-Id"
+  pattern: ".*"
+with:
+  script: |
+const commits = ${{ toJSON(github.event.commits) }}
+for (const commit of commits) {
+  const id = "Change-Id: "
+  const message = commit.message;
+  if (!message.includes(id)) {
+core.setFailed('One or more of the commits in this pull  
request is missing a Change-ID, which we require for any changes made to  
gem5. ' +
+'To automatically insert one, run the following:\n f=`git  
rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; ' +
+'curl -Lo $f  
https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x  
$f\n Then amend the commit with git commit --amend --no-edit, and update  
your pull request.')

+  }
+}
+
   build-gem5:
 runs-on: [self-hosted, linux, x64, build]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 outputs:
   artifactname: ${{ steps.name.outputs.test }}
 steps:
@@ -39,7 +62,7 @@
   unittests-all-opt:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 timeout-minutes: 60
 steps:
   - uses: actions/checkout@v3
@@ -51,7 +74,7 @@
   testlib-quick:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: [pre-commit, build-gem5]
+needs: [pre-commit, check-for-change-id, build-gem5]
 timeout-minutes: 360 # 6 hours
 steps:
   - uses: actions/checkout@v3

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


Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: stable
Gerrit-Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
Gerrit-Change-Number: 72118
Gerrit-PatchSet: 1
Gerrit-Owner: Melissa Jost 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[develop]: gpu-compute,configs: Make sim exits conditional

2023-07-06 Thread Matthew Poremba (Gerrit) via gem5-dev
Matthew Poremba has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72098?usp=email )



Change subject: gpu-compute,configs: Make sim exits conditional
..

gpu-compute,configs: Make sim exits conditional

The unconditional exit event when a kernel completes that was added in
c644eae2ddd34cf449a9c4476730bd29703c4dd7 is causing scripts that do not
ignore unknown exit events to end simulation prematurely. One such
script is the apu_se.py script used in SE mode GPU simulation. Make this
exit conditional to the parameter being set to a valid value to avoid
this problem.

Change-Id: I1d2c082291fdbcf27390913ffdffb963ec8080dd
---
M configs/example/gpufs/system/system.py
M src/gpu-compute/GPU.py
M src/gpu-compute/dispatcher.cc
M src/gpu-compute/dispatcher.hh
4 files changed, 13 insertions(+), 3 deletions(-)



diff --git a/configs/example/gpufs/system/system.py  
b/configs/example/gpufs/system/system.py

index 40e0016..19df310 100644
--- a/configs/example/gpufs/system/system.py
+++ b/configs/example/gpufs/system/system.py
@@ -115,7 +115,8 @@
 numHWQueues=args.num_hw_queues,
 walker=hsapp_pt_walker,
 )
-dispatcher = GPUDispatcher()
+dispatcher_exit_events = True if args.exit_at_gpu_kernel > -1 else  
False

+dispatcher = GPUDispatcher(kernel_exit_events=dispatcher_exit_events)
 cp_pt_walker = VegaPagetableWalker()
 gpu_cmd_proc = GPUCommandProcessor(
 hsapp=gpu_hsapp, dispatcher=dispatcher, walker=cp_pt_walker
diff --git a/src/gpu-compute/GPU.py b/src/gpu-compute/GPU.py
index c5449cc..c64a6b7 100644
--- a/src/gpu-compute/GPU.py
+++ b/src/gpu-compute/GPU.py
@@ -328,6 +328,10 @@
 cxx_class = "gem5::GPUDispatcher"
 cxx_header = "gpu-compute/dispatcher.hh"

+kernel_exit_events = Param.Bool(
+False, "Enable exiting sim loop after a kernel"
+)
+

 class GPUCommandProcessor(DmaVirtDevice):
 type = "GPUCommandProcessor"
diff --git a/src/gpu-compute/dispatcher.cc b/src/gpu-compute/dispatcher.cc
index b19bccc..7b36bce 100644
--- a/src/gpu-compute/dispatcher.cc
+++ b/src/gpu-compute/dispatcher.cc
@@ -51,7 +51,8 @@
 : SimObject(p), shader(nullptr), gpuCmdProc(nullptr),
   tickEvent([this]{ exec(); },
   "GPU Dispatcher tick", false, Event::CPU_Tick_Pri),
-  dispatchActive(false), stats(this)
+  dispatchActive(false), kernelExitEvents(p.kernel_exit_events),
+  stats(this)
 {
 schedule(, 0);
 }
@@ -332,7 +333,9 @@
 curTick(), kern_id);
 DPRINTF(GPUKernelInfo, "Completed kernel %d\n", kern_id);

-exitSimLoop("GPU Kernel Completed");
+if (kernelExitEvents) {
+exitSimLoop("GPU Kernel Completed");
+}
 }

 if (!tickEvent.scheduled()) {
diff --git a/src/gpu-compute/dispatcher.hh b/src/gpu-compute/dispatcher.hh
index 7699cef..eafa080 100644
--- a/src/gpu-compute/dispatcher.hh
+++ b/src/gpu-compute/dispatcher.hh
@@ -92,6 +92,8 @@
 std::queue doneIds;
 // is there a kernel in execution?
 bool dispatchActive;
+// Enable exiting sim loop after each kernel completion
+bool kernelExitEvents;

   protected:
 struct GPUDispatcherStats : public statistics::Group

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


Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1d2c082291fdbcf27390913ffdffb963ec8080dd
Gerrit-Change-Number: 72098
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[release-staging-v23-0]: dev-amdgpu: Perform frame writes atomically

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72079?usp=email )



Change subject: dev-amdgpu: Perform frame writes atomically
..

dev-amdgpu: Perform frame writes atomically

The PCI read/write functions are atomic functions in gem5, meaning they
expect a response with a latency value on the same simulation Tick. For
reads to a PCI device, the response must also include a data value read
from the device.

The AMDGPU device has a PCI BAR which mirrors the frame buffer memory.
Currently reads are done atomically, but writes are sent to a DMA device
without waiting for a write completion ACK. As a result, it is possible
that writes can be queued in the DMA device long enough that another
read for a queued address arrives. This happens very deterministically
with the AtomicSimpleCPU and causes GPUFS to break with that CPU.

This change makes writes to the frame BAR atomic the same as reads. This
avoids that problem and as a result the AtomicSimpleCPU can now load the
driver for GPUFS simulations.

Change-Id: I9a8e8b172712c78b667ebcec81a0c5d0060234db
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71898
Maintainer: Matt Sinclair 
Tested-by: kokoro 
Reviewed-by: Matt Sinclair 
Maintainer: Matthew Poremba 
Reviewed-by: Matthew Poremba 
(cherry picked from commit 079fc47dc202ffe7c77e1e94bb1d5e0ee38d1816)
---
M src/dev/amdgpu/amdgpu_device.cc
1 file changed, 16 insertions(+), 2 deletions(-)



diff --git a/src/dev/amdgpu/amdgpu_device.cc  
b/src/dev/amdgpu/amdgpu_device.cc

index 3260d05..d1058f1 100644
--- a/src/dev/amdgpu/amdgpu_device.cc
+++ b/src/dev/amdgpu/amdgpu_device.cc
@@ -349,6 +349,22 @@
 }

 nbio.writeFrame(pkt, offset);
+
+/*
+ * Write the value to device memory. This must be done functionally
+ * because this method is called by the PCIDevice::write method which
+ * is a non-timing write.
+ */
+RequestPtr req = std::make_shared(offset, pkt->getSize(), 0,
+   vramRequestorId());
+PacketPtr writePkt = Packet::createWrite(req);
+uint8_t *dataPtr = new uint8_t[pkt->getSize()];
+std::memcpy(dataPtr, pkt->getPtr(),
+pkt->getSize() * sizeof(uint8_t));
+writePkt->dataDynamic(dataPtr);
+
+auto system = cp->shader()->gpuCmdProc.system();
+system->getDeviceMemory(writePkt)->access(writePkt);
 }

 void
@@ -489,8 +505,6 @@

 switch (barnum) {
   case FRAMEBUFFER_BAR:
-  gpuMemMgr->writeRequest(offset, pkt->getPtr(),
-  pkt->getSize(), 0, nullptr);
   writeFrame(pkt, offset);
   break;
   case DOORBELL_BAR:

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


Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v23-0
Gerrit-Change-Id: I9a8e8b172712c78b667ebcec81a0c5d0060234db
Gerrit-Change-Number: 72079
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce 
Gerrit-CC: Matthew Poremba 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [L] Change in gem5/gem5[release-staging-v23-0]: configs: Create base GPUFS vega config and atomic config

2023-07-06 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72078?usp=email )



Change subject: configs: Create base GPUFS vega config and atomic config
..

configs: Create base GPUFS vega config and atomic config

Move the Vega KVM script code to a common base file and add scripts for
KVM and atomic. Since atomic is now possible in GPUFS this gives a way
to run it without editing the current scripts.

Change-Id: I094bc4d4df856563535c28c1f6d6cc045d6734cd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71939
Tested-by: kokoro 
Reviewed-by: Matt Sinclair 
Maintainer: Matt Sinclair 
(cherry picked from commit 05ffa354268301821518fd430d069cd23049527d)
---
A configs/example/gpufs/vega10.py
A configs/example/gpufs/vega10_atomic.py
M configs/example/gpufs/vega10_kvm.py
3 files changed, 188 insertions(+), 124 deletions(-)



diff --git a/configs/example/gpufs/vega10.py  
b/configs/example/gpufs/vega10.py

new file mode 100644
index 000..9eff5a2
--- /dev/null
+++ b/configs/example/gpufs/vega10.py
@@ -0,0 +1,153 @@
+# Copyright (c) 2022-2023 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are  
met:

+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright  
notice,

+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS  
IS"

+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  
PURPOSE

+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF  
THE

+# POSSIBILITY OF SUCH DAMAGE.
+
+import m5
+import runfs
+import base64
+import tempfile
+import argparse
+import sys
+import os
+
+from amd import AmdGPUOptions
+from common import Options
+from common import GPUTLBOptions
+from ruby import Ruby
+
+
+demo_runscript_without_checkpoint = """\
+export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
+export HSA_ENABLE_INTERRUPT=0
+dmesg -n8
+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
+./myapp {}
+/sbin/m5 exit
+"""
+
+demo_runscript_with_checkpoint = """\
+export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH
+export HSA_ENABLE_INTERRUPT=0
+dmesg -n8
+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(
+"-a", "--app", default=None, help="GPU application to run"
+)
+parser.add_argument(
+"-o", "--opts", default="", help="GPU application arguments"
+)
+
+
+def runVegaGPUFS(cpu_type):
+parser = argparse.ArgumentParser()
+runfs.addRunFSOptions(parser)
+Options.addCommonOptions(parser)
+AmdGPUOptions.addAmdGPUOptions(parser)
+Ruby.define_options(parser)
+GPUTLBOptions.tlb_options(parser)
+addDemoOptions(parser)
+
+# Parse now so we can override options
+args = parser.parse_args()
+demo_runscript = ""
+
+# Create temp script to run application
+if args.app is None:
+print(f"No application given. Use {sys.argv[0]} -a ")
+sys.exit(1)
+elif args.kernel is None:
+print(f"No kernel path given. Use {sys.argv[0]} --kernel  
")

+sys.exit(1)
+elif