CUBLAS error if I replace torch.svd() with torch.symeig()

I am trying to get eigenvalues and eigenvectors of a real symmetric matrix A.

It seems that torch.symeig() is faster than torch.svd().
With torch.svd(), program worked well.
With torch.symeig(), it shows below message a lot.

CUBLAS error: memory mapping error (11) in magma_ssytrd2_gpu at /data/users/soumith/miniconda2/conda-bld/magma-cuda80-2.1.0_1476154064021/work/magma-2.1.0/src/ssytrd2_gpu.cpp:280
CUBLAS error: memory mapping error (11) in magma_ssytrd2_gpu at /data/users/soumith/miniconda2/conda-bld/magma-cuda80-2.1.0_1476154064021/work/magma-2.1.0/src/ssytrd2_gpu.cpp:285

It seems that both messages point out the line with
magma_sgetmatrix( kk, kk, dA(0, 0), ldda, A(0, 0), lda, queue );
magma_ssetmatrix( kk, kk, A(0, 0), lda, dA(0, 0), ldda, queue );

document for 'magma_ssetmatrix’

Any idea about this?

Thanks in advance

What’s your PyTorch version? Did you do a binary or source install?

I just updated with the command
conda install pytorch torchvision cuda80 -c soumith
which seems to install from binary.
Now version is torch 0.1.10+ac9245a

But still have the same error message.

Hi @OCY,

If possible, can you give me a 10-line program that produces this error? I will look at it and try to resolve it next week.


On the way to solve other error, that problem seems to be solved.
I don’t see that error message anymore.

Because I changed a lot, I cannot reproduce that error, unfortunately.

The modification which seems the most relevant to this error is following.
I used to run torch.svd(A) and torch.symeig(A) with just symmetric matrix A
In modified code, I use torch.svd(A + cI) and torch.symeig(A + cI).
I added some diagonal matrix to have some numerical stability.
I am guessing whether if a matrix has an eigenvalue close to zero then this cause some problem in torch.symeig.

If I have the same problem, I will continue this post with reproduced code.


Hey, I ran into this problem on a current build of pytorch (October 2017).

Here’s a minimal repro - it’s triggered for me when the symmetric matrix is 129x129 or larger.

import torch
a = torch.randn(129,129)
cov =, a.transpose(1,0))
tcov = torch.Tensor(cov).cuda()
teigval, teigvec = torch.symeig(tcov, eigenvectors=True)