I am generating GPU Code and want to deploy it in a different system for which I do not have the GPU yet. How can I generate the code now, and use it later once I have the GPU installed in the new system?
MATLAB: How to use GPU Coder generated code in a different system from where it was generated
GPU Coder
Related Solutions
I think you cannot install Matlab on Nvidia Xavier. However Matlab GPU Coder allows you to connect to the Nvidia devices to prototype your code.
You can find out more details here
Excerpt from documentation
"
GPU Coder™ generates optimized CUDA® code for deep learning, embedded vision, and autonomous systems. The generated code calls optimized NVIDIA® CUDA libraries and can be used for prototyping on all NVIDIA GPU platforms.
GPU Coder Support Package for NVIDIA GPUs automates the deployment of MATLAB® algorithms on embedded NVIDIA GPUs by building and deploying the generated CUDA code on the target GPU hardware board. It enables you to remotely communicate with the NVIDIA target and control the peripheral devices for prototyping.
GPU Coder supports NVIDIA Jetson TK1, Jetson TX1, Jetson TX2, Jetson AGX Xavier, and DRIVE PX2 Developer kits.
"
The host and Jetson are two different environments. In the case of Jetson, the codegen is performed on the host and directory is copied over to the Jetson and built.
Try running the check from the GUI to view the HTML report. The GUI is described below:
From there, you may be able to find build logs errors which give more information. (Note: There is no difference between the GUI and command line version of checkGpuInstall except that GUI produces an HTML report). The following checks can also be used at the command line to test basic and deep learning code gen:
% Basic Code gen
gpuEnvObj = coder.gpuEnvConfig;gpuEnvObj.GpuId = 0;gpuEnvObj.BasicCodegen = 1;gpuEnvObj.BasicCodeexec = 1;coder.checkGpuInstall(gpuEnvObj)% Deep code gen
gpuEnvObj = coder.gpuEnvConfig;gpuEnvObj.GpuId = 0;gpuEnvObj.DeepLibTarget = 'cudnn';gpuEnvObj.DeepCodegen = 1;gpuEnvObj.DeepCodeexec = 1;coder.checkGpuInstall(gpuEnvObj)
If a check fails, most likely there is something wrong with the host environment. Please make sure they have:
1. MATLAB Coder and Parallel Computing Toolbox installed in addition to GPU Coder
2. Required 3rd party products
3. Properly set up environment variables
4. A CUDA-enabled GPU
Get the GPU information from MATLAB command window:n = gpuDeviceCount;for i = 1:n gpuDevice(i)end
5. The correct CUDA Toolkit Version given the MATLAB release
6. Up-to-date Nvidia GPU card drivers
Best Answer