Install parallel computing toolbox in matlab docker

Hi Community,
I am struggling with installing parallel computing toolbox within matlab docker images (latest version).
Some problems:
1. The matlab docker image browser version does not support Add-on Explorer, which means I cannot install the toolbox directly.
2. The docker image suggests using File Exchange to download the toolbox. However, I can not find the parallel computing toolbox in File Exchange.
3. With my education license, the parallel computing toolbox is automatically installed. No .mltbx file is provided, which makes local installation inaccessible inside docker.
On the other hand, the offical matlab docker documentation says add-ons can be installed.
Can anyone offer some help? Thank you very much !!!

 採用された回答

Kojiro Saito
Kojiro Saito 2022 年 12 月 5 日
編集済み: Kojiro Saito 2022 年 12 月 6 日

2 投票

Web browser version does not support Add-On Explorer, so, you need to launch MATLAB with VNC options.
docker run -it --rm -p 5901:5901 -p 6080:6080 --shm-size=512M mathworks/matlab:r2022b -vnc
Then, in your web browser, type "http://localhost:6080/" in address bar.
You can access Linux's desktop environment.
Next, launch "Terminal Emulator", and type
sudo matlab
to launch MATLAB with sudo. It's because MATLAB is installed in /opt/matlab/R2022b with root write permissions.
Then, you can launch Add On Explorer and install toolboxes.
UPDATED
Also, there is a command line way instead of Add-On Explorer.
MATLAB Package Manager (MPM) is available from GitHub.
In Terminal Emulator, download MPM with wget and install Parallel Computing Toolbox with MPM.
wget https://www.mathworks.com/mpm/glnxa64/mpm
chmod +x mpm
sudo ./mpm install --release=R2022b --destination=/opt/matlab/R2022b/ --products Parallel_Computing_Toolbox
Installation Results:
Hope this work.

6 件のコメント

J.
J. 2022 年 12 月 5 日
Thanks Kojiro! Your solution is working. However, it takes very long to install a toolbox inside the docker image. I am not sure why. I will "accept this answer" after everything is sorted out. Meanwhile, if I encounter new problems, I will keep posting in this thread. Thank you again!
Kojiro Saito
Kojiro Saito 2022 年 12 月 6 日
Thank you. I've updated my answer to include command line way (MPM). MPM might be faster than Add-On Explorer. Hope this work.
J.
J. 2022 年 12 月 12 日
@Kojiro Saito thanks for the update! I followed your instruction and successfully installed the toolbox. Everything works fine. (The installation took some time to finish and requires more space than desktop version.) Thank you very much!
Caspar Hanselaar
Caspar Hanselaar 2023 年 3 月 24 日
移動済み: Kojiro Saito 2023 年 3 月 27 日
Dear @Kojiro Saito, Thank you for the extended answer. I'm trying to install the ROS2 toolbox in a matlab docker container. I'm running into the 2 following problems:
  1. If I run sudo matlab, the VNC crashes, and cannot reconnect. I see the matlab loader splash screen, followed by noVNC disconnecting, and returning a Failed to connect to server message. The container continues to run in the background.
  2. Starting matlab regularly doesn't cause the VNC to disconnect. However, then i cannot reach the add-on explorer window.
  3. I've failed to find a suitable link to download the ros2 toolbox, and the matlab website is generally really unhelpful in allowing me direct access to download a toolbox file. So I can't alter your second option to get it working for the ros toolbox.
I hope that you'll be able to help me succeed in either way of progressing.
System information:
M1 mac, 16GB with 8GB and 4 cores allocated to the docker desktop program, running matlab 2022B in a docker container using:
docker run -it -p 6080:6080 -v /Users/username/specificfolder:/data --shm-size=512M --name=MatlabContainer mathworks/matlab:r2022b -vnc
Kojiro Saito
Kojiro Saito 2023 年 3 月 27 日
Regarding above 3., product names should be ROS_Toolbox for ROS Toolbox.
So, the following will work.
sudo ./mpm install --release=R2022b --destination=/path/to/MATLAB/R2022b/ --product ROS_Toolbox
Caspar Hanselaar
Caspar Hanselaar 2023 年 3 月 27 日
Thank you for the quick answer, installation is now running!

サインインしてコメントする。

その他の回答 (1 件)

Prabhakar
Prabhakar 2023 年 3 月 27 日

0 投票

One could also build a container with additional toolboxes by using the Dockerfile listed below.
This example installs the ROS Toolbox & the Parallel Computing Toolbox. Using the MATLAB Package Manager.
See MPM.md for more information.
Commands to run on your terminal:
#Ensures that latest image is pulled
docker pull mathworks/matlab:r2022b
#navigate to the directory in which you have Downloaded the provided Dockerfile
docker build -t matlab-with-toolboxes:r2022b .
#run your container to verify that the desired toolboxes are present
docker run -it --rm matlab-with-toolboxes:r2022b
Running matlab
MATLAB is selecting SOFTWARE OPENGL rendering.
Please enter your MathWorks Account email address and press Enter:
enter-your@mathworks-account-email.com
Single-Sign-On(SSO) is not available in this environment. You need a one-time password to sign in to MATLAB.
Step 1. Visit https://www.mathworks.com/mw_account/otp
Step 2. Copy the password.
Step 3. Return here, and input the password.
Please enter the one-time password:
475445
Starting MATLAB with license: 2352353
< M A T L A B (R) >
Copyright 1984-2022 The MathWorks, Inc.
R2022b Update 5 (9.13.0.2193358) 64-bit (glnxa64)
February 10, 2023
Warning: X does not support locale C
To get started, type doc.
For product information, visit www.mathworks.com.
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.13.0.2193358 (R2022b) Update 5
MATLAB License Number: 40447121
Operating System: Linux 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.13 (R2022b)
Parallel Computing Toolbox Version 7.7 (R2022b)
ROS Toolbox Version 1.6 (R2022b)
Dockerfile:
FROM mathworks/matlab:r2022b
USER root
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
apt-get install --no-install-recommends --yes wget \
build-essential \
cmake && \
apt-get clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*
WORKDIR /opt/matlab
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm && \
chmod +x mpm && \
./mpm install --destination=/opt/matlab/R2022b/ --release=R2022b \
ROS_Toolbox Parallel_Computing_Toolbox \
|| (echo "MPM Installation Failure. See below for more information:" && cat /tmp/mathworks_root.log && false) && \
rm -f mpm /tmp/mathworks_root.log && \
ln -fs /opt/matlab/R2022b/bin/matlab /usr/local/bin/matlab
WORKDIR /home/matlab/Documents/MATLAB
USER matlab
HTH

1 件のコメント

Prabhakar
Prabhakar 2024 年 4 月 9 日
Yes, https://github.com/mathworks-ref-arch/matlab-dockerfile/tree/main/mpm-input-files
It's usage is documented in the MPM readme in the same repository.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2022b

質問済み:

J.
2022 年 12 月 4 日

コメント済み:

2024 年 4 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by