GPU computing errror of BLAS library

Hi I am using GPU to accelerate my program but an error message comes out after several excuation of my function (I guess this means the first several excuations are successful?)
Failed to initialize GPU BLAS library.
Can anyone help me? I am guess its the CUDA version problem.
Thanks!
I am on Windows 10 with gtx 1080 and CUDA version 9.0.176

댓글 수: 8

Joss Knight
Joss Knight 2017년 11월 26일
No version of MATLAB uses CUDA 9. If you've downloaded the CUDA 9 toolkit that's great, but MATLAB isn't using it.
So tell us what version of MATLAB you are using and let us know what you're running, so we can reproduce your problem.
Rui Xiang
Rui Xiang 2017년 11월 26일
Thanks very much! my matlab version is 2017b. So should i install CUDA 8 or some other version? I am running a 3d point cloud classification algorithm which is developed by ourselves.
Rui Xiang
Rui Xiang 2017년 11월 26일
I download CUDA from here https://developer.nvidia.com/cuda-downloads Could you please tell me which version should I install>? Thanks:)
Joss Knight
Joss Knight 2017년 11월 26일
You don't need to install the CUDA toolkit in order to use MATLAB. MATLAB comes with a copy of all the toolkit libraries it uses.
You do, of course, need a graphics driver from the NVIDIA website in order to use your card.
So, with that cleared up...you will need to actually provide some code to reproduce your issue otherwise there's just nothing we can do to help.
Thanks very much for your reply. I installed the latest drivers of graphic card. But it still does not work.
Here is the part of my code using GPU computing. NO matterr I am using parfor or for loop. The first several i (like 1 to 7) the funtions works, but later it just came up with that error message. My cpu is 6 core.
function H = matrix_DAL1(X,V,A1,A2,par2)
a2=gpuArray(A2);
l = size(X,2);
H = zeros(l,3*par2(2));
parfor i = 1:l
i
U = X{i};
m=length(U);
Z = PCA(U);
dZ = sqrt(Z(:,1).^2+Z(:,2).^2+Z(:,3).^2);
U = Z/max(dZ)*0.499;
n = size(V,1);
Pat1 = zeros(par2(3),n);
Pat2 = zeros(par2(3),n);
Pat3 = zeros(par2(3),n);
for j = 1:n
[num,dis,ang] = DAL(U,V(j,:)',par2(3));
Pat1(:,j) = num/m;
Pat2(:,j) = num.*dis;
Pat3(:,j) = ang;
end
S11 = 1./(1+exp(-Pat1'*A1));
s1 = gpuArray(s1);
S21 = 1./(1+exp(-S11*A2));
S12 = 1./(1+exp(-Pat2'*A1));
s2 = gpuArray(s2);
S22 = 1./(1+exp(-S12*A2));
S13 = 1./(1+exp(-Pat3'*A1));
s3 = gpuArray(s3);
S23 = 1./(1+exp(-S13*A2));
h = max([S21,S22,S23]);
H(i,:) = h;
end
Joss Knight
Joss Knight 2017년 11월 27일
Your code is rather confusing. It doesn't seem to actually do anything on the GPU, it just copies data onto it. I'm not even sure how it can execute since, for instance, s1 doesn't exist before you use it.
Can you give me some functional code that contains everything I need to run it?
Oh i’m sorry. I copied wrong code. Here is the right one.
function H = matrix_DAL1(X,V,A1,A2,par2)
a2=gpuArray(A2);
a1=gluArray(A1);
l = size(X,2);
H = zeros(l,3*par2(2));
parfor i = 1:l
i
U = X{i};
m=length(U);
Z = PCA(U);
dZ = sqrt(Z(:,1).^2+Z(:,2).^2+Z(:,3).^2);
U = Z/max(dZ)*0.499;
n = size(V,1);
Pat1 = zeros(par2(3),n);
Pat2 = zeros(par2(3),n);
Pat3 = zeros(par2(3),n);
for j = 1:n
[num,dis,ang] = DAL(U,V(j,:)',par2(3));
Pat1(:,j) = num/m;
Pat2(:,j) = num.*dis;
Pat3(:,j) = ang;
end
S11 = 1./(1+exp(-Pat1'*a1));
S21 = 1./(1+exp(-S11*a2));
S12 = 1./(1+exp(-Pat2'*a1));
S22 = 1./(1+exp(-S12*a2));
S13 = 1./(1+exp(-Pat3'*a1));
S23 = 1./(1+exp(-S13*a2));
h = max([S21,S22,S23]);
h = gather(h);
H(i,:) = h;
end
Joss Knight
Joss Knight 2017년 11월 27일
Okay, but I still don't have the definition of PCA or DAL or the input variables.
It doesn't look like you're using the GPU till the first line beginning S11. Why don't you separate off that bit of code and see if you can reproduce your problem with just that and some random input matrices? Then I can have a go with it. It might matter what size and type your arrays are.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 GPU Computing in MATLAB에 대해 자세히 알아보기

태그

질문:

2017년 11월 25일

댓글:

2017년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by