How to fix C++ ABI problem for torchvision

I think torchvision is trying to link against c10 (libc10.so or libc10_cuda.so). Can you call ldd /usr/local/torchvision0.9/lib/libtorchvision.so ? it will normally show where are the libc10 libraries that are being linked against. Again, normally, if you built it with the setup.py module, the libc10 libraries will be those from your torch (the one used by python). Try python -c "import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)" to checkout which ABI your torch is using: it should be the old one, unless you compiled it from source.

I recently had a lot of trouble with this ABI issue. I managed to fix it by compiling torch from source (with the new ABI), and using gcc 8.4.

1 Like