Syllo / nvtop

GPU & Accelerator process monitoring for AMD, Apple, Huawei, Intel, NVIDIA and Qualcomm
Other
7.98k stars 291 forks source link

WSL ERROR: [1] 16559 segmentation fault nvtop #85

Closed ouening closed 3 years ago

ouening commented 3 years ago

OS: Inside Preview 21277 WSL: Linux 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I have build nvtop from source and install it, but I got error [1] 16559 segmentation fault nvtop when I run it. Can someone fix it?

Syllo commented 3 years ago

Hi,

I didn't test nvtop on WSL, and don't have a windows install with an NVIDIA GPU to test on. Could you please provide more information of where the segmentation fault occurs? (building with the flag -DCMAKE_BUILD_TYPE=Debug and using a debugger should do the trick)

ouening commented 3 years ago

I compiled it with debug mode, and the error message is:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==19074==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000001 (pc 0x7fdd29bbc9d6 bp 0x7ffc4bcbd160 sp 0x7ffc4bcbc888 T0)
==19074==The signal is caused by a READ memory access.
==19074==Hint: address points to the zero page.
    #0 0x7fdd29bbc9d5  (/lib/x86_64-linux-gnu/libasan.so.5+0x1269d5)
    #1 0x7fdd29b33164  (/lib/x86_64-linux-gnu/libasan.so.5+0x9d164)
    #2 0x7fdd29b33fa6 in vfprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x9dfa6)
    #3 0x7fdd29b340ae in __interceptor_fprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x9e0ae)
    #4 0x55bcabfca570 in init_gpu_info_extraction /mnt/h/NVIDIA/nvtop/src/extract_gpuinfo.c:46
    #5 0x55bcabfa6f17 in main /mnt/h/NVIDIA/nvtop/src/nvtop.c:238
    #6 0x7fdd28b7f0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x55bcabfa60ed in _start (/usr/local/bin/nvtop+0x690ed)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libasan.so.5+0x1269d5)
==19074==ABORTING
Syllo commented 3 years ago

I don't know why the call to printf crashes, but the crash happens in the branch that fails to initialize the driver information library nvml.

So there seems to be a problem while accessing the NVIDIA driver inside WSL. This is not a bug in nvtop.

Try contacting the developers of WSL, they may be of better help than me.

RedFox9999 commented 3 years ago

Basically wsl2 cannot detect GPU'S.

Syllo commented 3 years ago

It seems to be a WSL problem, closing the issue for now.