bug: WSL2 CUDA + Open3D libdxcore conflict crashes visualize.py
Bug Description
Running scripts/visualize.py on WSL2 with a CUDA-capable GPU crashes with an ld.so assertion failure before any Python output is produced. The crash is triggered when the model is moved to the GPU (model.to("cuda")), which initializes the full CUDA context and loads WSL2's libdxcore.so.
Environment
- OS: WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
- Python: 3.11
- PyTorch: (check
torch.__version__)
- Open3D: 0.19.0
- CUDA driver:
/usr/lib/wsl/drivers/nv_dispig.inf_amd64_f4c7a2fd13e0f763/libcuda.so.1.1
Steps to Reproduce
python scripts/visualize.py --config configs/evaluate_mini.yaml \
--no-show --export outputs/test.ply
Error
Inconsistency detected by ld.so: dl-version.c: 204:
_dl_check_map_versions: Assertion `needed != NULL' failed!
Root Cause
Running with LD_DEBUG=versions reveals the underlying failures:
libcuda.so.1.1: error: symbol lookup error: undefined symbol: cuPvtCompilePtx (fatal)
libdxcore.so: error: symbol lookup error: undefined symbol: D3DKMTOpenSyncObjectFromNtHandle (fatal)
python: error: symbol lookup error: undefined symbol: InitializeInjectionCaskEnhanced (fatal)
When model.to("cuda") is called, the CUDA runtime fully initializes and loads libdxcore.so — a WSL2-specific DirectX/CUDA interop library. libdxcore.so expects Windows kernel D3DKMT functions that are not fully available in the current WSL2 kernel/driver version, causing the dynamic linker to crash. This is not a Python exception and cannot be caught with try/except.
Current Workaround
Pass --device cpu to force inference on CPU, which avoids full CUDA context initialization entirely. Output quality is unaffected — only inference speed is impacted.
python scripts/visualize.py --config configs/evaluate_mini.yaml \
--no-show --export outputs/test.ply --device cpu
Potential Fixes to Investigate
References
bug: WSL2 CUDA + Open3D libdxcore conflict crashes visualize.py
Bug Description
Running
scripts/visualize.pyon WSL2 with a CUDA-capable GPU crashes with anld.soassertion failure before any Python output is produced. The crash is triggered when the model is moved to the GPU (model.to("cuda")), which initializes the full CUDA context and loads WSL2'slibdxcore.so.Environment
torch.__version__)/usr/lib/wsl/drivers/nv_dispig.inf_amd64_f4c7a2fd13e0f763/libcuda.so.1.1Steps to Reproduce
python scripts/visualize.py --config configs/evaluate_mini.yaml \ --no-show --export outputs/test.plyError
Root Cause
Running with
LD_DEBUG=versionsreveals the underlying failures:When
model.to("cuda")is called, the CUDA runtime fully initializes and loadslibdxcore.so— a WSL2-specific DirectX/CUDA interop library.libdxcore.soexpects Windows kernel D3DKMT functions that are not fully available in the current WSL2 kernel/driver version, causing the dynamic linker to crash. This is not a Python exception and cannot be caught withtry/except.Current Workaround
Pass
--device cputo force inference on CPU, which avoids full CUDA context initialization entirely. Output quality is unaffected — only inference speed is impacted.python scripts/visualize.py --config configs/evaluate_mini.yaml \ --no-show --export outputs/test.ply --device cpuPotential Fixes to Investigate
wsl --update) or a newer NVIDIA Windows driver.OPEN3D_CPU_RENDERING=trueor using Open3D's headless EGL backend avoids loading the conflicting rendering libraries while still allowing CUDA.LD_PRELOADapproach — preload the systemlibstdc++.so.6orlibgcc_s.so.1before Python starts to see if it resolves the symbol conflict without requiring CPU fallback.References