Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run on Fedora 30 Wayland #32

Open
pop opened this issue Aug 30, 2019 · 13 comments
Open

Cannot run on Fedora 30 Wayland #32

pop opened this issue Aug 30, 2019 · 13 comments

Comments

@pop
Copy link

pop commented Aug 30, 2019

Hey team! I am super interested in trying space-menace but I can't get the dang thing to run! It compiles just fine for me, but won't run. 😞 Let me know if I'm doing something wrong or if I found a real bug we can fix.

The error

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running `target/debug/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.12.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: c72063f13f90bae4ae96b6c96e04a2206493bbf3
[INFO][amethyst::app] Rustc version: 1.39.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 72b2abfd65ba024e12d7fe51852a309419f494d8
[WARN][gfx_backend_vulkan] Unable to find layer: VK_LAYER_LUNARG_standard_validation
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : Device Extension: VK_KHR_8bit_storage (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)

[INFO][gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : Device Extension: VK_KHR_16bit_storage (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)

[ ... snip ... ]

[INFO][gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : Device Extension: VK_GOOGLE_hlsl_functionality1 (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)

[INFO][gfx_backend_vulkan] 
GENERAL [Loader Message (0)] : Device Extension: VK_NV_compute_shader_derivatives (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)

WARN][rendy_wsi] Image count not supported. Supported: 4..4294967295, requested: 3
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorMessage { msg: "Image count not supported." }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(139264) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(12288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(65536) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(524288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(155648) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
Segmentation fault (core dumped)

Host info

$ rustc --version
rustc 1.39.0-nightly (72b2abfd6 2019-08-29)
$ cargo --version
cargo 1.39.0-nightly (22f7dd049 2019-08-27)
$ uname -s -r -v -m -p -i -o
Linux 5.2.9-200.fc30.x86_64 #1 SMP Fri Aug 16 21:37:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I am running Wayland on Fedora 30.

Misc debugging info

Full cargo run logs
Packages installed on my system

@clemarescx
Copy link
Contributor

clemarescx commented Aug 30, 2019

It looks like you are running it in debug mode. Try compiling and running it with optimizations enabled:
cargo run --release

@pop
Copy link
Author

pop commented Aug 31, 2019

@clemarescx 😕

$ cargo run --release
    Finished release [optimized] target(s) in 0.20s
     Running `target/release/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.12.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: c72063f13f90bae4ae96b6c96e04a2206493bbf3
[INFO][amethyst::app] Rustc version: 1.39.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 72b2abfd65ba024e12d7fe51852a309419f494d8
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
[WARN][rendy_wsi] Image count not supported. Supported: 4..4294967295, requested: 3
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorMessage { msg: "Image count not supported." }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Segmentation fault (core dumped)

Error log with RUST_BACKTRACE=full

@azriel91
Copy link
Member

azriel91 commented Sep 1, 2019

Likely resolved by amethyst/rendy#182

@pop
Copy link
Author

pop commented Sep 1, 2019

@azriel91 Any way I can verify that before closing the issue? I'm not sure how to trick Cargo into using the master version of rendy. 🤔 😕

@azriel91
Copy link
Member

azriel91 commented Sep 1, 2019

yeap, add this to Cargo.toml:

[patch.crates-io]
rendy = { git = "https://github.com/amethyst/rendy.git" }

@pop
Copy link
Author

pop commented Sep 5, 2019

Hmm. Cargo ignores that patch when I add it to Cargo.toml. I haven't dug into how to properly patch dependencies. I might dig deeper and let you know what I find.

diff --git a/Cargo.toml b/Cargo.toml
index 03cb355..4971505 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,9 @@ log = "*"
 specs-derive = "*"
 
 [features]
-default = ["metal"]
+default = ["vulkan"]
 metal = ["amethyst/metal"]
 vulkan = ["amethyst/vulkan"]
 
+[patch.crates-io]
+rendy = { git = "https://github.com/amethyst/rendy.git" }
diff --git a/Cargo.lock b/Cargo.lock
index f8ab91a..af637e4 100644
--- a/Cargo.lock
+++ b/Cargo.lock

[... snip ...]

@ -4334,10 +4319,15 @@ name = "xml-rs"
 version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[patch.unused]]
+name = "rendy"
+version = "0.4.0"
+source = "git+https://github.com/amethyst/rendy.git#1980054d9efa3355eaa76163990e7127fb169295"
+

[... snip ...]

@munshaw
Copy link

munshaw commented Sep 6, 2019

I've recreated the problem on Debian Buster with Wayland.
When adding this to Cargo.toml:

[patch.crates-io]
rendy = { git = "https://github.com/amethyst/rendy.git" }

I get the following message:

warning: Patch `rendy v0.4.0 (https://github.com/amethyst/rendy.git#a8ac0de9)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.

I believe Amethyst must be updated to use a newer version of rendy before this will work. If you just want to see it working locally, you could try to apply commit amethyst/rendy@08df51d to amethyst/rendy@b3904b6 and patch that into Cargo.toml (untested).

If it will be a while before Amethyst can use rendy v0.4.0, perhaps a backported fix can be released as v0.3.3?

@pop
Copy link
Author

pop commented Nov 6, 2019

Any word on this? Think we could get a backport or could we merge Amethyst libraries to using rendy >= 0.4.0? I can't run any of the Amethyst showcase projects or the 2D project template.

@krankur
Copy link
Member

krankur commented Nov 6, 2019

@pop I don't have much knowledge on this. @azriel91 or some other member from the core Amethyst team may have some information.

@azriel91
Copy link
Member

azriel91 commented Nov 7, 2019

The master branch of amethyst has got rendy 0.4.1 (amethyst_rendy/Cargo.toml), so the patch should hopefully work if you cargo update as well (seeing that space-menace master depends on amethyst master).

Repasting here for convenience:

[patch.crates-io]
rendy = { git = "https://github.com/amethyst/rendy.git" }

@valkum
Copy link

valkum commented Nov 10, 2019

The fix seems to not be included in 0.4.1
See https://github.com/amethyst/rendy/blob/v0.4.1/graph/src/node/render/pass.rs#L443

amethyst/rendy@561847a seems to fix the problem. Maybe we can release rendy v0.4.2

@mxgrey
Copy link

mxgrey commented Nov 10, 2019

To test a hypothetical 0.4.2 release of rendy, you can use the following patches to the current master branch of amethyst:

diff --git a/Cargo.toml b/Cargo.toml
index a3cdf092..179e0994 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -350,3 +350,5 @@ required-features = [ "tiles" ]
 [package.metadata.docs.rs]
 features = ["animation", "audio", "gltf", "tiles", "json", "locale", "network", "sdl_controller", "vulkan"]
 
+[patch.crates-io]
+rendy = { git = "https://github.com/mxgrey/rendy", branch = "test_0.4.2" }
diff --git a/amethyst_rendy/Cargo.toml b/amethyst_rendy/Cargo.toml
index f227b694..1b7e77e0 100644
--- a/amethyst_rendy/Cargo.toml
+++ b/amethyst_rendy/Cargo.toml
@@ -25,7 +25,7 @@ glsl-layout = "0.3"
 lazy_static = "1.3"
 log = "0.4"
 palette = { version = "0.4", features = ["serde"] }
-rendy = { version = "0.4.1", default-features = false, features = ["base", "mesh-obj", "texture-image", "texture-palette", "serde-1"] }
+rendy = { version = "0.4.2", default-features = false, features = ["base", "mesh-obj", "texture-image", "texture-palette", "serde-1"] }
 ron = "0.5"
 serde = { version = "1", features = ["serde_derive"] }
 fnv = "1"

This uses a fork I've made of rendy where only the pertinent fix was added to v0.4.1.

@pop
Copy link
Author

pop commented Nov 10, 2019

Exporting the environment variable WINIT_UNIX_BACKEND=x11 seems to also be a valid workaround until a fix makes it into an Amethyst release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants