GPU Performance Analyzer does not accept Hardware Config argument

26 次查看(过去 30 天)
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 个评论
Chao Luo
Chao Luo 2024-8-2,12:48
Did you setup the hwobj before running gpuPerformanceAnalyzer, like this:
hwobj = jetson('your_board_name_or_IP','user','passwd');
Ryan
Ryan 2024-8-2,16:04
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)

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with GPU Coder 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by