Matlab

Last modified by Niko-Ville Koljonen on 2024/12/10 12:41

Current version of Matlab installation in Cubbli 22 and Cubbli 24 is 2024b as of 2024-09. This installation includes all downloadable Matlab add ons. By default the installation uses a network license server  when Matlab is started. The license server works only inside University of Helsinki network or when using a VPN connection. If Matlab does not start, connect to a VPN first. If you must use Matlab offline you can obtain a personal Matlab license file. Matlab can also be run from the command line and over ssh sessions.

Information

The current version (2024b) doesn't run with software opengl enabled by default so this has been automated by cubbli-administrators. 

If you need to run Matlab with 3D-acceleration you can do it by starting Matlab from the command line:

$ matlab -nosoftwareopengl

This will overwrite the automated use of software opengl. Note that this is currently not working (which is why we have automated the software rendering).

But if you have a dual gpu laptop (with Nvidia), you can actually force it to use 3D-acceleration with:

$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia matlab -nosoftwareopengl

 

License

Matlab is proprietary and expensive software and will not work without a license. If you can't use the default license server (you want to work offline), you can obtain a personal license file from mathworks.com and install it to  /opt/MATLAB/licenses/ directory. Remember to remove the network license file /opt/MATLAB/licenses/network.lic

Installing Matlab yourself

If you want to use a different version of Matlab or want to manage downloaded add ons and updates yourself, you can download Matlab by logging in to mathworks.com and logging in with your helsinki.fi email account. You don't need sudo (admin) rights when installing Matlab and if you have them, they shoud not be used. When Matlab asks where it should be installed, specify a subdirectory in your own home directory. If you attempt to install the full installation to a system directory the system partition will get full and it will interfere with the Matlab installation provided by Cubbli administrators and full system partition will interfere with everything. 

Technical details

Since Matlab installation requires a more than 25G space when uncompressed, Cubbli Matlab installation is saved instead in a xz compressed squashfs filesystem image, which is then mounted so that it looks like a regular filesystem. Only the license file directory is writable by local users and is pointed by a symlink from the readonly squashfs filesystem with a symlink.  Here are the directory containing licenses, the squashfs image and the directory where it is mounted: 

jjaakkol@melkki:~$ ls -lhd /opt/MATLAB/R2021b /opt/MATLAB R2021b.squashfs /opt/MATLAB/licenses/
drwxrwsr-x 2 root local 4.0K Nov 10 13:14 /opt/MATLAB/licenses/
dr-xr-xr-x 22 root root 613 Nov 10 09:33 /opt/MATLAB/R2021b
-rw-r--r-- 1 root root 11G Nov 10 12:23 /opt/MATLAB/R2021b.squashfs

Screenshots

Screenshot from 2021-11-10 11-34-46.png

Screenshot from 2021-11-10 13-42-52.png