Install Pytorch with MAGMA without build from source?

I’m trying to build pytorch from source. From the instructions, it seems we have to use anaconda. But anaconda gives me this error:

anaconda2/compiler_compat/ld: cannot find -lcuda
anaconda2/compiler_compat/ld: cannot find -lc

If I use sudo python install , there’s no such problem, but when importing it gives me this error:

ImportError: cannot open shared object file: No such file or directory

I assume there’s some issues relating sudo, is there way to install MAGMA without building pytorch from source? Thanks.

Make sure you have CUDA available to sudo:

sudo ldconfig
to update all the linker paths. Then, you can do
sudo ldconfig -p | grep -i cuda
to see that your system knows where all the cuda libraries are.

and finaly try this:

Thanks for the reply. In my case, I actually just want to build pytorch with MAGMA. Does that mean I have to build pytorch using anaconda?

It seems like you linked to mkl (Intel math kernel library). You could either see that pytorch finds it or not have the build link to it. Note that sudo sanitizes your environment variables unless you pass -E, so if you rely on these to find Magma, this cab be a problem.

I usually build with bdist_wheel (no sudo) and then uses pip to install the whl in dist. That has turned out to have less potential for surprises for me.

Best regards