Kyle Roarty has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/47530 )
Change subject: configs,gpu-compute: Add support for gfx902/Raven
......................................................................
configs,gpu-compute: Add support for gfx902/Raven
This patch adds support for a gfx902 Vega APU, ripping the
appropriate values for device_id from the ROCm Thunk
(src/topology.c)
Note: gfx902 isn't officially supported by ROCm. This
means that it may not work for all programs. In particular,
rocBLAS is incompatible with gfx902, so anything that uses
rocBLAS won't be able to run with gfx902
Change-Id: I48893e7cc9c7e52275fdfd22314f371a9db8e90a
---
M configs/example/apu_se.py
M configs/example/hsaTopology.py
M src/gpu-compute/GPU.py
M src/gpu-compute/gpu_compute_driver.cc
M src/gpu-compute/gpu_compute_driver.hh
5 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py
index 8d49865..1e78f27 100644
--- a/configs/example/apu_se.py
+++ b/configs/example/apu_se.py
@@ -189,7 +189,7 @@
"between 0-7")
parser.add_argument("--gfx-version", type=str, default='gfx801',
- help="Gfx version for gpu: gfx801, gfx803, gfx900")
+ help="Gfx version for gpu: gfx801, gfx803, gfx900,
gfx902")
Ruby.define_options(parser)
@@ -682,7 +682,7 @@
elif args.gfx_version == 'gfx900':
hsaTopology.createVegaTopology(args)
else:
- assert (args.gfx_version in ['gfx801']),\
+ assert (args.gfx_version in ['gfx801', 'gfx902']),\
"Incorrect gfx version for APU"
hsaTopology.createCarrizoTopology(args)
diff --git a/configs/example/hsaTopology.py b/configs/example/hsaTopology.py
index da3bc57..7996a83 100644
--- a/configs/example/hsaTopology.py
+++ b/configs/example/hsaTopology.py
@@ -427,13 +427,21 @@
file_append((node_dir, 'gpu_id'), 2765)
# must have marketing name
- file_append((node_dir, 'name'), 'Carrizo\n')
+ if options.gfx_version == 'gfx801':
+ file_append((node_dir, 'name'), 'Carrizo\n')
+ elif options.gfx_version == 'gfx902':
+ file_append((node_dir, 'name'), 'Raven\n')
mem_banks_cnt = 1
# Should be the same as the render driver filename
(dri/renderD<drm_num>)
drm_num = 128
+ if options.gfx_version == 'gfx801':
+ device_id = 39028
+ elif options.gfx_version == 'gfx902':
+ device_id = 5597
+
# populate global node properties
# NOTE: SIMD count triggers a valid GPU agent creation
node_prop = 'cpu_cores_count %s\n' %
options.num_cpus + \
@@ -454,7 +462,7 @@
'simd_per_cu %s\n' %
options.simds_per_cu + \
'max_slots_scratch_cu
32\n' + \
'vendor_id
4098\n' + \
- 'device_id
39028\n' + \
+ 'device_id %s\n' %
device_id + \
'location_id
8\n' + \
'drm_render_minor %s\n' %
drm_num + \
'max_engine_clk_fcompute %s\n'
\
diff --git a/src/gpu-compute/GPU.py b/src/gpu-compute/GPU.py
index 107899e..e07f180 100644
--- a/src/gpu-compute/GPU.py
+++ b/src/gpu-compute/GPU.py
@@ -52,6 +52,7 @@
'gfx801',
'gfx803',
'gfx900',
+ 'gfx902',
]
class PoolManager(SimObject):
diff --git a/src/gpu-compute/gpu_compute_driver.cc
b/src/gpu-compute/gpu_compute_driver.cc
index 7edbbdb..f39576e 100644
--- a/src/gpu-compute/gpu_compute_driver.cc
+++ b/src/gpu-compute/gpu_compute_driver.cc
@@ -322,7 +322,7 @@
args->process_apertures[i].lds_limit =
ldsApeLimit(args->process_apertures[i].lds_base);
- if (isdGPU) {
+ if (isdGPU || gfxVersion == GfxVersion::gfx902) {
args->process_apertures[i].gpuvm_base = 0x1000000ull;
args->process_apertures[i].gpuvm_limit =
0x0000800000000000ULL - 1;
@@ -355,6 +355,7 @@
} else {
switch (gfxVersion) {
case GfxVersion::gfx801:
+ case GfxVersion::gfx902:
args->process_apertures[i].gpu_id = 2765;
break;
default:
@@ -593,7 +594,7 @@
scratchApeLimit(ape_args->scratch_base);
ape_args->lds_base = ldsApeBase(i + 1);
ape_args->lds_limit = ldsApeLimit(ape_args->lds_base);
- if (isdGPU) {
+ if (isdGPU || gfxVersion == GfxVersion::gfx902) {
ape_args->gpuvm_base = 0x1000000ull;
ape_args->gpuvm_limit = 0x0000800000000000ULL - 1;
} else {
@@ -618,6 +619,7 @@
} else {
switch (gfxVersion) {
case GfxVersion::gfx801:
+ case GfxVersion::gfx902:
ape_args->gpu_id = 2765;
break;
default:
@@ -667,7 +669,7 @@
TypedBufferArg<kfd_ioctl_alloc_memory_of_gpu_args>
args(ioc_buf);
args.copyIn(virt_proxy);
- assert(isdGPU);
+ assert(isdGPU || gfxVersion == GfxVersion::gfx902);
assert((args->va_addr % TheISA::PageBytes) == 0);
GEM5_VAR_USED Addr mmap_offset = 0;
diff --git a/src/gpu-compute/gpu_compute_driver.hh
b/src/gpu-compute/gpu_compute_driver.hh
index 48ca876..d59fc6f 100644
--- a/src/gpu-compute/gpu_compute_driver.hh
+++ b/src/gpu-compute/gpu_compute_driver.hh
@@ -87,6 +87,7 @@
switch (gfxVersion) {
case GfxVersion::gfx801:
case GfxVersion::gfx803:
+ case GfxVersion::gfx902:
return 4;
case GfxVersion::gfx900:
return 8;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/47530
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I48893e7cc9c7e52275fdfd22314f371a9db8e90a
Gerrit-Change-Number: 47530
Gerrit-PatchSet: 1
Gerrit-Owner: Kyle Roarty <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s