"No physical devices found" in github

(Martin) #1

I’m getting errors from master:

 Running `target/debug/examples/sphere`

[INFO][winit::platform::platform::x11::window] Guessed window DPI factor: 1
[INFO][amethyst::app] Initializing Amethyst…
[INFO][amethyst::app] Version: 0.10.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: 1e7bd29511ee711c4053f85be82827fb7b7f4920
[INFO][amethyst::app] Rustc version: 1.35.0 Stable
[INFO][amethyst::app] Rustc git commit: 3c235d5600393dfe6c36eeed34042efad8d4f26e
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the ‘no-slow-safety-checks’ feature!
thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: ErrorMessage { msg: “No physical devices found” }’, src/libcore/result.rs:997:5
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.

when I do

cd ~/extgit/amethyst/ # amethyst github
git pull
cargo update
cargo +nightly run --example sphere # or stable

The backtrace includes:

4: failure::error_message::err_msg::hb864ac62a08ba3cb (0x5624e58a1410)
at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error_message.rs:12
5: rendy_factory::factory::init_with_instance::h1ef73c86b9fd46f0 (0x5624e5d0b107)
at /home/martin/extgit/amethyst/<::failure::macros::bail macros>:1
6: rendy_factory::factory::init::h07da62b90f3e0613 (0x5624e5d0e07a)
at /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/rendy-factory-0.2.0/src/factory.rs:1026
7: <amethyst_rendy::system::RenderingSystem<B,G> as shred::system::RunNow>::setup::h8409c2a86a0af04e (0x5624e58c0843)
at /home/martin/extgit/amethyst/amethyst_rendy/src/system.rs:228

Should I raise an issue?

Git is at:

commit 1e7bd29511ee711c4053f85be82827fb7b7f4920 (HEAD -> master, origin/staging, origin/master, origin/HEAD)…
Date: Thu May 23 15:04:22 2019 +0000

Box is: Linux xiaosan 5.0.16-200.fc29.x86_64 #1 SMP Tue May 14 18:27:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

(doomy) #2

I got a similar issue the other day. My fix was because of the rendy merge that I had to specify the backend. For my game, I put this in my amethyst dep: features = ["metal"] as I was on MacOS. I believe in your case it would be "vulkan". I think you can also compile with --features "vulkan" but I haven’t tried that. I have a loose grasp on why this works, but I hoped to get something to you sooner than later so you can continue devving!

If someone more knowledgeable than I would have the time, I am curious how this should be properly handled. Like, can features contain both “vulkan” and “metal” to support both mac and windows? Is there a ~correct~ way to do this?

1 Like
(Martin) #3

--features "vulkan" works in both nightly and stable thanks. That will keep me going then; presumably rendy development will sort out the details soon.

(Marco Alka) #4

I also had this problem (see GitHub), and I am very positive that a lot more people will come up with it, because it is not intuitive to add extra parameters when running something. Also, the error we is very bad, because it does not help finding the problem at all, but looks like something went wrong when searching for a graphics card. Here’s what I propose:

  1. Set a sane default rendering path, for example OpenGL
  2. If no rendering API is selected, fail early and literally tell the user that they have to select one via feature-gate
(Théo Degioanni) #5

It should be reasonable to have the build script choose a good default target depending on the target. We no longer have a “good everywhere” target as OpenGL is no longe supported (temporarily). But the build script could check if a feature flag has been set, if not use Metal on Apple targets or Vulkan everywhere else.

1 Like
(Timon) #6

copy paste code

Copy the below in your Cargo.toml

vulkan | Any other platform then MacOS

amethyst = {  git = "https://github.com/amethyst/amethyst.git", branch = "master", features = ["vulkan"]}

metal | MacOS

amethyst = {  git = "https://github.com/amethyst/amethyst.git", branch = "master", features = ["metal"]}
1 Like
(doomy) #7

Nice! Is there a way to set features based on compilation target? Or is that something that must be done via a script?

(Martin) #8

Note:

  1. This needs the nightly toolchain.
  2. The API has changed.

So you will need to make some code changes from what works in stable.