Error with codegen for Jetson Nano; issue with main.cu creation.

4 views (last 30 days)
I am able to connect to the Jetson Nano (Developers Kit) and retrieve an image to display on host computer:
Problem comes when trying to run this example:
Wrote the liveCapture.m and the "codegen" step fails with:
??? codegen\exe\liveCapture\examples\main.cu specified in custom source
files string does not exist in any of the following search directories:
C:\Users\charl\Documents\MATLAB\Jetson\codegen\exe\liveCapture\examples
C:\Users\charl\Documents\MATLAB\Jetson\codegen\exe\liveCapture\examples\codegen\exe\liveCapture
C:\Users\charl\Documents\MATLAB\Jetson\codegen\exe\liveCapture\examples\codegen\exe\liveCapture\examples
C:\Users\charl\Documents\MATLAB\Jetson\codegen\exe\liveCapture\examples
Code generation failed: View Error Report
Error using codegen
Error in Code2Jetson (line 16)
codegen -config cfg liveCapture
I have tried:
1) Running example as described without creating any main.cu
2) Putting in a blank "main.cu" into "codegen\exe\liveCapture\examples"
3) Putting in a populated "main.cu" into "codegen\exe\liveCapture\examples"
- When the codegen step was run, and failed, the main.cu I wrote had been erased
All attempts produced same output error.
Addons Installed
GPU Coder Interface for Deep Learning Libraries
GPU Coder Support Package for NVIDIA GPUs
Compiler being used:
mex -setup
MEX configured to use 'Microsoft Visual C++ 2017 (C)' for C language compilation.
Environment variables and packages have been installed:
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (TensorRT) Code Generation: PASSED
00007FF9EE15F6E8cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
00007FF9EE15F6E8cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
00007FF9EE15F6E8cuBLAS 10.2.0 but is linked against cuBLAS 10.1.0
Deep Learning (TensorRT) Code Execution: PASSED

Accepted Answer

Charles Taylor
Charles Taylor on 12 Apr 2020
Update, the sobelEdgeDetection example ran fine. It uses a slightly different "cfg" object description and declared build directory. It doesn't use the CustomInclude or CustomSource fields.
Made changes to the liveCapture.m and codegen to emulate the sobelEdgeDetection example and it worked just fine:
function liveCapture() %#codegen
% Copyright 2018-2020 The MathWorks, Inc.
hwobj = jetson;
camObj = camera(hwobj,"vi-output, imx219 8-0010",[1280 720]);
dispObj = imageDisplay(hwobj);
% Main loop
for k = 1:10000
% Capture the image from the camera on hardware.
img = snapshot(camObj);
% Display image.
image(dispObj,img);
end
end
With the codegen:
%% Setup
disp('Building cfg object....')
cfg = coder.gpuConfig('exe');
cfg.Hardware = coder.hardware('NVIDIA Jetson');
cfg.Hardware.BuildDir = '~/remoteBuildDir';
cfg.GenerateExampleMain = 'GenerateCodeAndCompile';
disp('...done with cfg object')
%% compile
disp('Starting codegen....')
% codegen -config cfg liveCapture %from example on site
codegen('-config ',cfg,'liveCapture','-report');
disp('...completed codegen')
%% Run on Target
hwobj.setDisplayEnvironment('1.0');
pid = runApplication(hwobj,'liveCapture');

More Answers (0)

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!