From 991ff2fd94c3696d0d2f3b804b44f06d927bb0d5 Mon Sep 17 00:00:00 2001 From: "Mark W. Krentel" Date: Wed, 13 Jan 2021 02:54:17 -0600 Subject: [PATCH] hpctoolkit: add variant to support rocm (#20826) Add early support for ROCM on AMD GPUs, for develop branch only. Requires ROCM packages to be specified as external packages. --- .../repos/builtin/packages/hpctoolkit/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/var/spack/repos/builtin/packages/hpctoolkit/package.py b/var/spack/repos/builtin/packages/hpctoolkit/package.py index 6c9c7ab095..170e714e55 100644 --- a/var/spack/repos/builtin/packages/hpctoolkit/package.py +++ b/var/spack/repos/builtin/packages/hpctoolkit/package.py @@ -55,6 +55,10 @@ class Hpctoolkit(AutotoolsPackage): variant('cuda', default=False, description='Support CUDA on NVIDIA GPUs (2020.03.01 or later).') + variant('rocm', default=False, + description='Support ROCM on AMD GPUs (develop branch only, ' + 'requires ROCM as external packages.') + boost_libs = ( '+atomic +chrono +date_time +filesystem +system +thread +timer' ' +graph +regex +shared +multithreaded visibility=global' @@ -84,6 +88,10 @@ class Hpctoolkit(AutotoolsPackage): depends_on('libpfm4', when='~papi') depends_on('mpi', when='+mpi') + depends_on('hip', when='@develop+rocm') + depends_on('rocm-dbgapi', when='@develop+rocm') + depends_on('roctracer-dev', when='@develop+rocm') + conflicts('%gcc@:4.7.99', when='^dyninst@10.0.0:', msg='hpctoolkit requires gnu gcc 4.8.x or later') @@ -126,6 +134,13 @@ def configure_args(self): else: args.append('--with-perfmon=%s' % spec['libpfm4'].prefix) + if spec.satisfies('@develop+rocm'): + args.extend([ + '--with-rocm-hip=%s' % spec['hip'].prefix, + '--with-rocm-dbgapi=%s' % spec['rocm-dbgapi'].prefix, + '--with-rocm-tracer=%s' % spec['roctracer-dev'].prefix, + ]) + # MPI options for hpcprof-mpi. if '+cray' in spec: args.extend([