Undefined symbol: zgetrs

I have Xavier NX with Yocto OS.
I need to have pytorch with GPU support.

I have installed pytorch with:

To prepare the precompiled package I used Xaver NX with Ubuntu.

Steps to reproduce:

Set max Xavier NX performance by switching power mode
sudo nvpmodel -m 2 – or 0 for non Xavier boards (more details on /etc/nvpmodel.conf )
Clone git repository and checkout version you want
git clone --recursive --branch 1.7 http://github.com/pytorch/pytorch
Download and apply correct patch file based on version you want to build

Set env values


$ export USE_NCCL=0 $ export USE_DISTRIBUTED=0 # skip setting this if you want to enable OpenMPI backend $ export USE_QNNPACK=0 $ export USE_PYTORCH_QNNPACK=0 $ export TORCH_CUDA_ARCH_LIST=“5.3;6.2;7.2” $ export PYTORCH_BUILD_VERSION= # without the leading ‘v’, e.g. 1.3.0 for PyTorch v1.3.0 $ export PYTORCH_BUILD_NUMBER=1 * $ export USE_OPENMP=1

Install dependencies and run build


$ sudo apt-get install python3-pip cmake libopenblas-dev $ pip3 install -r requirements.txt $ pip3 install scikit-build $ pip3 install ninja $ python3 setup.py bdist_wheel

However, when i import torch im getting following error:

        import torch
        Traceback (most recent call last):
        File “”, line 1, in
        File “/home/root/.local/lib/python3.8/site-packages/torch/init.py”, line 190, in
        from torch.C import *
        ImportError: /home/root/.local/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: zgetrs

I cannot find anything on the web. Can somebody help please ?

Hi @adrian.oramus1, sorry I am unfamiliar with Yocto. zgetrs is a function from LAPACK - my guess is that since you built this on Ubuntu, the version of ATLAS that was linked against when you built PyTorch is different from the version in Yocto.

Are you able to build PyTorch under Yocto environment to avoid these kind of issues? Perhaps Yocto users from the community may be able to provide their advice and support about this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.