hi

i have been using the dgemv function on a machine with two tesla(1070) cards.

i have an matrix of dimension dxd.

Now in my first call i only use one tesla card and call the function like this

magmablas_dgemv('N',d,d,1.0,matrix,d,vector_in,1,0.0,vector_out,1);

this works fine.

after this i launch two threads each of one sets the device to 0 or 1 and runs the same routine but now the matrix is divided into two parts and so is the vector

so now the matrix is (d/2 x d) and the vector is d/2 so on each of the GPU threads my call becomes

magmablas_dgemv('N',d/2,d,1.0,matrixhalf,d,vector_in_half,1,0.0,vector_out_half,1);

both are passed different versions of the vector and the matrix.

the matrix is stored in row major format. so the final vector (from each of the GPU calls) must be concatenated to get the real vector like it is available from the original (complete matrix and complete vector) call.

the problem is that in the broken calls on separate GPU the final vector has different results. the difference between corresponding indexes of the final vector increases. So if the original (correct) vector has values ranging from 1-256 then the error at index(1)<index(2)....<index(256).

i cannot understand why. i have checked the array passed to the magmablas_dgemv function and also the vector. stored them in a file and imported them in matlab and there concatenated the matrix and the vector and then the result is same as the original case. however from magma it isn't correct.

am i doing something wrong in my implementation? or is this some know error?

my magma version is the 1.0.0-rc5

cuda is 3.2

kindly help. thanks in advance

rohit

## magmablas_dgemv anomalous behavior

### Re: magmablas_dgemv anomalous behavior

I have been using magma for a while now for a sequence of BLAS/LAPACK calls from a matlab mex file. Today I reconfigured my system to allow for a 2nd graphics card. The idea was to use a GT 440 as a desktop GPU (1st PCIE slot) and use the GTX 480 as a pure compute device (2nd PCIE). Alas, I find that matlab crashes - following the code through, it seems that the crash occurs with my single call to magma_sgesv_gpu. There are calls to other magma routines before and after this call.

I've run the routine using CULA, which runs fine - this routine is essentially identical, but uses CULA routines rather than magma. I conclude that there is something amiss with magma_sgesv_gpu when 2 GPUs are used.

I gather it is normal behavior for CUDA to automatically select the GTX 480 as the primary device in a configuration like this - at least the device queries have the GTX 480 as compute device 0, and the GT 440 as compute device 1. Insofar as the computer hardware and linux are concerned, it is the other way around.

I'll use CULA for the time being.

Doug

I've run the routine using CULA, which runs fine - this routine is essentially identical, but uses CULA routines rather than magma. I conclude that there is something amiss with magma_sgesv_gpu when 2 GPUs are used.

I gather it is normal behavior for CUDA to automatically select the GTX 480 as the primary device in a configuration like this - at least the device queries have the GTX 480 as compute device 0, and the GT 440 as compute device 1. Insofar as the computer hardware and linux are concerned, it is the other way around.

I'll use CULA for the time being.

Doug

### Re: magmablas_dgemv anomalous behavior

There was a lot of changes to multiGPU in CUDA 4.0 when it came out a few months ago... perhaps MAGMA hasn't updated to support that?