BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Abs92Stat
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ardehg
SAS Employee

Can you try and set the following environment variable in windows?

Name: MKL_DEBUG_CPU_TYPE

Value: 5

View solution in original post

9 REPLIES 9
SAS_Rob
SAS Employee

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.

Abs92Stat
Fluorite | Level 6

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.

SAS_Rob
SAS Employee

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.

https://www.sas.com/en_us/contact/technical-support.html 

ardehg
SAS Employee

Can you try and set the following environment variable in windows?

Name: MKL_DEBUG_CPU_TYPE

Value: 5

Abs92Stat
Fluorite | Level 6

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.

FreelanceReinh
Jade | Level 19

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.
show_option_menu.png

Abs92Stat
Fluorite | Level 6

Done. Thanks for the how to, I realized my mistake but didn't know how to change it.

Abs92Stat
Fluorite | Level 6

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.

ballardw
Super User

Code submitted and example data may be helpful.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

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.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 9 replies
  • 1250 views
  • 2 likes
  • 5 in conversation