Cannot connect to X server

Trying to run the server from source using cargo run -- -f and it's erroring out with this error. I'm running this from within Niri so I assumed it'd latch onto the wayland session. Does it need to run from inside X or the tty? Full output:
warning: method `uid` is never used
--> src/nodes/items/panel.rs:213:5
|
212 | pub trait PanelItemTrait: Backend + Send + Sync + 'static {
| -------------- method in this trait
213 | fn uid(&self) -> &str;
| ^^^
|
= note: `#[warn(dead_code)]` on by default

warning: `stardust-xr-server` (bin "stardust-xr-server") generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s
Running `target/debug/stardust-xr-server -f`
before init
[SK error] Cannot connect to X server
[SK error] Couldn't initialize a flatscreen display!
[SK error] System Platform failed to initialize!
[SK error] No messagebox capability for this platform!
after init
thread 'main' panicked at src/main.rs:130:6:
StereoKit failed to initialize: SkInit(Settings { app_name: "Stardust XR", assets_folder: "", display_preference: Flatscreen, no_flatscreen_fallback: false, blend_preference: AnyTransparent, depth_mode: D32, log_filter: Error, overlay_app: false, overlay_priority: 4294967295, flatscreen_pos_x: 0, flatscreen_pos_y: 0, flatscreen_width: 0, flatscreen_height: 0, disable_flatscreen_mr_sim: false, disable_desktop_input_window: true, disable_unfocused_sleep: false, render_scaling: 2.0 })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: method `uid` is never used
--> src/nodes/items/panel.rs:213:5
|
212 | pub trait PanelItemTrait: Backend + Send + Sync + 'static {
| -------------- method in this trait
213 | fn uid(&self) -> &str;
| ^^^
|
= note: `#[warn(dead_code)]` on by default

warning: `stardust-xr-server` (bin "stardust-xr-server") generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s
Running `target/debug/stardust-xr-server -f`
before init
[SK error] Cannot connect to X server
[SK error] Couldn't initialize a flatscreen display!
[SK error] System Platform failed to initialize!
[SK error] No messagebox capability for this platform!
after init
thread 'main' panicked at src/main.rs:130:6:
StereoKit failed to initialize: SkInit(Settings { app_name: "Stardust XR", assets_folder: "", display_preference: Flatscreen, no_flatscreen_fallback: false, blend_preference: AnyTransparent, depth_mode: D32, log_filter: Error, overlay_app: false, overlay_priority: 4294967295, flatscreen_pos_x: 0, flatscreen_pos_y: 0, flatscreen_width: 0, flatscreen_height: 0, disable_flatscreen_mr_sim: false, disable_desktop_input_window: true, disable_unfocused_sleep: false, render_scaling: 2.0 })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5 Replies
Nova
Nova4mo ago
if you don't have a headset connected then you need an x server you can use https://github.com/supreeeme/xwayland-satellite for niri
Mauve
Mauve3mo ago
oh I see. My headset has a driver in openXR but I think I need to toggle some flags first on it. I'll try that. Wouls running in gamescope or cage be close enough to running an x server? Out of curiousity, why the need for an x server instead of wayland?
Nova
Nova3mo ago
that should do it! because i don't wanna deal with the wayland c api and add it to stereokit adding x support was hard enough
Mauve
Mauve3mo ago
Cool I'll try it out this weekend if I have the brain power That's fair. And in the headset case it's just openxr and direct rendering?
Nova
Nova3mo ago
yep uses EGL and monado uses vulkan + KMS so no xorg is involved at all
Want results from more Discord servers?
Add your server