필터 지우기
필터 지우기

GPU Performance Analyzer does not accept Hardware Config argument

조회 수: 7 (최근 30일)
Ryan
Ryan 2024년 8월 1일
댓글: Ryan 2024년 8월 2일
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일
Did you setup the hwobj before running gpuPerformanceAnalyzer, like this:
hwobj = jetson('your_board_name_or_IP','user','passwd');
Ryan
Ryan 2024년 8월 2일
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