Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

链接时报错torch_npu::init_npu(std::string const&) #41

Open
nihao1997 opened this issue Jun 19, 2024 · 5 comments
Open

链接时报错torch_npu::init_npu(std::string const&) #41

nihao1997 opened this issue Jun 19, 2024 · 5 comments

Comments

@nihao1997
Copy link

编译时候报错torch_npu::init_npu(std::string const&)
nm 命令查找libtorch_npu.so,也未找到这个函数

@ChengruiZhang
Copy link

ChengruiZhang commented Jun 19, 2024

image
不论是pip还是源码编译出的库中均会出现类似的问题

@yunyiyun
Copy link

如果是使用libtorch_npu,请使用build_libtorch_npu.py编译获得

@HowardZorn
Copy link

I also have the same issue. Your libtorch_npu does not contain any version of the symbol torch_npu::init_npu.

@HowardZorn
Copy link

A Huawei employee said, "This symbol is only provided by libtorch_npu, but not the python package torch_npu". So it should be compiled by ourselves.

But there is a possible non-compiling solution:

// torch_npu::init_npu(device_index);
aclInit(nullptr);
c10_npu::SetDevice(device_index);

@yunyiyun
Copy link

A Huawei employee said, "This symbol is only provided by libtorch_npu, but not the python package torch_npu". So it should be compiled by ourselves.

But there is a possible non-compiling solution:

// torch_npu::init_npu(device_index);
aclInit(nullptr);
c10_npu::SetDevice(device_index);

https://www.hiascend.com/document/detail/zh/Pytorch/60RC2/configandinstg/instg/insg_0007.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants