An unofficial native CVX 2.2 package for Apple Sillicon (M1, M2, etc., Matlab architecture MACA64) is available. With this package it is possible to use CVX directly in the Matlab releases for Apple Sillicon (starting R2023b), without having to use the Intel version through the Rosetta emulator.
The package is the work of @mikewong (Dr. Wenyuan (Mike) Wang, who was the main driving force behind this project) and myself, and we publish it with the kind permission of @mcg. It contains only the smallest amount of formal modifications of the publicly available CVX 2.2 needed to get it to work; all algorithms and internals of CVX are unchanged. Installation and usage are the same as always.
Some remarks: it worked for us but testing was scarce; there are no guarantees of any kind; we do not have the capacity to provide support; SeDuMi and SDPT3 are included, MOSEK has to be installed separately the way one normally uses an external MOSEK; to our best knowledge recent versions of GUROBI were incompatible with CVX already for a while and this does not change here; all usage is at your own risk.
@mikewong reports a considerable speedup compared to running the Intel version via Rosetta on his problems. Again, we can make no general promises.
Thanks for the effort in making this available. I’ve downloaded and installed the package. It took about 10 attempts running cvx_setup to set the individual security authorisations for each of the mex files. And a couple more running some code with found some mex code not exercised in the cvx_setup procedure.
But after doing this it works very well. My experience is also that it is significantly faster. I’ve also simultaneously upgraded to R2023b from R2020b and that may have also had an effect. I haven’t run any comprehensive timing tests though.
Ok thank you. Excuse my possible lack of understanding, the zip file in this unofficial package for Apple Silicon attached, doesn’t have the CVX bundle with the gurobi package incorporated. From my understanding of reading threads, the CVX bundle with the gurobi package 9.0 still works, but this bundle is incompatibly with native CVX for apple silicon. Is there something I can do to get the CVX bundle with gurobi 9.0 running on my M3 apple chip?
If you want the official CVX package to work you have to install the Matlab release for the Intel chip (OSX Intel) and run the official CVX in it. It will run through the Rosetta emulator. In other words exactly how you would do it before we made this unofficial package, or before Matlab for M1,2,3 became available. Due to emulation it is simply not as efficient as the native one.
@mcg intends to open-source CVX. Then everybody will be able to go in and fix the Gurobi-CVX interface to make it compatible with the current Gurobi Toolbox for Matlab and make Gurobi work again.
Thanks for cross-posting @Mark_L_Stone . The bundles currently being built over at Releases · cvxr/CVX · GitHub do include macOS Apple Silicon builds, but they do not yet have Mosek or Gurobi shims. Once we get the open-source versions of those shims in there, I think we’ll be in a good place for people to start relying on that bundle as the true, official release.
This is what worked for me today, when all else failed. I am using a MacBook Air (M1) with OS 15.1 and Matlab R2024b. Of course, you have hit “open anyway” and enter your password into “system settings” for about 10 times and re-reun cvx_setup.m as many times before it successfully installs. Still.