domino logo
Tech Ecosystem
Get started with Python
Step 0: Orient yourself to DominoStep 1: Create a projectStep 2: Configure your projectStep 3: Start a workspaceStep 4: Get your files and dataStep 5: Develop your modelStep 6: Clean up WorkspacesStep 7: Deploy your model
Get started with R
Step 0: Orient yourself to Domino (R Tutorial)Step 1: Create a projectStep 2: Configure your projectStep 3: Start a workspaceStep 4: Get your files and dataStep 5: Develop your modelStep 6: Clean up WorkspacesStep 7: Deploy your model
Get Started with MATLAB
Step 1: Orient yourself to DominoStep 2: Create a Domino ProjectStep 3: Configure Your Domino ProjectStep 4: Start a MATLAB WorkspaceStep 5: Fetch and Save Your DataStep 6: Develop Your ModelStep 7: Clean Up Your Workspace
Step 8: Deploy Your Model
Scheduled JobsLaunchers
Step 9: Working with Domino Datasets
Domino Reference
Notifications
On-Demand Open MPI
Configure MPI PrerequisitesFile Sync MPI ClustersValidate MPI VersionWork with your ClusterManage Dependencies
Projects
Projects Overview
Revert Projects and Files
Revert a ProjectRevert a File
Projects PortfolioReference ProjectsProject Goals in Domino 4+
Git Integration
Git Repositories in DominoGit-based Projects with CodeSyncWorking from a Commit ID in Git
Jira Integration in DominoUpload Files to Domino using your BrowserFork and Merge ProjectsSearchSharing and CollaborationCommentsDomino Service FilesystemCompare File RevisionsArchive a Project
Advanced Project Settings
Project DependenciesProject TagsRename a ProjectSet up your Project to Ignore FilesUpload files larger than 550MBExporting Files as a Python or R PackageTransfer Project Ownership
Domino Runs
JobsDiagnostic Statistics with dominostats.jsonNotificationsResultsRun Comparison
Advanced Options for Domino Runs
Run StatesDomino Environment VariablesEnvironment Variables for Secure Credential StorageUse Apache Airflow with Domino
Scheduled Jobs
Domino Workspaces
WorkspacesUse Git in Your WorkspaceRecreate A Workspace From A Previous CommitUse Visual Studio Code in Domino WorkspacesPersist RStudio PreferencesAccess Multiple Hosted Applications in one Workspace Session
Spark on Domino
On-Demand Spark
On-Demand Spark OverviewValidated Spark VersionConfigure PrerequisitesWork with your ClusterManage DependenciesWork with Data
External Hadoop and Spark
Hadoop and Spark OverviewConnect to a Cloudera CDH5 cluster from DominoConnect to a Hortonworks cluster from DominoConnect to a MapR cluster from DominoConnect to an Amazon EMR cluster from DominoRun Local Spark on a Domino ExecutorUse PySpark in Jupyter WorkspacesKerberos Authentication
On-Demand Ray
On-Demand Ray OverviewValidated Ray VersionConfigure PrerequisitesWork with your ClusterManage DependenciesWork with Data
On-Demand Dask
On-Demand Dask OverviewValidated Dask VersionConfigure PrerequisitesWork with Your ClusterManage DependenciesWork with Data
Customize the Domino Software Environment
Environment ManagementDomino Standard EnvironmentsInstall Packages and DependenciesAdd Workspace IDEsAdding Jupyter Kernels
Use Custom Images as a Compute Environment
Pre-requisites for Automatic Custom Image CompatibilityModify the Default Workspace ToolsCreate a Domino Image with an NGC ContainerCreate a Domino Environment with a Pre-Built ImageManually Modify Images for Domino Compatibility
Partner Environments for Domino
Use MATLAB as a WorkspaceUse Stata as a WorkspaceUse SAS as a Workspace
Advanced Options for Domino Software Environment
Publish in Domino with Custom ImagesInstall Custom Packages in Domino with Git IntegrationAdd Custom DNS Servers to Your Domino EnvironmentConfigure a Compute Environment to User Private Cran/Conda/PyPi MirrorsUse TensorBoard in Jupyter Workspaces
Publish your Work
Publish a Model API
Model Publishing OverviewModel Invocation SettingsModel Access and CollaborationModel Deployment ConfigurationPromote Projects to ProductionExport Model ImageExport to NVIDIA Fleet Command
Publish a Web Application
App Publishing OverviewGet Started with DashGet Started with ShinyGet Started with FlaskContent Security Policies for Web Apps
Advanced Web Application Settings in Domino
App Scaling and PerformanceHost HTML Pages from DominoHow to Get the Domino Username of an App Viewer
Launchers
Launchers OverviewAdvanced Launcher Editor
Assets Portfolio Overview
Model Monitoring and Remediation
Monitor WorkflowsData Drift and Quality Monitoring
Set up Monitoring for Model APIs
Set up Prediction CaptureSet up Drift DetectionSet up Model Quality MonitoringSet up NotificationsSet Scheduled ChecksSet up Cohort Analysis
Set up Model Monitor
Connect a Data SourceRegister a ModelSet up Drift DetectionSet up Model Quality MonitoringSet up Cohort AnalysisSet up NotificationsSet Scheduled ChecksUnregister a Model
Use Monitoring
Access the Monitor DashboardAnalyze Data DriftAnalyze Model QualityExclude Features from Scheduled Checks
Remediation
Cohort Analysis
Review the Cohort Analysis
Remediate a Model API
Monitor Settings
API TokenHealth DashboardNotification ChannelsTest Defaults
Monitoring Config JSON
Supported Binning Methods
Model Monitoring APIsTroubleshoot the Model Monitor
Connect to your Data
Data in Domino
Datasets OverviewProject FilesDatasets Best Practices
Connect to Data Sources
External Data VolumesDomino Data Sources
Connect to External Data
Connect Domino to DataRobotConnect to Amazon S3 from DominoConnect to Azure Data Lake StorageConnect to BigQuery from DominoConnect to Generic S3 from DominoConnect to Google Cloud StorageConnect to IBM DB2 from DominoConnect to IBM Netezza from DominoConnect to Impala from DominoConnect to MSSQL from DominoConnect to MySQL from DominoConnect to Okera from DominoConnect to Oracle Database from DominoConnect to PostgreSQL from DominoConnect to Redshift from DominoConnect to Snowflake from DominoConnect to Teradata from Domino
Work with Data Best Practices
Work with Big Data in DominoWork with Lots of FilesMove Data Over a Network
Advanced User Configuration Settings
User API KeysDomino TokenOrganizations Overview
Use the Domino Command Line Interface (CLI)
Install the Domino Command Line (CLI)Domino CLI ReferenceDownload Files with the CLIForce-Restore a Local ProjectMove a Project Between Domino DeploymentsUse the Domino CLI Behind a Proxy
Browser Support
Get Help with Domino
Additional ResourcesGet Domino VersionContact Domino Technical SupportSupport Bundles
domino logo
About Domino
Domino Data LabKnowledge BaseData Science BlogTraining
User Guide
>
Domino Reference
>
Customize the Domino Software Environment
>
Partner Environments for Domino
>
Use MATLAB as a Workspace

Use MATLAB as a Workspace

Interactive MATLAB® sessions are supported in Domino by means of configuring a Compute Environment and Interactive Workspace. If your administrators have already configured such an environment, you may be able to use it by simply switching your project to that environment.

This page provides the steps necessary to create a suitable Compute Environment if it does not already exist. Some steps may require assistance from a Domino or MATLAB admin.

Prerequisites

Network licensing structure for MATLAB

To get MATLAB working using this guide, you will need a network license. A network concurrent license is recommended, but a network named license might also work IF the usernames specified in the license match the usernames within Domino. If you don’t currently have a network concurrent license, reach out to your MATLAB license administrator to determine if one is available or needs to be purchased. This information will be needed when configuring the Compute Environment. You may have a single license server or a set of 3 license servers. We will show examples for two styles of providing the license server information:

  • The first method requires only the port and host for your license server(s), for example, 27000@lic1.customer.com (and optionally 27000@lic2.customer.com, 27000@lic3.customer.com). This is recommended for most cases.

  • The second method applies if you have been given a network.lic file, for example,

    SERVER lic1.customer.com 000000000000 27000 SERVER lic2.customer.com 000000000010 27000 SERVER lic3.customer.com 000000000020 27000 USE_SERVER

    — shell

    This is recommended only if you have multiple sets of license servers (and thus multiple license files), i.e. in the case of separate license servers for MATLAB Parallel Server.

See Mathworks help for more details on the various options or talk to your MATLAB license administrator.

(Optional) Hardware Tiers with the correct GPU drivers

To make full use of GPU capabilities, the hardware tier you are using within Domino needs to have GPU drivers installed that can support the version of MATLAB you want to use. Compatibility is determined by this table describing the minimum CUDA Toolkit version requirement for each version of MATLAB, and by this table describing the minimum NVIDIA driver version requirement for each version of the CUDA Toolkit.

The MATLAB base images provided by Domino (see below) will already have a suitable version of the CUDA Toolkit installed. The NVIDIA drivers must be configured at the Hardware Tier level. If you already have a GPU-enabled hardware tier configured, it is likely that it already has suitable NVIDIA drivers. See the Troubleshooting section below for instructions on how to check the driver version during a MATLAB session to verify it is configured correctly.

If you do not have the correct NVIDIA drivers configured on your GPU Hardware Tier, talk to your Domino administrator and refer them to this sample documentation for configuring NVIDIA drivers in EKS.

Environment Setup

If a MATLAB-specific environment does not already exist in your Domino deployment, you will need to create one. Read about Compute Environment Management if you aren’t already familiar.

Choose a base image

  1. In Domino, click Environments in the top navigation bar.

  2. Click Create Environment.

  3. Give the environment an informative name, and then choose a base image that has MATLAB installed. The following are the most current options available from Domino.

    VersionRepo Link

    MATLAB 2021a

    quay.io/domino/matlab:R2021a

    MATLAB 2020b

    quay.io/domino/matlab:R2020b

    MATLAB 2020a

    quay.io/domino/matlab:R2020a

    MATLAB 2019b

    quay.io/domino/matlab:R2019b

  4. After selecting the appropriate base image, choosing a visibility setting, and optionally providing a description, click Create Environment to finalize.

  5. The environment will be created and you will be automatically redirected to its Overview page. Scroll down to the Docker Settings and click Edit Dockerfile to continue setting up the environment.

Edit the Dockerfile

Add the following lines to your Dockerfile Instructions, editing the license server information to match your actual license servers. Also be sure to edit the MATLAB_VERSION variable to match the MATLAB version of the base image you chose in the previous step.

If you have port and host information for your license servers (recommended method):

# This MATLAB_VERSION variable is used later in persisting Add-ons and preferences
ENV MATLAB_VERSION='R2019b'
ENV MLM_LICENSE_FILE=27000@lic1.customer.com,27000@lic2.customer.com,27000@lic3.customer.com

Or, if you have a network.lic file (more useful if you have multiple license files) you can adapt this example:

USER root

ENV MATLAB_VERSION='R2019b'
# Here we are simply pasting the information in the license file
# If you have the license file hosted somewhere accessible to Domino, you could instead download it to the same location via wget or similar methods
RUN mkdir -p /usr/local/MATLAB/$MATLAB_VERSION/licenses && \
    printf "SERVER lic1.customer.com 000000000000 27000\nSERVER lic2.customer.com 000000000010 27000\nSERVER lic3.customer.com 000000000020 27000\nUSE_SERVER\n" > /usr/local/MATLAB/$MATLAB_VERSION/licenses/network.lic

USER ubuntu

Add Pluggable Workspace Tools definition

Add the appropriate "Pluggable Properties" to the Properties for Workspaces.

These are documented alongside the base image descriptions here: https://github.com/dominodatalab/Domino_Base_Images/tree/master/MATLAB_Base_Images.

Note that the MATLAB base images are built on top of the Domino Standard Environment, so you can add the workspace configs for for example, Jupyter or RStudio for those standard environments also.

For example, if you are using the quay.io/domino/matlab:r2019b-20200521 base image, add the following lines for the MATLAB workspace:

matlab:
    title: "MATLAB"
    iconUrl: "https://raw.githubusercontent.com/dominodatalab/workspace-configs/develop/workspace-logos/matlab.png"
    start: [ "/var/opt/workspaces/matlab/start.sh" ]
    httpProxy:
        port: 8888
        requireSubdomain: false

Because it is built on top of quay.io/domino/base:Ubuntu18_DAD_Py3.6_R3.6_20190916, you can optionally add any of the following sections for workspaces from that environment:

jupyter:
  title: "Jupyter (Python, R, Julia)"
  iconUrl: "/assets/images/workspace-logos/Jupyter.svg"
  start: [ "/var/opt/workspaces/jupyter/start" ]
  httpProxy:
    port: 8888
    rewrite: false
    internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}/{{#if pathToOpen}}tree/{{pathToOpen}}{{/if}}"
    requireSubdomain: false
  supportedFileExtensions: [ ".ipynb" ]
jupyterlab:
  title: "JupyterLab"
  iconUrl: "/assets/images/workspace-logos/jupyterlab.svg"
  start: [  "/var/opt/workspaces/Jupyterlab/start.sh" ]
  httpProxy:
    internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}/{{#if pathToOpen}}tree/{{pathToOpen}}{{/if}}"
    port: 8888
    rewrite: false
    requireSubdomain: false
vscode:
 title: "vscode"
 iconUrl: "/assets/images/workspace-logos/vscode.svg"
 start: [ "/var/opt/workspaces/vscode/start" ]
 httpProxy:
    port: 8888
    requireSubdomain: false
rstudio:
  title: "RStudio"
  iconUrl: "/assets/images/workspace-logos/Rstudio.svg"
  start: [ "/var/opt/workspaces/rstudio/start" ]
  httpProxy:
    port: 8888
    requireSubdomain: false

(Optional) Persist MATLAB Preferences and Add-ons between sessions

In order to persist your MATLAB Preferences and Add-ons between Domino sessions, you can define a Post Run Script to automatically copy them to your Project Files when you Stop and Sync a session, and define a Pre Run Script to copy them from your Project Files into the locations MATLAB will recognize at the start of subsequent sessions.

Put the following lines into your Pre Run Script.

if [ -d /mnt/matlab-addons ]; then
    mkdir -p /home/ubuntu/Documents/MATLAB/SupportPackages/$MATLAB_VERSION/
    rsync -r /mnt/matlab-addons/ /home/ubuntu/Documents/MATLAB/SupportPackages/$MATLAB_VERSION
fi
if [ -d /mnt/matlab-preferences/$DOMINO_STARTING_USERNAME ]; then
    mkdir -p /home/ubuntu/.matlab/$MATLAB_VERSION/
    rsync -r /mnt/matlab-preferences/$DOMINO_STARTING_USERNAME/ /home/ubuntu/.matlab/$MATLAB_VERSION
fi

Put the following lines into your Post Run Script.

if [ -d /home/ubuntu/Documents/MATLAB/SupportPackages/$MATLAB_VERSION]; then
    mkdir -p /mnt/matlab-addons
    rsync -r /home/ubuntu/Documents/MATLAB/SupportPackages/$MATLAB_VERSION/ /mnt/matlab-addons
fi
if [ -d /home/ubuntu/.matlab/$MATLAB_VERSION]; then
    mkdir -p /mnt/matlab-preferences/$DOMINO_STARTING_USERNAME
    rsync -r /home/ubuntu/.matlab/$MATLAB_VERSION/ /mnt/matlab-preferences/$DOMINO_STARTING_USERNAME
fi

Note that these scripts will save add-ons per project, so that any collaborators launching a workspace in the same project will have the same add-ons. For preferences, however, they will be saved per user in the project so that each user can have a different set of preferences.

(Optional) Generate a startup script for proxy settings

If your company uses a proxy to connect to external networks, you may already have lines like the following in many of your Compute Environment Dockerfiles:

ENV http_proxy='http://someusername:password123@proxy.company.com:80'
ENV https_proxy='http://someusername:password123@proxy.company.com:80'
ENV HTTP_PROXY='http://someusername:password123@proxy.company.com:80'
ENV HTTPS_PROXY='http://someusername:password123@proxy.company.com:80'

Without setting the proxy information in MATLAB as well, you may not be able to connect to external networks from MATLAB (for example, for downloading community Add-ons). Proxy information can be set manually in MATLAB under Preferences > Web, and these will be persisted across sessions if the Pre and Post Run Scripts from the previous section are included in your environment.

Alternately, you can define a startup.m file in your project to ensure the proxy settings are correct at every launch of MATLAB. The file would look something like the following.

% This startup file was created from the environment pre-run script, to set proxy settings for MATLAB
disp('Setting proxy configuration via startup.m file')
com.mathworks.mlwidgets.html.HTMLPrefs.setUseProxy(true)
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyHost('proxy.company.com')
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyPort('80')
com.mathworks.mlwidgets.html.HTMLPrefs.setUseProxyAuthentication(true)
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyUsername('someusername')
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyPassword('password123')

Put the following lines into your Pre Run Script to automatically generate such a file in any project where it does not exist, whenever this Compute Environment is used to launch a session. (Omit the Authentication, Username, and Password lines if your proxy does not use them.)

if [ ! -f /mnt/startup.m ]; then
    echo "% This startup file was created from the environment pre-run script, to set proxy settings for MATLAB" > /mnt/startup.m
    echo "disp('Setting proxy configuration via startup.m file')" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setUseProxy(true)" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setProxyHost('proxy.company.com')" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setProxyPort('80')" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setUseProxyAuthentication(true)" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setProxyUsername('someusername')" >> /mnt/startup.m
    echo "com.mathworks.mlwidgets.html.HTMLPrefs.setProxyPassword('password123')" >> /mnt/startup.m
fi

Build and test the Environment

Click Build when you have finished editing the above sections. You will be redirected to the Revisions page for the environment.

If the new revision builds successfully, you are ready to test! Go to the Project Settings for a project where you wish to use MATLAB and change the Compute Environment to use this new environment; once you do, you should see a MATLAB icon appear as an option for Workspaces in that project.

See the Troubleshooting section below for information on known issues and frequently encountered problems if anything does not work as expected.

FAQ and troubleshooting

GPU functionality does not work as expected

The most common problem with GPU functionality is not having the correct NVIDIA driver version for your environment configured in your Hardware Tier. The following shell command should print some information about the GPU driver versions so you can verify it with the compatibility tables linked in the Prerequisites section.

>> !nvidia-smi
Wed May 13 00:00:16 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00    Driver Version: 440.64.00    CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  Off  | 00000000:00:1B.0 Off |                    0 |
| N/A   39C    P0    50W / 300W |      0MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla V100-SXM2...  Off  | 00000000:00:1C.0 Off |                    0 |
| N/A   41C    P0    50W / 300W |      0MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla V100-SXM2...  Off  | 00000000:00:1D.0 Off |                    0 |
| N/A   40C    P0    52W / 300W |      0MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  Tesla V100-SXM2...  Off  | 00000000:00:1E.0 Off |                    0 |
| N/A   40C    P0    54W / 300W |      0MiB / 16160MiB |      4%      Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

MATLAB workspace fails to launch

License configuration problems

License issues are the most common cause of problems launching a MATLAB workspace. To debug, start a Jupyter or RStudio workspace (still using the MATLAB environment) and open a Terminal. Check if your license server information has been correctly entered into the network.lic file, in the correct part of the MATLAB directory structure (i.e. matching your MATLAB version):

$ which matlab
/usr/local/MATLAB/R2019b/bin/matlab
$ cat /usr/local/MATLAB/R2019b/licenses/network.lic

If that contains the license server information you expect, but there are still problems, you can use the lmutil utility to check that the license server is reachable and contains the correct information.

$ lmutil lmstat -a -c 27000@lic1.customer.com

It should output information on the licenses being managed by that license server, including the MATLAB licenses.

Advanced troubleshooting

The workspace launch process for MATLAB respects several environment variables related to logging, which may help you debug more obscure or advanced problems. You can set these as project-level environment variables, similar to how you would set environment variables for secure credential storage , to enable toggling them on or off without having to edit the Compute Environment.

  • WS_LOGGING=[MATLAB]|ALL|DEBUG. By default, only the MATLAB logs are shown.

    • ALL shows logs for the underlying screen management xterm and xpra.

    • DEBUG shows everything from ALL, and activates a flag to show all commands.

  • TTY_MODE=[disabled]|PRE|POST. Runs ttyd before or after the workspace. It’s a terminal that runs in a browser so you can easily inspect things.

    • PRE will run ttyd before the workspace launch.

    • POST will run ttyd after the workspace launch fails (if it fails).

  • START_LOGGING=[false]|true. Increases logging verbosity in certain stages.

MATLAB workspace is laggy

In poor network conditions you may notice some lag in typing and general interactions with the MATLAB UI. This is to be expected in certain circumstances. Other common Domino workspaces like Jupyter or RStudio use browser-based IDEs, while this MATLAB environment is running a (Linux) desktop version of MATLAB in a remote desktop style interface. This results in more sensitivity to slow network conditions than a browser-based IDE.

For these situations, if you encounter them frequently, you may find it useful to install the Domino CLI on your local machine to facilitate editing files locally, then syncing them to Domino.

Keyboard shortcuts for copy/paste do not work

MATLAB in Domino runs the Linux version of MATLAB, which uses the "Emacs" set of keyboard shortcuts by default. To enable keyboard shortcuts Ctrl+C and Ctrl+V for copy and paste, go to Preferences > Keyboard > Shortcuts and change this from "Emacs" to "Windows". See the MATLAB help for more details.

MATLAB-set-env.png

MATLAB-set-env.png

Connection error when downloading Add-ons or using urlread

If you get network errors when downloading Add-ons or using urlread to download files, it may be due to proxy settings. See the Proxy section above for options for setting your proxy in MATLAB either within the current session or more globally.

Toolbox is not available

A selection of Toolboxes is pre-installed in each MATLAB base image, but this might not include every Toolbox you have on your local installation. You can see the list of Toolboxes by running the ver command within MATLAB, and the list is also documented for each base image. You can contact your Domino account team with any specific requests for Toolboxes to include.

In addition to having the Toolbox installed in the base image, you must have an available license for using it on your license server.

Known Issues and Release Notes

If your problem is not listed in this FAQ, it may be worth checking the release notes for the base image you are using. Especially if your environment is built on an older image tag, checking the release notes of newer images may give you a quick answer about whether rebuilding on the most current image will help.

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See http://mathworks.com/trademarks for a list of additional trademarks.

Domino Data LabKnowledge BaseData Science BlogTraining
Copyright © 2022 Domino Data Lab. All rights reserved.