rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
6k stars 274 forks source link

pip package in conda env: viewer fails with "WGPU error: Failed to create wgpu adapter, no suitable adapter found." #4876

Open smidm opened 7 months ago

smidm commented 7 months ago

Describe the bug

The rerun viewer fails to start when installed using pip in conda environment. The standalone executable, pip install in a pure python environment (not based on a conda installed python) or the conda package (conda install -c conda-forge rerun-sdk) in conda environment all work.

what doesn't solve the problem:

To Reproduce Steps to reproduce the behavior:

  1. conda create --name rerun python=3.11 -y
  2. conda activate rerun
  3. pip install rerun-sdk
  4. rerun

Expected behavior

viewer gui starts

Backtrace

2024-01-19T05:44:45Z DEBUG re_memory::memory_limit] Setting memory limit to 11.5 GiB, which is 75% of total available memory (15.4 GiB).
[2024-01-19T05:44:45Z DEBUG re_sdk_comms::server] Hosting a SDK server over TCP at 0.0.0.0:9876. Connect with the Rerun logging SDK.
[2024-01-19T05:44:45Z DEBUG eframe] Using the wgpu renderer
[2024-01-19T05:44:45Z DEBUG eframe::native::run] Entering the winit event loop (run_return)…
[2024-01-19T05:44:45Z DEBUG eframe::native::file_storage] Loading app state from "/home/matej/.local/share/rerun/app.ron"…
[2024-01-19T05:44:45Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2024-01-19T05:44:45Z DEBUG winit::platform_impl::platform::x11::window] Calculated physical dimensions: 1600x1131
[2024-01-19T05:44:45Z ERROR wgpu_hal::vulkan::instance] enumerate_adapters: Initialization of an object has failed
[2024-01-19T05:44:45Z ERROR eframe::native::run] Exiting because of error: WGPU error: Failed to create wgpu adapter, no suitable adapter found. during event Resumed
[2024-01-19T05:44:45Z DEBUG eframe::native::run] Asking to exit event loop…
[2024-01-19T05:44:45Z DEBUG eframe::native::run] Received Event::LoopDestroyed - saving app state…
[2024-01-19T05:44:45Z DEBUG eframe::native::run] eframe window closed
Traceback (most recent call last):
  File "/home/matej/local/conda/envs/rerun/bin/rerun", line 8, in <module>
    sys.exit(main())
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter found.

Desktop (please complete the following information):

Rerun version

rerun_py 0.12.1 [rustc 1.74.0 (79e9716c9 2023-11-13), LLVM 17.0.4] x86_64-unknown-linux-gnu release-0.12.1 bef0d78, built 2024-01-17T16:50:34Z

smidm commented 7 months ago

can't reproduce this on Ubuntu 22.04

smidm commented 7 months ago

It seems that newer distributions are affected.

jleibs commented 7 months ago

@smidm this is interesting though not particularly shocking to me.

Rerun is not a pure-python package and links against several system libraries. In a pip-based installation, the assumption is the wheel will pick those libraries up from the system. In a conda-based environment, the assumption is the conda-build tooling instead provides these dependencies.

When you mix pip and conda like this I assume the conda environment is causing Rerun to look to conda for the system deps, but they aren't provided by the conda environment.

Is there a reason that you can't just use the conda-provided package?

smidm commented 7 months ago

I can use the conda package perfectly well, but I wasn't aware of it's existence at first. Installing pip packages into conda is well supported use case and I haven't encountered similar problem before. I'm using pip installed packages in conda quite often.