MATLAB Answers

1

Does Matlab perform well on AMD Ryzen?

Asked by TeichEnterich95 on 20 Mar 2017
Latest activity Answered by Ned Flanders on 19 Nov 2019 at 11:39
Hi,
i want to buy a new CPU for Matlab but I am not sure if the new AMD Ryzen 1800X performs well on matlab. I know that the performance depends on the code you are running, but maybe there are some Ryzen owners out there who could post the results from the "bench" function.
Thanks. :)

  2 Comments

I bought a system with the Ryzen 1800 processor (delivered on 3/30/17) for use with Simulink. Although the Ryzen has 8 cores and does well on the PassMark CPU test, it's slower than my i7-4790. A Google search shows that the Ryzen may have issues with the Windows 10 scheduler which limits is multi-threading abilities. I'm hopeful for a software patch...soon.
Hi, I'm thinking about buying a ryzen 7 too... Any news about a software patch so far ? Thanks!

Sign in to comment.

3 Answers

Answer by Ned Flanders meno di un minuto ago

AMD Ryzen CPUs perform excellent using Matlab, if you perform a very simple Tweak.
You should read it if you want to understand the background. If you just want to apply the tweak, follow these steps:
Solution 1 (Windows): Create a .bat file using e.g. "Notepad" with the following lines to start Matlab in AVX2 Mode.
@echo off
set MKL_DEBUG_CPU_TYPE=5
call "%MKLROOT%\bin\mklvars.bat" MKL_DEBUG_CPU_TYPE=5
matlab.exe
Save as .txt and rename to .bat. If you double-click that file, Matlab will start the MKL in AVX2 Mode. If you start it the normal way, it will remain as always.
You can also download the .bat file from my highdrive if you trust me (which typically you should not as I am a random guy from the internet). If you delete the startup batch file provided in the download or the one you created yourself, its gone and your computer will be as it has been before.
Solution 2 (Windows): If you are happy with the results (which you surely will be :-)), you should make the setting permanent by entering MKL_DEBUG_CPU_TYPE=5 into the System Environment Variables. This has several advantages, one of them being that it applies to all instances of Matlab and not just the one opened using the .bat file.
Doing this will make the change permanent and available to ALL Programs using the MKL on your system until you delete the entry again.
LINUX: (Thanks to foreignrobot)
Simply type in a terminal:
export MKL_DEBUG_CPU_TYPE=5
and then run matlab from the same terminal.
For benchmarking, you can use this script:
To make it permanent in Linux edit your shell's configuration scripts (~/.bashrc for bash, ~/.zshrc for zsh etc) adding the line export MKL_DEBUG_CPU_TYPE=5. That'll apply in any newly opened shell and to apply it in an already open one simply do . ~/.bashrc or whatever your config script name is. (Thanks to lowpolybutt)
Disclaimer: I OF COURSE CANNOT AND DO NOT TAKE RESPONSIBILITIES FOR ISSUES RESULTING FROM USING THIS TWEAK.

  0 Comments

Sign in to comment.


Answer by Jan
on 21 Mar 2017
Edited by Jan
on 22 Aug 2017

It depends if the used libraries call FMA3 commands. If so, the Ryzen crashes very fast.
The performance will depend on your programs. If writing to the disk is the bottleneck, the processor will not matter. If your code is parallelized, the number of cores rule. If memory is the limitation, buying a cheaper processor can mean, that you install more RAM. Then benchmarks of Matlab have a limited power only. Therefore I do not think that there is a general answer except for: The Ryzen is good!
As usual I mention, that you only have to wait some years to get a processor with te double performance, but writing efficient code can accelerate a program by a factor of 100 easily.

  0 Comments

Sign in to comment.


Answer by Robert Lee on 10 May 2017

Ryzen 1700 owner here, can't bench atm but I can update this later if you want one.
Ryzen is only worth it if you want to do parallel pool stuff (multi threaded), otherwise you may aswell get yourself a top end i3.
If you are wanting to do parallel pool stuff I'd be wary, I've had a lot of crashes doing parallel pool simulations with Ryzen that aren't occurring with intel CPUs - can't say with any certainty that Ryzen is to blame though.

  2 Comments

Hello, I am thinking about buying a Ryzen 7 (1700, 1700x or 1800x). I wonder if you have some news about its use with Matlab ? Does it still crashes ? Did you do a benchmark ?
All Ryzen 7 Cpus have weak 8 cores. If you'll be using MATLAB with general routines, without parallel pool, you'll be getting a worse performance than a slow core i3 since 1 core of Ryzen 7 is a lot weaker than 1 intel core.
Ryzen 7 performs well only when all 8 cores are used, therefore, it is very bad for MATLAB and any single core software.

Sign in to comment.