Wsl2

sample_mnist doesn’t work on WSL2

&&&& RUNNING TensorRT.sample_mnist [TensorRT v8400] # ./sample_mnist
[03/18/2022-18:04:34] [I] Building and running a GPU inference engine for MNIST
[03/18/2022-18:04:34] [I] [TRT] [MemUsageChange] Init CUDA: CPU +313, GPU +0, now: CPU 320, GPU 1181 (MiB)
[03/18/2022-18:04:35] [I] [TRT] [MemUsageSnapshot] Begin constructing builder kernel library: CPU 340 MiB, GPU 1181 MiB
[03/18/2022-18:04:38] [I] [TRT] [MemUsageSnapshot] End constructing builder kernel library: CPU 405 MiB, GPU 1181 MiB
[03/18/2022-18:04:39] [I] [TRT] [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +518, GPU +224, now: CPU 925, GPU 1405 (MiB)
[03/18/2022-18:04:39] [I] [TRT] [MemUsageChange] Init cuDNN: CPU +115, GPU +52, now: CPU 1040, GPU 1457 (MiB)
[03/18/2022-18:04:39] [I] [TRT] Local timing cache in use. Profiling results in this builder pass will not be stored.
[03/18/2022-18:04:44] [I] [TRT] Detected 1 inputs and 1 output network tensors.
[03/18/2022-18:04:44] [I] [TRT] Total Host Persistent Memory: 13600
[03/18/2022-18:04:44] [I] [TRT] Total Device Persistent Memory: 0
[03/18/2022-18:04:44] [I] [TRT] Total Scratch Memory: 0
[03/18/2022-18:04:44] [I] [TRT] [MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 1 MiB, GPU 884 MiB
[03/18/2022-18:04:44] [I] [TRT] [BlockAssignment] Algorithm ShiftNTopDown took 0.0328ms to assign 3 blocks to 10 nodes requiring 57860 bytes.
[03/18/2022-18:04:44] [I] [TRT] Total Activation Memory: 57860
[03/18/2022-18:04:44] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in building engine: CPU +0, GPU +4, now: CPU 0, GPU 4 (MiB)
[03/18/2022-18:04:44] [I] [TRT] [MemUsageChange] Init CUDA: CPU +0, GPU +0, now: CPU 1555, GPU 1655 (MiB)
[03/18/2022-18:04:44] [I] [TRT] Loaded engine size: 2 MiB
[03/18/2022-18:04:44] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +1, now: CPU 0, GPU 1 (MiB)
[03/18/2022-18:04:44] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +0, now: CPU 0, GPU 1 (MiB)
[03/18/2022-18:04:44] [I] Input:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@%.:@@@@@@@@@@@@
@@@@@@@@@@@@@: *@@@@@@@@@@@@
@@@@@@@@@@@@* =@@@@@@@@@@@@@
@@@@@@@@@@@% :@@@@@@@@@@@@@@
@@@@@@@@@@@- *@@@@@@@@@@@@@@
@@@@@@@@@@# .@@@@@@@@@@@@@@@
@@@@@@@@@@: #@@@@@@@@@@@@@@@
@@@@@@@@@+ -@@@@@@@@@@@@@@@@
@@@@@@@@@: %@@@@@@@@@@@@@@@@
@@@@@@@@+ +@@@@@@@@@@@@@@@@@
@@@@@@@@:.%@@@@@@@@@@@@@@@@@
@@@@@@@% -@@@@@@@@@@@@@@@@@@
@@@@@@@% -@@@@@@#..:@@@@@@@@
@@@@@@@% +@@@@@-    :@@@@@@@
@@@@@@@% =@@@@%.#@@- +@@@@@@
@@@@@@@@..%@@@*+@@@@ :@@@@@@
@@@@@@@@= -%@@@@@@@@ :@@@@@@
@@@@@@@@@- .*@@@@@@+ +@@@@@@
@@@@@@@@@@+  .:-+-: .@@@@@@@
@@@@@@@@@@@@+:    :*@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[03/18/2022-18:04:44] [I] Output:
0: *
1: *
2: *
3: *
4: *
5: *
6: *
7: *
8: *
9: *

&&&& FAILED TensorRT.sample_mnist [TensorRT v8400] # ./sample_mnist

TensorRT Version: all 8.x versions affected
GPU Type: RTX 2070
Nvidia Driver Version: 510
CUDA Version: 11.6 (11.4, 11.1)
Operating System + Version: WSL2, Ubuntu 20

1 Like

I had the same problem as you, did you solve it?

Hi,

Could you please raise this issue on Issues · NVIDIA/TensorRT · GitHub to get better help.

Thank you.

No.

There is github report: There are something wrong in WSL2 with tensorrt example · Issue #1769 · NVIDIA/TensorRT · GitHub

still not fixed yet…

Hi,
Please refer to the below link for Sample guide.

Refer to the installation steps from the link if in case you are missing on anything

However suggested approach is to use TRT NGC containers to avoid any system dependency related issues.

In order to run python sample, make sure TRT python packages are installed while using NGC container.
/opt/tensorrt/python/python_setup.sh

In case, if you are trying to run custom model, please share your model and script with us, so that we can assist you better.
Thanks!