Getting Matlab to run on a newer Athlon 64 (X2) CPU

I recently installed Matlab v7.0 (R14) on my new computer and ran into some troubles. After starting Matlab, the program window would open as normal, but then it would shutdown almost immediately, usually after about a second or so delay, allowing me to tantalizingly see that it almost working. I did a search and found this helpful article on how to fix the problem.

The issue (Matlab closing right after start-up) stems from Matlab (at least this version, the newer versions might not be affected) not “recognizing” the processor string for newer AMD Athlon 64-based processors; in my case, I had an Athlon 64 X2 3800+. Matlab relies on different Basic Linear Algebra Subprograms (or BLAS) routines for different types of CPUs, and these are stored in different DLL files.

The BLAS file responsible for telling Matlab which DLL file to use for what type of CPU is located at:

%MATLAB7%\bin\win32\blas.spec
(where %MATLAB7% is the path to your Matlab installation)

To fix the problem, open up the file in a text-editor, and add the following two lines to the bottom:

AuthenticAMD Family 15 Model 12 atlas_Athlon.dll # Athlon 64 (Newcastle)
AuthenticAMD Family 15 Model * atlas_Athlon.dll # AMD64

This will tell Matlab to use the proper DLL file with your newer AMD-64-based CPU, instead of apparently defaulting to using a Pentium DLL file when an unrecognized CPU is detected.

More on the problem

As mentioned, the problem stems from the CPU being unrecognized by Matlab’s configuration file. All CPUs have some sort of identifier string, and Matlab uses this to determine what DLL file to use. When an unrecognized CPU string is detected, it apparently defaults to using a Pentium DLL file; this results in Matlab crashing when it’s run on an AMD-64-based CPU, and results in the crash-on-start behaviour.

Why the different DLL files for different CPUs? My guess is that the BLAS, upon which Matlab is based, are optimized or made to work better with select CPUs. It should be noted that these problems may not be experienced if you’re running a more current version of Matlab.

I did a little more searching and found this forum thread over at the Matlab website, where a different fix for the same problem is presented. It involves setting a Windows environment variable instead of editing the blas.spec file, but should do the same thing; I haven’t tried it. This other forum thread also details a similar procedure.

Hope this helps in fixing any Matlab ailments you might have had, because running into a problem like this can be frustrating as heck when you need to have an assignment done for tomorrow!

Update

I’d just like to say that a dual-core setup totally rocks. It’s awesome to be able to still play CS:S while running a Matlab simulation.

72 Comments »

  1. Thanks Man!

  2. Hey man, this threat helped me a lot, thank you (and Google) so much for the quick fix. Now I can finish my assignment due tomorrow!

  3. Thanks a million buddy

  4. it seems to work for my processor too!
    i did as a121 said
    “AuthenticAMD Family 15 Model 12 atlas_Athlon.dll # Turion 64 (Lancaster)

    for my AMD Turion TL62

    anyway time to upgrade ๐Ÿ™‚

  5. Thank you, it worked on my 3200+ Newcastle too ๐Ÿ™‚
    I almost reinstall my windows XP…

  6. […] http://unitstep.net/blog/2006/08/21/getting-matlab-to-run-on-a-newer-athlon-64-x2-cpu/ […]

  7. Tnank’s very mauch for the information, but that did not worked out at all. So, what did I.
    I opened the Control Panel => Perfomance and Maintenance => System => Advanced => to access to the environnement (Frechised English) system variables. As I looked at the system variables I scroll down and I saw that my AMD X3 720 BE was classed as Family 16. And after many times trying and having a crash-down when I wrote “AuthenticAMD Family 16 Model 4 atlas_Athlon.dll” I could run the Application Program Matlab 7.0 R14 with out any problem. SO IF YOU can not solve the crash’s take a look at yours system variables to see how your processor is reported as.

  8. uP: AMD Athlon X2 7750
    OS: WINXPSP3

    Well the first option (editing the blas.spec file) didn’t work, but the third one did. It’s pretty straightforward:

    “Under “Variable” type “BLAS_VERSION”
    Under value put “c:\Matlab7\bin\win32\atlas_Athlon.dll””

    The link again:
    http://www.codecomments.com/archive381-2005-5-505181.html

    Thank you man. I knew that the problem was about architecture ๐Ÿ˜‰

  9. this worked man , really gratefull

  10. Thanks a lot! Tried a lot of solutions that didn’t work…but this one rocks ๐Ÿ™‚

  11. Thanks dude.

  12. Hi,

    I’m having a Problem with Matlab (on Mac) that I never had before: when I run a calculation, after e few seconds, the calculation stops an Matlab closes himself without any error message. Does anyone know the Problem or (better) has an idea on how to solve it?

    thanks
    tom

  13. runtime error
    plz help me

  14. Thanks lot bro!!!!

  15. I have some troubles with matlab r2008a… My processore is AMD Turion(tm) X2 ULTRA DUAL-CORE MOBILE ZM-80.. I was trying to add those two lines in the windows acces bridge document but nothing happen… Matlab does not start up…I have been surfing many forums and i found some possible solutions like adding enviromental variables such as:Blas, Java_Home,Temp…Can somebody help me please…. Thanks

  16. Hi, My computer is AMD Athlon64, and I try to run Matlab program but I can’t do some thing. The computer can run Matlab 7.0 version. I think that the Matlab program can’t be used in AMD computer!

  17. hey what about the AMD Athlon(tm) II P320
    processor, pliz help. modifying the blas.spec file does not help>> pliz help

  18. THANKS A LOT!!!!!!This tip totally made MATLAB work!!!You rock my friend!!!Long live electrical engineering!!!!:)

  19. Hey guys,
    When i add the text to the spec file in notepad it wont let me save it..
    Can you please help?

  20. @anderi

    Thanks a lot!!! at last it works

  21. Hello. I just installed Matlab 7, it crashed the way mentioned. I googled, and this article came as the 2nd result. It solved the problem like magic ๐Ÿ™‚ Thanks a lot.

  22. Thanks a Lot…Will be there anything to add if it is an INTEL processor..?

Comments are now closed for this entry.