By default, MKL (the Intel Math Kernel Library) does not select the best the best options when used on COSMA8, delivering significantly lower performance. For versions of MKL prior to 2020, setting MKL_DEBUG_CPU_TYPE=5 would force it to use the zen2 code path. However, for newer versions, this no longer works. Instead, the following workaround should be used:
MKL_DEBUG_CPU_TYPE=5
cat <<EOF > amdmkl.cint mkl_serv_intel_cpu_true() { return 1; }
EOF
gcc -shared -fPIC -o libamdmkl.so amdmkl.c
export LD_PRELOAD=libamdmkl.so
Rather than remembering to set LD_PRLOAD everytime you run your application, add this to your program using:
patchelf --add-needed libamdmkl.so yourbinary
The information here was taken from https://danieldk.eu/Posts/2020-08-31-MKL-Zen.html