Welcome to AMD OS X

Why not register now to gain full access.

Chat about almost anything as long as it is within the rules.

 Advertising

#55103
gtrfxdso wrote:You can build your own openBLAS (make sure that shared library option should be switched on) and create symbolic links for refblas and mllapack to that dynlib. That’s it. OpenBLAS is faster than intelMKL running on AMD cpus + Windows.
I'd come across openBLAS in my searching but didn't really understand its uses. Thanks for the direction!

Man, this is gonna be a fun rabbit hole! (not yet sure if that is sarcastic or not)
Post Merged
FriedEngineer wrote:Man, this is gonna be a fun rabbit hole! (not yet sure if that is sarcastic or not)
Edit (Mon Mar 9, 2020):
Well, that was a fun rabbit hole! (turned out to not be very sarcastic at all!)

I haven't exhaustively tested it yet but so far I am now able to use things that rely on LAPACK and BLAS. Here's what now works (that didn't properly before):
- ode45
- plotting

For those who are interested, I'll do some additional testing and write up a guide to replicate what I did in the next few weeks.
Post Merged
Edit (Fri Mar 27, 2020):
The main reason for this is to use the OpenBLAS Library instead of the Intel Math Kernel Library (MKL).

Okay, so here's the basics of what I had to do
  • swap the libiomp5.dylib (this is just to launch matlab, as mentioned earlier in this thread)
  • Download and compile openBLAS with the AMD ZEN flag (TARGET=ZEN, which they note is pretty much the same as the Haswell optimization)
  • Copy the compiled dylib to MATLAB_R2019b/sys/os/maci64
  • Modify the blas.spec and lapack.spec files to point to that dylib
  • install gcc7 and change its link location in /usr/local/opt (defaults to [email protected] and openBLAS looks for it in gcc not [email protected])
Note: I have not exhaustively tested Matlab after this modification but it did resolve all the issues I'd seen so far.

If you're interested, here's the full instructions
(and the attached zip with the libraries)
To launch Matlab
  1. Go to "MATLAB_R2019b/sys/os/maci64" (to get here right click on the application and click "show contents" and then navigate to this folder)
  2. Rename "libiomp5.dylib" to "libiomp5.dylib.bak"
  3. Copy the included "libiomp5.dylib" to the same location
To use MKL based functions
  1. Install homebrew: this makes installing the required gcc 7 easier. You can start this and then do 2-3 below while it runs in the background. (See https://brew.sh/ for installation details). Note: it will also install the Xcode Command Line Tools
  2. Copy "libopenblas.dylib" to "MATLAB_R2019b/bin/maci64". The included library is OpenBLAS v0.3.9.
  3. Add a new line with "AuthenticAMD Family * Model * libopenblas.dylib #AMD" to the blas.spec and lapack.spec files located in MATLAB_R2019b/bin/maci64 (just open them in TextEdit). This tells Matlab to use the OpenBLAS library for all blas and lapack functions when it finds an AMD based system instead of the default mkl.dylib.
  4. Once homebrew is finished installing, in a terminal window (which you probably have open from installing homebrew) and type the command "brew install [email protected]" to install gcc version 7
  5. Go to /usr/local/opt (it's hidden so I'd recommend you use Finder's "Go to Folder" command to get there) and rename the "[email protected]" folder there to "gcc". This folder is just a link to the actual install location and openBLAS looks in gcc instead of [email protected] for the gcc 7 library it needs.
Attachments
(5.49 MiB) Downloaded 42 times
#56477
RuralWrench wrote:@FriedEngineer
Perfecttttt. Thanks for going down that rabbit hole! Matlab 2019b works for me now. I'll post here if I encounter any bugs.
Glad it helped!

Another user did find one bug so far: if you try to use a colorbar it throws the error "Cannot untransform a point, matrix may be invalid or singular". As far as I can tell this doesn't actually affect functionality or even drawing the colorbar properly, it just throws the error. I dove as deep as I could and found it's a java exception caused by using the OpenBLAS library (I was able to replicate it on my hack as well as my genuine MacBook Pro 2016 running OpenBLAS but neither when using Intel's MKL). So clearly it isn't perfect and YMMV but it's been working flawlessly for me (I only used colorbar in testing for this error)
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]