Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: matrix operations on GPU
Replies: 3   Last Post: Feb 14, 2014 4:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mike

Posts: 3
Registered: 12/30/13
matrix operations on GPU
Posted: Dec 30, 2013 7:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I have a hard time implementing simple matrix operations on the GPU. The code is rather simple. I have 2 nxn matrices called Ah and Bh which I am trying to multiply, like:

tic;
A = gpuArray(Ah);
B = gpuArray(Bh);
C = A * B;
toc

The 1st time it always works while any subsequent time is always fails, see output below:
>> Ah = rand(5000,5000);
>> Bh = rand(5000,5000);
>> run('C:\Users\mschmidt\Documents\MATLAB\gpu_mat_mul.m')

Elapsed time is 0.641242 seconds.
% now the 2nd run which always fails
>> Ah = rand(5000,5000);
>> Bh = rand(5000,5000);
>> run('C:\Users\mschmidt\Documents\MATLAB\gpu_mat_mul.m')

Error using gpuArray
An unexpected error occurred during CUDA execution. The CUDA error was:
unknown error

Error in gpu_mat_mul (line 4)
A = gpuArray(Ah);

Error in run (line 63)
evalin('caller', [script ';']);

%%%%%%%%%%%%%%%%%%%%%%%%

matlab version:
8.2.0.701 (R2013b)

gpuDevice yields:
Name: 'GeForce GTX 460'
Index: 1
ComputeCapability: '2.1'
SupportsDouble: 1
DriverVersion: 6
ToolkitVersion: 5
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [65535 65535 65535]
SIMDWidth: 32
TotalMemory: 1.0737e+09
MultiprocessorCount: 7
ClockRateKHz: 1526000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.