Skip to content

undefined symbol: sormqr_ #507

Closed
Closed

Description

@tudor-berariu

I compiled pytorch (using both Python 2 and Python 3) with CUDA support on Ubuntu 16.04 having gcc 4.8.5. The install process terminated with no critical errors.

Torch is already installed on the same machine and works fine.

When importing pytorch I get the following error:

----> 1 import torch

/home/tudor/anaconda2/lib/python2.7/site-packages/torch/__init__.pyc in <module>()
     43 sys.setdlopenflags(_dl_flags.RTLD_GLOBAL | _dl_flags.RTLD_NOW)
     44 
---> 45 from torch._C import *
     46 
     47 __all__ += [name for name in dir(_C)

ImportError: /home/tudor/anaconda2/lib/python2.7/site-packages/torch/lib/libTHC.so.1: undefined symbol: sormqr_

Activity

  1. soumith commented on Jan 19, 2017

    @soumith
    Collaborator

    it looks like you used an anaconda environment.
    Did you run the commands in order from here: https://github.com/pytorch/pytorch#from-source ? including the CMAKE_PREFIX_PATH command and installing mkl ahead of time...

  2. tudor-berariu commented on Jan 19, 2017

    @tudor-berariu
    ContributorAuthor

    Yes, I followed all steps.

  3. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    It looks like a MAGMA issue, can you try and check what THC's CMake logged when configuring the build (only the lines about MAGMA)?

  4. soumith commented on Jan 19, 2017

    @soumith
    Collaborator

    if you are using CUDA 7.5, be sure to do:

    conda install -c soumith magma-cuda75
    

    and if you are using CUDA 8.0, do:

    conda install -c soumith magma-cuda80
    
  5. tudor-berariu commented on Jan 19, 2017

    @tudor-berariu
    ContributorAuthor

    @soumith Yes i did install the correct version for magma-cuda.

    @apaszke Not sure if this is the relevant info, but the only lines in pytorch/torch/lib/build/THC/CMakeFiles/CMakeOutput.log referring to magma are:

    Feature record: CXX_FEATURE:0cxx_variadic_macros
    Feature record: CXX_FEATURE:0cxx_variadic_templates
    Determining if the prototype magma_get_sgeqrf_nb exists for MAGMA_V2 passed with the following output:
    Change Dir: /home/tudor/pytorch/torch/lib/build/THC/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_2e3cf/fast"
    
  6. soumith commented on Jan 19, 2017

    @soumith
    Collaborator

    @tudor-berariu thanks. what's your CMake version?

  7. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    @tudor-berariu Could you grep for some of these prints? It might be necessary to clean and rebuild THC 😕

  8. tudor-berariu commented on Jan 19, 2017

    @tudor-berariu
    ContributorAuthor

    @soumith cmake version 3.6.3

    @apaszke

    $ python setup.py install | grep -i magma
    - Compiling with MAGMA support
    -- MAGMA INCLUDE DIRECTORIES: /home/tudor/anaconda2/include
    -- MAGMA LIBRARIES: /home/tudor/anaconda2/lib/libmagma.a
    -- MAGMA V2 check: 1
    [ 15%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorMathMagma.cu.o
    -- Up-to-date: /home/tudor/pytorch/torch/lib/tmp_install/include/THC/THCTensorMathMagma.cuh
    -- Up-to-date: /home/tudor/pytorch/torch/lib/tmp_install/include/THC/generic/THCTensorMathMagma.h
    -- Up-to-date: /home/tudor/pytorch/torch/lib/tmp_install/include/THC/generic/THCTensorMathMagma.cu
    copying torch/lib/include/THC/generic/THCTensorMathMagma.h -> build/lib.linux-x86_64-2.7/torch/lib/include/THC/generic
    copying build/lib.linux-x86_64-2.7/torch/lib/include/THC/generic/THCTensorMathMagma.h -> /home/tudor/anaconda2/lib/python2.7/site-packages/torch/lib/include/THC/generic
    
  9. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    weird, it seems to be picked up correctly. can you prepend VERBOSE=1 to the install command, so we can see the compiler commands used to build the lib? Maybe it doesn't get linked for some reason...

  10. tudor-berariu commented on Jan 19, 2017

    @tudor-berariu
    ContributorAuthor

    This is the full output of the install process (with VERBOSE=1). I still can't figure out what's wrong.

  11. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    Can you try nm /home/tudor/anaconda2/lib/libmagma.a | grep ormqr?

  12. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    Hm false alert. It looks like a TH issue. The only place where sormqr_ is used is there.

  13. tudor-berariu commented on Jan 19, 2017

    @tudor-berariu
    ContributorAuthor

    @apaszke Thanks a lot for investigating this. The output of the grep command is here.

  14. apaszke commented on Jan 19, 2017

    @apaszke
    Contributor

    Ok! This is helpful. It seems that you don't have any LAPACK library, while your libmagma.a requires to be linked together with one. Did you install MKL (conda install mkl)?

  15. soumith commented on Jan 19, 2017

    @soumith
    Collaborator

    I would suggest removing mkl and installing it again.
    From the logs, it looks like you have a partial install of MKL somehow.

  16. 6 remaining items

  17. soumith commented on Jan 19, 2017

    @soumith
    Collaborator

    ok excellent repro. I'll be looking into how to fix the CMake to also look in that folder. I'll keep this issue open till i fix it.

  18. added
    module: dependency bug
    on Jan 20, 2017
  19. assigned and unassigned on Jan 29, 2017
  20. apaszke commented on Jan 31, 2017

    @apaszke
    Contributor

    Fixed in #650.

  21. added a commit that references this issue on Nov 25, 2020
  22. added a commit that references this issue on Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

high prioritymodule: dependency bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions