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

WSL: zesInit segfaults #721

Open
tkatila opened this issue Apr 16, 2024 · 3 comments
Open

WSL: zesInit segfaults #721

tkatila opened this issue Apr 16, 2024 · 3 comments
Labels
in queue L0 Sysman Issue related to L0 Sysman

Comments

@tkatila
Copy link

tkatila commented Apr 16, 2024

I'd like to use Sysman API in a container in WSL. I noticed that when I call zesInit() the app segmentation faults.

I used the latest 22.04 container + latest compute-runtime release (https://github.com/intel/compute-runtime/releases/tag/24.09.28717.12).

Container is started like so: docker run -v /usr/lib/wsl:/usr/lib/wsl:ro --device /dev/dxg --rm -it ubuntu:22.04 bash

My app is essentially just a call to zesInit:

#include <zes_api.h>
#include <stdio.h>

int main()
{
        ze_result_t res = zesInit(0);
        if (res == 0) {
                fprintf(stderr, "all good\n");
        } else {
                fprintf(stderr, "all bad\n");
        }

        return 0;
}

Compiled with gcc l0.cpp -o l0 -I/usr/include/level_zero -lze_loader

GDB backtrace is like so:

 Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
74      ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
#1  0x00007f673a926789 in std::char_traits<char>::length (__s=0x100000000 <error: Cannot access memory at address 0x100000000>)
    at /usr/include/c++/11/bits/char_traits.h:399
#2  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> > (__a=...,
    __s=0x100000000 <error: Cannot access memory at address 0x100000000>, this=0x56233579dba0) at /usr/include/c++/11/bits/basic_string.h:536
#3  NEO::HwDeviceIdDrm::HwDeviceIdDrm (devNodePathIn=0x0, pciPathIn=0x100000000 <error: Cannot access memory at address 0x100000000>, fileDescriptorIn=<optimized out>,
    this=0x56233579db90) at ../../neo/shared/source/os_interface/linux/hw_device_id.h:24
#4  L0::Sysman::SysmanHwDeviceIdDrm::HwDeviceIdDrm (this=0x56233579db90) at ../../neo/level_zero/sysman/source/shared/linux/sysman_hw_device_id_linux.h:17
#5  std::make_unique<L0::Sysman::SysmanHwDeviceIdDrm, int, char const*, char const*> () at /usr/include/c++/11/bits/unique_ptr.h:962
#6  L0::Sysman::createSysmanHwDeviceId (hwDeviceId=std::unique_ptr<NEO::HwDeviceId> = {...})
    at ../../neo/level_zero/sysman/source/shared/linux/sysman_hw_device_id_linux.cpp:48
#7  0x00007f673a91e0b6 in L0::Sysman::SysmanDriverImp::initialize (this=<optimized out>, result=0x7ffc20c4c504)
    at ../../neo/level_zero/sysman/source/driver/sysman_driver.cpp:49
#8  0x00007f673a91de8f in operator() (__closure=<optimized out>) at ../../neo/level_zero/sysman/source/driver/sysman_driver.cpp:78
#9  std::__invoke_impl<void, L0::Sysman::SysmanDriverImp::driverInit(zes_init_flags_t)::<lambda()> > (__f=...) at /usr/include/c++/11/bits/invoke.h:61
#10 std::__invoke<L0::Sysman::SysmanDriverImp::driverInit(zes_init_flags_t)::<lambda()> > (__fn=...) at /usr/include/c++/11/bits/invoke.h:96
#11 operator() (__closure=<optimized out>) at /usr/include/c++/11/mutex:776
#12 operator() (__closure=0x0) at /usr/include/c++/11/mutex:712
#13 _FUN () at /usr/include/c++/11/mutex:712
#14 0x00007f673c862ee8 in __pthread_once_slow (once_control=0x7f673c3f6aa8 <L0::Sysman::driverImp+8>, init_routine=0x7f673c677d50 <__once_proxy>)
    at ./nptl/pthread_once.c:116
#15 0x00007f673a91e589 in __gthread_once (__func=<optimized out>, __once=0x7f673c3f6aa8 <L0::Sysman::driverImp+8>)
    at /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:700
#16 std::call_once<L0::Sysman::SysmanDriverImp::driverInit(zes_init_flags_t)::<lambda()> > (__f=..., __once=...) at /usr/include/c++/11/mutex:783
#17 L0::Sysman::SysmanDriverImp::driverInit (flags=<optimized out>, this=0x7f673c3f6aa0 <L0::Sysman::driverImp>)
    at ../../neo/level_zero/sysman/source/driver/sysman_driver.cpp:76
#18 L0::Sysman::init (flags=<optimized out>) at ../../neo/level_zero/sysman/source/driver/sysman_driver.cpp:119
#19 0x00007f673ca27b5b in zesInit () from /lib/x86_64-linux-gnu/libze_loader.so.1
#20 0x0000562332e7617f in main () at l0.cpp:6
@JablonskiMateusz JablonskiMateusz added the L0 Sysman Issue related to L0 Sysman label Apr 16, 2024
@saik-intel
Copy link
Contributor

We will look into this issue , ideally it shouldn't segfault

@eero-t
Copy link

eero-t commented Aug 19, 2024

We will look into this issue , ideally it shouldn't segfault

@saik-intel / @JablonskiMateusz (nearly) 4 months gone, any news?

@saik-intel
Copy link
Contributor

we didn't fixed yet, will work on lower priority.

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

No branches or pull requests

4 participants