Skip to content

Commit 2e1e418

Browse files
committed
Add Troubleshooting Guide for Simulink API
1 parent bd66df3 commit 2e1e418

File tree

10 files changed

+52
-0
lines changed

10 files changed

+52
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ This section describes the Simulink API for AutoDRIVE, which can be used to deve
6666
- **[OPTIONAL]** To build the `jar` file yourself, it is recommended to use [Apache Maven](https://maven.apache.org/download.cgi) (tested with version 3.8.1) with [Java Development Kit](https://www.oracle.com/java/technologies/downloads/?er=221886#java8) (tested with version 8u411). Maven will automatically take care of downloading the [`Java-WebSocket`](https://github.com/TooTallNate/Java-WebSocket) library and neatly package everything into a single file (an "uber jar") based on the [`pom.xml`](autodrive_simulink_api/lib/pom.xml). Once the `mvn` command is on your path, simply `cd` to the `lib` directory and execute the `mvn package` command.
6767
2. Add the `autodrive_simulink_api` directory to MATLAB path by right-clicking on it from MATLAB's file explorer and selecting `Add to Path` → `Selected Folders and Subfolders`.
6868
69+
> [!NOTE]
70+
> If you face issues installing/running the AutoDRIVE Simulink API or examples, check out the [Troubleshooting Guide](autodrive_simulink_api/troubleshooting/README.md) for helpful tips.
71+
6972
## USAGE
7073
7174
Run the vehicle-specific `example` file:

autodrive_simulink_api/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ This directory hosts the Simulink API for AutoDRIVE, which can be used to develo
2020
- **[OPTIONAL]** To build the `jar` file yourself, it is recommended to use [Apache Maven](https://maven.apache.org/download.cgi) (tested with version 3.8.1) with [Java Development Kit](https://www.oracle.com/java/technologies/downloads/?er=221886#java8) (tested with version 8u411). Maven will automatically take care of downloading the [`Java-WebSocket`](https://github.com/TooTallNate/Java-WebSocket) library and neatly package everything into a single file (an "uber jar") based on the [`pom.xml`](lib/pom.xml). Once the `mvn` command is on your path, simply `cd` to the `lib` directory and execute the `mvn package` command.
2121
2. Add the `autodrive_simulink_api` directory to MATLAB path by right-clicking on it from MATLAB's file explorer and selecting `Add to Path` → `Selected Folders and Subfolders`.
2222
23+
> [!NOTE]
24+
> If you face issues installing/running the AutoDRIVE Simulink API or examples, check out the [Troubleshooting Guide](troubleshooting/README.md) for helpful tips.
25+
2326
## USAGE
2427
2528
Run the vehicle-specific `example` file:
132 KB
Loading
100 KB
Loading
16.6 KB
Loading
146 KB
Loading
49.2 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Troubleshooting Guide
2+
3+
This directory contains troubleshooting tips for the AutoDRIVE Simulink API, which can help debug build/runtime errors, and assist in installing the necessary dependencies and setting up the correct configuration.
4+
5+
## Potential Errors:
6+
7+
Some of the examples require code generation, which may lead to build errors if not installed.
8+
9+
![](No%20Compiler%20Error.png)
10+
11+
Some of the examples require GPU code generation, which may lead to build errors if not installed properly.
12+
13+
![](MEX%20Compiler%20Error.png)
14+
15+
The MEX compiler setup is version-specific and can lead to version-mismatch errors if not installed properly.
16+
17+
![](Visual%20Studio%20Version%20Error.png)
18+
19+
## Potential Fixes:
20+
21+
Download and install the [MATLAB Support for MinGW-w64 C/C++/Fortran Compiler](https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c-fortran-compiler) support package. This can also be done using MATLAB Add-On Explorer.
22+
23+
Setup the GPU MEX compiler by following the steps below:
24+
25+
1. Install Microsoft Visual Studio with `Desktop development with C++` workload selected [Tested with Visual Studio 2019 (V16.11.49)]
26+
27+
![](Visual%20Studio%20Installation.png)
28+
29+
2. Install NVIDIA CUDA [Tested with CUDA 11.8 (V11.8.89)]
30+
31+
> [!NOTE]
32+
> It is important to install CUDA after installing Visual Studio so that CUDA can configure Visual Studio settings during installation.
33+
34+
![](CUDA%20Installation.png)
35+
36+
3. Setup the MEX Compiler by running `mex -setup C` and `mex -setup C++` in MATLAB Command Window and selecting `Microsoft Visual C++ 2019 (C)` as the compiler.
37+
38+
![](MEX%20Compiler%20Setup.png)
39+
40+
4. Set the Simulink build process toolchain to `NVIDIA CUDA (w/Microsoft Visual C++ 2019) | nmake` (selecting `Automatically locate an installed toolchain` should choose this already)
41+
42+
![](Build%20Toolchain%20Setup.png)
43+
44+
> [!WARNING]
45+
> - MATLAB/Simulink requires specific versions of Visual Studio and CUDA to be installed. Please refer to the official GPU Coder requirements [here](https://www.mathworks.com/support/requirements/gpu-coder.html).
46+
> - MATLAB/Simulink is known to have trouble working with Visual Studio 2022. Please refer to an official thread about this issue [here](https://www.mathworks.com/matlabcentral/answers/2158705-mexcuda-can-t-find-visual-studio-2022-but-mex-can?s_tid=srchtitle).
265 KB
Loading
101 KB
Loading

0 commit comments

Comments
 (0)