diff --git a/src/configure b/src/configure
index 7118a07736762e32dae06c79ea1ab365f51409a4..9de3b2827c9dfd9ccd6ebf01fc0bc173a11c263b 100755
--- a/src/configure
+++ b/src/configure
@@ -126,8 +126,12 @@ module load cce/16.0.0
 module load craype/2.7.21
 module load cray-mpich/8.1.26
 module load libfabric/1.15.2.0
+
+if ! ( [[ \"\${OPTLEVEL}\" =~ \"DEFONLY\" ]] ) ; then
 module load craype-accel-amd-gfx90a
 module load rocm/5.2.3
+fi
+
 module rm cray-libsci
 
 export CCE_ALIAS_NONE=:on