8000 Build failed when use shared MKL library · Issue #138994 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Build failed when use shared MKL library #138994

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

Closed
xuhancn opened this issue Oct 26, 2024 · 1 comment
Closed

Build failed when use shared MKL library #138994

xuhancn opened this issue Oct 26, 2024 · 1 comment
Assignees
Labels
module: mkl Related to our MKL support module: windows Windows support for PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@xuhancn
Copy link
Collaborator
xuhancn commented Oct 26, 2024
          Which version of oneAPI are you using to build pytorch? I am using oneAPI binaries from https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html and I am getting linking errors:
   Creating library lib\torch_cpu.lib and object lib\torch_cpu.exp
MklAllocationHelper.cpp.obj : error LNK2019: unresolved external symbol i_malloc referenced in function "void __cdecl `dynamic initializer for 'g_b_registered_mkl_alloction''(void)" (??__Eg_b_registered_mkl_alloction@@YAXXZ)
MklAllocationHelper.cpp.obj : error LNK2019: unresolved external symbol i_calloc referenced in function "void __cdecl `dynamic initializer for 'g_b_registered_mkl_alloction''(void)" (??__Eg_b_registered_mkl_alloction@@YAXXZ)
MklAllocationHelper.cpp.obj : error LNK2019: unresolved external symbol i_realloc referenced in function "void __cdecl `dynamic initializer for 'g_b_registered_mkl_alloction''(void)" (??__Eg_b_registered_mkl_alloction@@YAXXZ)
MklAllocationHelper.cpp.obj : error LNK2019: unresolved external symbol i_free referenced in function "void __cdecl `dynamic initializer for 'g_b_registered_mkl_alloction''(void)" (??__Eg_b_registered_mkl_alloction@@YAXXZ)
bin\torch_cpu.dll : fatal error LNK1120: 4 unresolved externals

Looking at CMakeFiles/torch_cpu.rsp I see that mkl_core_dll.lib is used for linking and it doesn't define these i_* symbols.

Originally posted by @gshimansky in #138419 (comment)

cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @gujinghui @EikanWang @fengyuan14 @guangyey

@xuhancn xuhancn self-assigned this Oct 26, 2024
@xuhancn xuhancn added module: mkl Related to our MKL support module: windows Windows support for PyTorch module: xpu Intel XPU related issues labels Oct 26, 2024
@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 29, 2024
@EikanWang
Copy link
Collaborator

@xuhancn , could you help refine the title of this issue? As we synced offline, it should not be related xpu.

@EikanWang EikanWang removed the module: xpu Intel XPU related issues label Oct 29, 2024
@xuhancn xuhancn changed the title Which version of oneAPI are you using to build pytorch? I am using oneAPI binaries from https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html and I am getting linking errors: Build failed when use shared MKL library Oct 29, 2024
rahulsingh-intel pushed a commit to rahulsingh-intel/pytorch that referenced this issue Nov 5, 2024
Fixes pytorch#138994

We can turn off `USE_MIMALLOC_ON_MKL` temporary. Due to it caused pytorch#138994

For totally fixed, we need fix `USE_STATIC_MKL` lost functionality issue: pytorch#138996, and then get the correctly MKL linking type(shared/static). It still need some time to pass all CI and builder scripts.

Pull Request resolved: pytorch#139204
Approved by: https://github.com/ezyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: mkl Related to our MKL support module: windows Windows support for PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0