We use cookies to ensure that we give you the best experience on our website. You can change your cookie settings at any time. Otherwise, we'll assume you're OK to continue.

Durham University


Using MKL

Using MKL with COSMA8

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:

cat <<EOF > amdmkl.c
mkl_serv_intel_cpu_true() { return 1; }


gcc -shared -fPIC -o amdmkl.c

Permanent fix

Rather than remembering to set LD_PRLOAD everytime you run your application, add this to your program using:

patchelf --add-needed yourbinary

The information here was taken from