conda-forge / torchvision-feedstock

A conda-smithy repository for torchvision.
BSD 3-Clause "New" or "Revised" License
2 stars 16 forks source link

Segfault when importing torchvision #52

Open calebrob6 opened 2 years ago

calebrob6 commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

When I run conda create -n test1 python pytorch-gpu torchvision cudatoolkit -c conda-forge and then import torchvision I get a segfault. It looks like this is because cudatoolkit version 11.6.0 is installed, which is incompatible.

However, if I setup my environment as conda create -n test2 python pytorch-gpu torchvision -c conda-forge then cudatoolkit version 10.2 is installed, which seems to work.

Any ideas what might be going on here?

Installed packages

For environment test1

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
brotlipy                  0.7.0           py39h3811e60_1003    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8        py39hf3d152e_1    conda-forge
cffi                      1.15.0           py39h4bc2ebd_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
cryptography              36.0.2           py39hd97740a_0    conda-forge
cudatoolkit               11.6.0              habf752d_10    conda-forge
cudnn                     8.2.1.32             h86fa8c9_0    conda-forge
ffmpeg                    4.3.2                h37c90e5_3    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
future                    0.18.2           py39hf3d152e_4    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libblas                   3.9.0            13_linux64_mkl    conda-forge
libcblas                  3.9.0            13_linux64_mkl    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
liblapack                 3.9.0            13_linux64_mkl    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libprotobuf               3.19.4               h780b84a_0    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp                   1.2.2                h3452ae3_0    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libzlib                   1.2.11            h166bdaf_1014    conda-forge
llvm-openmp               13.0.1               he0ac6c6_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
magma                     2.5.4                h6103c52_2    conda-forge
mkl                       2022.0.1           h8d4b97c_803    conda-forge
nccl                      2.12.7.1             h0800d71_0    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
numpy                     1.22.3           py39h18676bf_0    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1n               h166bdaf_0    conda-forge
pillow                    9.0.1            py39hae2aec6_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py39hf3d152e_4    conda-forge
python                    3.9.12          h9a8a25e_1_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytorch                   1.10.2          cuda112py39h4de5995_1    conda-forge
pytorch-gpu               1.10.2          cuda112py39h0bbbad9_1    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
setuptools                59.5.0           py39hf3d152e_0    conda-forge
sleef                     3.5.1                h9b69904_2    conda-forge
sqlite                    3.37.1               h4ff8645_0    conda-forge
tbb                       2021.5.0             h4bd325d_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
torchvision               0.12.0          cuda112py39h1e8a005_0    conda-forge
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
x264                      1!161.3030           h7f98852_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h166bdaf_1014    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge

For environment test2

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
brotlipy                  0.7.0           py39h3811e60_1003    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8        py39hf3d152e_1    conda-forge
cffi                      1.15.0           py39h4bc2ebd_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
cryptography              36.0.2           py39hd97740a_0    conda-forge
cudatoolkit               10.2.89             h8f6ccaa_10    conda-forge
cudnn                     7.6.5.32             h01f27c4_1    conda-forge
ffmpeg                    4.3.2                h37c90e5_3    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libblas                   3.9.0            13_linux64_mkl    conda-forge
libcblas                  3.9.0            13_linux64_mkl    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
liblapack                 3.9.0            13_linux64_mkl    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libprotobuf               3.19.4               h780b84a_0    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp                   1.2.2                h3452ae3_0    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libzlib                   1.2.11            h166bdaf_1014    conda-forge
llvm-openmp               13.0.1               he0ac6c6_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
magma                     2.5.4                h5da55e3_2    conda-forge
mkl                       2022.0.1           h8d4b97c_803    conda-forge
nccl                      2.12.7.1             h1a5f58c_0    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
numpy                     1.22.3           py39h18676bf_0    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1n               h166bdaf_0    conda-forge
pillow                    9.0.1            py39hae2aec6_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py39hf3d152e_4    conda-forge
python                    3.9.12          h9a8a25e_1_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytorch                   1.11.0          cuda102py39hfe0cb5b_0    conda-forge
pytorch-gpu               1.11.0          cuda102py39hf05f184_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
setuptools                61.2.0           py39hf3d152e_0    conda-forge
sleef                     3.5.1                h9b69904_2    conda-forge
sqlite                    3.37.1               h4ff8645_0    conda-forge
tbb                       2021.5.0             h4bd325d_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
torchvision               0.12.0          cuda102py39hb9d8682_0    conda-forge
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
x264                      1!161.3030           h7f98852_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h166bdaf_1014    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge

Environment info

     active environment : test1
    active env location : /home/calebrobinson/.conda/envs/test1
            shell level : 2
       user config file : /home/calebrobinson/.condarc
 populated config files : /opt/conda/.condarc
                          /home/calebrobinson/.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.12.final.0
       virtual packages : __cuda=11.6=0
                          __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/conda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
       envs directories : /opt/conda/envs
                          /home/calebrobinson/.conda/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.26.0 CPython/3.8.12 Linux/5.13.0-1017-azure ubuntu/18.04.5 glibc/2.27
                UID:GID : 1010:100
             netrc file : None
           offline mode : False
     active environment : test2
    active env location : /home/calebrobinson/.conda/envs/test2
            shell level : 2
       user config file : /home/calebrobinson/.condarc
 populated config files : /opt/conda/.condarc
                          /home/calebrobinson/.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.12.final.0
       virtual packages : __cuda=11.6=0
                          __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/conda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
       envs directories : /opt/conda/envs
                          /home/calebrobinson/.conda/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.26.0 CPython/3.8.12 Linux/5.13.0-1017-azure ubuntu/18.04.5 glibc/2.27
                UID:GID : 1010:100
             netrc file : None
           offline mode : False
hmaarrfk commented 2 years ago

Please include the full requested information. It is VERY helpful.

calebrob6 commented 2 years ago

@hmaarrfk updated

hmaarrfk commented 2 years ago

Thank you. I got very confused as I thought i saw a very similar issue a few minutes ago ^_^

I'm sorry I can't really recreate.

Did you happen to update your driver recently? Are you able to reboot your computer? I've seen strangeness before. I have cuda 11.6 as well:

python -c "import torchvision; print(torchvision.__version__)"
0.12.0a0+da433bf
# packages in environment at /home/mark/mambaforge/envs/tv:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
brotlipy                  0.7.0           py310h6acc77f_1003    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8       py310hff52083_1    conda-forge
cffi                      1.15.0          py310h0fdd8cc_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
cryptography              36.0.2          py310h597c629_0    conda-forge
cudatoolkit               11.6.0              habf752d_10    conda-forge
cudnn                     8.2.1.32             h86fa8c9_0    conda-forge
ffmpeg                    4.3.2                h37c90e5_3    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
lame                      3.100             h7f98852_1001    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libblas                   3.9.0            13_linux64_mkl    conda-forge
libcblas                  3.9.0            13_linux64_mkl    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
liblapack                 3.9.0            13_linux64_mkl    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libprotobuf               3.19.4               h780b84a_0    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp                   1.2.2                h3452ae3_0    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libzlib                   1.2.11            h166bdaf_1014    conda-forge
llvm-openmp               13.0.1               he0ac6c6_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
magma                     2.5.4                h6103c52_2    conda-forge
mkl                       2022.0.1           h8d4b97c_803    conda-forge
nccl                      2.12.7.1             h0800d71_0    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
numpy                     1.22.3          py310h45f3432_0    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1n               h166bdaf_0    conda-forge
pillow                    9.0.1           py310he619898_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1           py310hff52083_4    conda-forge
python                    3.10.4          h9a8a25e_0_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pytorch                   1.11.0          cuda112py310h5c3c7ff_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
setuptools                61.2.0          py310hff52083_0    conda-forge
sleef                     3.5.1                h9b69904_2    conda-forge
sqlite                    3.37.1               h4ff8645_0    conda-forge
tbb                       2021.5.0             h4bd325d_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
torchvision               0.12.0          cuda112py310h3e401e8_0    conda-forge
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
x264                      1!161.3030           h7f98852_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h166bdaf_1014    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge
(tv) ✔ ~
$ conda info

     active environment : tv
    active env location : /home/mark/mambaforge/envs/tv
            shell level : 3
       user config file : /home/mark/.condarc
 populated config files : /home/mark/mambaforge/.condarc
                          /home/mark/.condarc
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.9.9.final.0
       virtual packages : __cuda=11.6=0
                          __linux=5.13.0=0
                          __glibc=2.34=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/mark/mambaforge  (writable)
      conda av data dir : /home/mark/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : 
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/mark/mambaforge/pkgs
                          /home/mark/.conda/pkgs
       envs directories : /home/mark/mambaforge/envs
                          /home/mark/.conda/envs
               platform : linux-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.9 Linux/5.13.0-37-generic ubuntu/21.10 glibc/2.34
                UID:GID : 1001:1001
             netrc file : None
           offline mode : False
hmaarrfk commented 2 years ago

11.2 builds should be compatible with forward builds.