Filter löschen
Filter löschen

GPU Performance Analyzer does not accept Hardware Config argument

7 Ansichten (letzte 30 Tage)
Ryan
Ryan am 1 Aug. 2024
Kommentiert: Ryan am 2 Aug. 2024
Hello, I am getting an error when passing hardware configuration to the MATLAB GPU Performance Analyzer.
I am using the Mandelbrot Count example along with this tutorial: https://www.mathworks.com/help/gpucoder/ug/gpu-profiling-nvidia-jetson.html to run the GPU Performance Analyzer with my connected NVIDIA Jetson Orin Nano. I can add hardware options to the configuration in two ways:
1: as the tutorial says,
2: after using the config editor GUI when you double click in the variables list.
The ways are commented below:
%% This is an excerpt from my overall script
cfg = coder.gpuConfig('dll','ecoder',true);
% cfg.Hardware = coder.Hardware('NVIDIA Jetson'); % 1. from tutorial
% cfg.Hardware = coder.hardware( "NVIDIA Jetson" ); % 2. directly from cfg GUI
inputs = {maxIterations,xGrid,yGrid};
designFileName = 'mandelbrot_count';
gpuPerformanceAnalyzer(designFileName, {maxIterations, xGrid, yGrid}, NumIterations=2, Config=cfg)
If I uncomment one of those lines, I get an error:
In mandelbrot_count_dll_script (line 36)
Error using gpuPerformanceAnalyzer
Index exceeds the number of array elements. Index must not exceed 0.
Error in mandelbrot_count_dll_script (line 36)
gpuPerformanceAnalyzer(designFileName, {maxIterations, xGrid, yGrid}, NumIterations=2, Config=cfg)
When I run without this hardware configuration it runs without error but defaults to the host machine GPU which defeats the purpose - I need this to run on the NVIDIA Jetson target board. Any help would be much appreciated. Thank you!
  2 Kommentare
Chao Luo
Chao Luo am 2 Aug. 2024
Did you setup the hwobj before running gpuPerformanceAnalyzer, like this:
hwobj = jetson('your_board_name_or_IP','user','passwd');
Ryan
Ryan am 2 Aug. 2024
Yes I did. However I figured out the issue. The solution ended up involving your answer to my previous question: https://www.mathworks.com/matlabcentral/answers/2140006-nvidia-jetson-setup-issue-coder-checkgpuinstall-can-t-find-nvcc
Once I added 'cfg.GpuConfig.ComputeCapability = '8.7', the error went away.
%% 3) Code generation
cfg = coder.gpuConfig('dll','ecoder',true);
cfg.Hardware = coder.hardware( "NVIDIA Jetson" );
cfg.GpuConfig.ComputeCapability = '8.7'; % <-- this line fixed the error
inputs = {maxIterations,xGrid,yGrid};
designFileName = 'mandelbrot_count';
gpuPerformanceAnalyzer(designFileName, {maxIterations, xGrid, yGrid}, NumIterations=2, Config=cfg)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Get Started with GPU Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by