필터 지우기
필터 지우기

Error using gpuArray : when running three times , GPUs not working again !

조회 수: 1 (최근 30일)
Furat Alobaidy
Furat Alobaidy 2020년 12월 15일
댓글: Furat Alobaidy 2020년 12월 17일
clear all;
gpu = gpuDevice();
fprintf('Using a %s GPU.\n', gpu.Name)
sizeOfDouble = 8; % Each double-precision number needs 8 bytes of storage
sizes = power(2, 14:28);
sendTimes = inf(size(sizes));
gatherTimes = inf(size(sizes));
for ii=1:numel(sizes)
numElements = sizes(ii)/sizeOfDouble;
hostData = randi([0 9], numElements, 1);
gpuData = randi([0 9], numElements, 1, 'gpuArray');
% Time sending to GPU
sendFcn = @() gpuArray(hostData);
sendTimes(ii) = gputimeit(sendFcn);
% Time gathering back from GPU
gatherFcn = @() gather(gpuData);
gatherTimes(ii) = gputimeit(gatherFcn);
end
sendBandwidth = (sizes./sendTimes)/1e9;
[maxSendBandwidth,maxSendIdx] = max(sendBandwidth);
fprintf('Achieved peak send speed of %g GB/s\n',maxSendBandwidth)
gatherBandwidth = (sizes./gatherTimes)/1e9;
[maxGatherBandwidth,maxGatherIdx] = max(gatherBandwidth);
fprintf('Achieved peak gather speed of %g GB/s\n',max(gatherBandwidth))
hold off
semilogx(sizes, sendBandwidth, 'b.-', sizes, gatherBandwidth, 'r.-')
hold on
semilogx(sizes(maxSendIdx), maxSendBandwidth, 'bo-', 'MarkerSize', 10);
semilogx(sizes(maxGatherIdx), maxGatherBandwidth, 'ro-', 'MarkerSize', 10);
grid on
title('Data Transfer Bandwidth')
xlabel('Array size (bytes)')
ylabel('Transfer speed (GB/s)')
legend('Send to GPU', 'Gather from GPU', 'Location', 'NorthWest')
Hi when i need ruuning this program mutli time for testing GPus performance ,
after thrr time gave me error and its not work until restest my PC , then after three time agin gave me the same error ?
i tired follows this soulation ( by change Nsight Monitor ) at this web site : https://www.mathworks.com/matlabcentral/answers/34052-cuda_error_launch_failed-problem
, but the same problem!
Error using gpuArray
An unexpected error occurred during CUDA execution. The CUDA error was:
CUDA_ERROR_LAUNCH_FAILED
  댓글 수: 2
Andrea Picciau
Andrea Picciau 2020년 12월 17일
Hi Furat,
It would help to know you setup: MATLAB version, GPU model and driver.
Furat Alobaidy
Furat Alobaidy 2020년 12월 17일
thanks Andera ,
MATLAB2019b,
GPU model:NVIDA GeForce GT730
Driver: Intel UHD graphics 630

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by