Hi, SAS 9.4 IML 15.1 is installed on my laptop, the license is ok. But when I try a matrix multiplication an error occurs above 160 rows which is ridiculously small (rc = 7) and when I try an inversion SAS crashes alltogether. My laptop runs on Windows 10 and AMD ryzen pro 5. I you have any clue it would help. Thanks.
Can you try and set the following environment variable in windows?
Name: MKL_DEBUG_CPU_TYPE
Value: 5
There is a defect in the the Intel Math Kernel Library (MKL), which SAS/IML uses to accelerate certain computations in a multi-threading situation (like in matrix multiplication). Unfortunately there is not much we can do to avoid the problem directly since Intel has not fixed the problem.
There is a workaround for this ERROR message : Put the following statements before and after the IML step:
options NOTHREADS;
proc iml;
.
.
.
quit;
options THREADS;
This prevents IML from creating multiple threads when multiplying large matrices and invoking the Windows MKL functions that are defective. There will be a loss of performance, but you should avoid the ERROR message.
Thanks for these elements but unfortunately I still get the error and the crash. Besides my laptop is not Intel core but AMD (the competitor) hence I am not sure whether I do have Intel MKL, unless SAS 9.4 deployment wizard gets it along (as it does with Java jre). And it seems you can't download Intel MKL alone but only as a part of Intel® Parallel Studio XE 2020 or Intel® System Studio 2020 Composer.
I suggest you open a track with SAS Technical Support. Be sure to supply your exact operating system, SAS Site Number and Precise release number. If you can share the program and data that is causing the issue then that will also help them figure out what is going on.
Can you try and set the following environment variable in windows?
Name: MKL_DEBUG_CPU_TYPE
Value: 5
Can you try and set the following environment variable in windows?
Name: MKL_DEBUG_CPU_TYPE
Value: 5
Wonderful ! It worked on a small testing program and on the whole complex one. Thanks a lot.
Hello @Abs92Stat,
Glad to see that @ardehg's solution worked for you. Then it would be fair if you marked @ardehg's helpful reply as the accepted solution, not your own "thank you" post. Could you please change that? It's very easy: Select the other post as the solution after clicking "Not the Solution" in the option menu (see icon below) of the current solution.
Done. Thanks for the how to, I realized my mistake but didn't know how to change it.
The testing program was quite simple :
proc iml;
D1=I(500);
j=1;
do i=2 to 500;
j=i-1;
D1[i,j]=-1;
end;
TD1=t(D1);
M=TD1*D1;
IM=inv(M);
print(IM);
quit;
But now thanks to the environment variable value changed the problem is solved. Have a great day.
Code submitted and example data may be helpful.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.