gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: dev-amdgpu,configs: Add human readable names for different GPUs

MP
Matthew Poremba (Gerrit)
Fri, Apr 28, 2023 12:48 AM

Matthew Poremba has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/70038?usp=email )

Change subject: dev-amdgpu,configs: Add human readable names for different
GPUs
......................................................................

dev-amdgpu,configs: Add human readable names for different GPUs

Add a human readable string for GPU device names rather than using the
device ID in the code. This is intended to make code more readable.

Change-Id: Id3ea74ca37422b1f4a0f09e5a9522d37b5998c1a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70038
Reviewed-by: Matt Sinclair mattdsinclair@gmail.com
Tested-by: kokoro noreply+kokoro@google.com
Reviewed-by: Jason Lowe-Power power.jg@gmail.com
Maintainer: Matt Sinclair mattdsinclair@gmail.com

M configs/example/gpufs/runfs.py
M configs/example/gpufs/system/amdgpu.py
M src/dev/amdgpu/AMDGPU.py
3 files changed, 24 insertions(+), 0 deletions(-)

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

diff --git a/configs/example/gpufs/runfs.py b/configs/example/gpufs/runfs.py
index 52b79ab..4c90601 100644
--- a/configs/example/gpufs/runfs.py
+++ b/configs/example/gpufs/runfs.py
@@ -126,6 +126,16 @@
help="type of memory to use",
)

  • These are the models that are both supported in gem5 and supported

  • by the versions of ROCm supported by gem5 in full system mode. For

  • other gfx versions there is some support in syscall emulation mode.

  • parser.add_argument(
  •    "--gpu-device",
    
  •    default="Vega10",
    
  •    choices=["Vega10", "MI100"],
    
  •    help="GPU model to run: Vega10 (gfx900) or MI100 (gfx908)",
    
  • )

def runGpuFSSystem(args):
"""
diff --git a/configs/example/gpufs/system/amdgpu.py
b/configs/example/gpufs/system/amdgpu.py
index 1fd3e2f..5f98b55 100644
--- a/configs/example/gpufs/system/amdgpu.py
+++ b/configs/example/gpufs/system/amdgpu.py
@@ -170,3 +170,14 @@
system.pc.south_bridge.gpu.checkpoint_before_mmios = (
args.checkpoint_before_mmios
)
+

  • system.pc.south_bridge.gpu.device_name = args.gpu_device
  • if args.gpu_device == "MI100":
  •    system.pc.south_bridge.gpu.DeviceID = 0x738C
    
  •    system.pc.south_bridge.gpu.SubsystemVendorID = 0x1002
    
  •    system.pc.south_bridge.gpu.SubsystemID = 0x0C34
    
  • elif args.gpu_device == "Vega10":
  •    system.pc.south_bridge.gpu.DeviceID = 0x6863
    
  • else:
  •    panic("Unknown GPU device: {}".format(args.gpu_device))
    

diff --git a/src/dev/amdgpu/AMDGPU.py b/src/dev/amdgpu/AMDGPU.py
index f9d953f..1e78672 100644
--- a/src/dev/amdgpu/AMDGPU.py
+++ b/src/dev/amdgpu/AMDGPU.py
@@ -46,6 +46,9 @@
cxx_header = "dev/amdgpu/amdgpu_device.hh"
cxx_class = "gem5::AMDGPUDevice"

  • Human readable name for device ID

  • device_name = Param.String("Vega10", "Codename for device")
  • # IDs for AMD Vega 10
    VendorID = 0x1002
    DeviceID = 0x6863
    

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

Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id3ea74ca37422b1f4a0f09e5a9522d37b5998c1a
Gerrit-Change-Number: 70038
Gerrit-PatchSet: 3
Gerrit-Owner: Matthew Poremba matthew.poremba@amd.com
Gerrit-Reviewer: Jason Lowe-Power jason@lowepower.com
Gerrit-Reviewer: Jason Lowe-Power power.jg@gmail.com
Gerrit-Reviewer: Matt Sinclair mattdsinclair@gmail.com
Gerrit-Reviewer: Matthew Poremba matthew.poremba@amd.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com

Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70038?usp=email ) Change subject: dev-amdgpu,configs: Add human readable names for different GPUs ...................................................................... dev-amdgpu,configs: Add human readable names for different GPUs Add a human readable string for GPU device names rather than using the device ID in the code. This is intended to make code more readable. Change-Id: Id3ea74ca37422b1f4a0f09e5a9522d37b5998c1a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70038 Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Matt Sinclair <mattdsinclair@gmail.com> --- M configs/example/gpufs/runfs.py M configs/example/gpufs/system/amdgpu.py M src/dev/amdgpu/AMDGPU.py 3 files changed, 24 insertions(+), 0 deletions(-) Approvals: Matt Sinclair: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass Jason Lowe-Power: Looks good to me, approved diff --git a/configs/example/gpufs/runfs.py b/configs/example/gpufs/runfs.py index 52b79ab..4c90601 100644 --- a/configs/example/gpufs/runfs.py +++ b/configs/example/gpufs/runfs.py @@ -126,6 +126,16 @@ help="type of memory to use", ) + # These are the models that are both supported in gem5 and supported + # by the versions of ROCm supported by gem5 in full system mode. For + # other gfx versions there is some support in syscall emulation mode. + parser.add_argument( + "--gpu-device", + default="Vega10", + choices=["Vega10", "MI100"], + help="GPU model to run: Vega10 (gfx900) or MI100 (gfx908)", + ) + def runGpuFSSystem(args): """ diff --git a/configs/example/gpufs/system/amdgpu.py b/configs/example/gpufs/system/amdgpu.py index 1fd3e2f..5f98b55 100644 --- a/configs/example/gpufs/system/amdgpu.py +++ b/configs/example/gpufs/system/amdgpu.py @@ -170,3 +170,14 @@ system.pc.south_bridge.gpu.checkpoint_before_mmios = ( args.checkpoint_before_mmios ) + + system.pc.south_bridge.gpu.device_name = args.gpu_device + + if args.gpu_device == "MI100": + system.pc.south_bridge.gpu.DeviceID = 0x738C + system.pc.south_bridge.gpu.SubsystemVendorID = 0x1002 + system.pc.south_bridge.gpu.SubsystemID = 0x0C34 + elif args.gpu_device == "Vega10": + system.pc.south_bridge.gpu.DeviceID = 0x6863 + else: + panic("Unknown GPU device: {}".format(args.gpu_device)) diff --git a/src/dev/amdgpu/AMDGPU.py b/src/dev/amdgpu/AMDGPU.py index f9d953f..1e78672 100644 --- a/src/dev/amdgpu/AMDGPU.py +++ b/src/dev/amdgpu/AMDGPU.py @@ -46,6 +46,9 @@ cxx_header = "dev/amdgpu/amdgpu_device.hh" cxx_class = "gem5::AMDGPUDevice" + # Human readable name for device ID + device_name = Param.String("Vega10", "Codename for device") + # IDs for AMD Vega 10 VendorID = 0x1002 DeviceID = 0x6863 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70038?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Id3ea74ca37422b1f4a0f09e5a9522d37b5998c1a Gerrit-Change-Number: 70038 Gerrit-PatchSet: 3 Gerrit-Owner: Matthew Poremba <matthew.poremba@amd.com> Gerrit-Reviewer: Jason Lowe-Power <jason@lowepower.com> Gerrit-Reviewer: Jason Lowe-Power <power.jg@gmail.com> Gerrit-Reviewer: Matt Sinclair <mattdsinclair@gmail.com> Gerrit-Reviewer: Matthew Poremba <matthew.poremba@amd.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com>