The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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

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:

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

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: (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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.