-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Running example on WSL: Error: GraphicsAdapterNotFound #1232
Comments
What about the other examples? Could you try setting the iced/examples/clock/src/main.rs Line 9 in c157015
|
Tried a few other examples like geometry, pick_list - it's the same. With |
Thanks for trying it out. Could you maybe try setting the environment variable |
All the options gave the same error except vulkan:
Same story with antialiasing true and false. |
is this WSLv1 or WSLv2 and do you have CPU virtualization enabled? |
v2. |
Could you provide a backtrace? I really think the issue here is either environment dependent or Did you try the |
Apparently WSL2 doesn't have good Graphics support yet. Microsoft themself tell you to use Mesa to render things with WSL. They had talked about DX and Vulkan support in 2020 but from what I understand not much has been done about it yet. So try to use Mesa and see if that works for you. Also there is more about this issue here: gfx-rs/wgpu#1443 |
I can't seem to figure out how to do it -
Works equally fine
Ah it turns out that I have already installed VcXsrv so it seems that I am already using Mesa (?), and I don't have the same issue as linked. |
yeah then it is possible your driver doesn't support all the needed features on WSL2. You could try getting the DirectX driver for WSL2 and see if that works OR get the openGL driver for it. |
same issue under ubuntu cargo run --features "iced/glow iced/glow_canvas" --package game_of_life cargo run --package game_of_life I USE VIRTUAL MACHINE(VMWARE) TO RUN UBUNTU , |
It would be nice to know if this will run directly on your windows OS or not and not inside of a VM. As this could help determine if your GPU is getting passed onto the VM and WSL. I will look into this more hopefully it is just something else. though from the error messages it seems the VM was indeed not getting your Graphics Driver. |
Reading a guide that says
Indeed in my WSL, the device Furthermore, seeing how wgpu examples work but not iced: Is there thus a feature that Iced uses that wgpu does not? As far as I have seen so far it doesn't really seem like I should have to install more drivers since wgpu works. |
yes it is possible the Driver going to your WSL does not support a specific Feature. Though this is why i want you to attempt to run an iced example on your windows Directly to see if maybe your GPU itself doesn't have the feature and it not being WSL fault to begin with. If it does not work on your main windows at all then we have a major feature issue. If it does work and just not on WSL then it means the DX/OpenGL/Vulkan driver does not yet support a specific feature. The only things i am seeing that could be a issue might be. iced/wgpu/src/window/compositor.rs Line 35 in adce9e0
this can cause certain drivers to not get chosen if they don't meet the power plan. generally High power all the way unless on laptops or mobile devices. As this is used to choose the correct GPU Low power means the GPU is a on the processor type. High power is PCIe GPU's. If this is set to low power and you have a PCIe GPU it wont select it. Personally i Think WGPU needs to add one more power option called Adaptable which starts with high power and then checks low power if no high exist. https://github.com/iced-rs/iced/blob/master/wgpu/src/settings.rs#L76 that could cause issues maybe should use the built in one or let WGPU decide this itself. https://github.com/iced-rs/iced/blob/master/wgpu/src/settings.rs#L67 Rather than all maybe need to set this as Primary with on fail go to Secondary. But secondary is not fully supported on all systems etc . Primary covers the rest and should be able to let WGPU decide which one it can support. https://github.com/iced-rs/iced/blob/master/wgpu/src/window/compositor.rs#L64 they are not enabling any special features so other then maybe WSL not supporting the default Stuff or one of the above making it not find the GPU adapter is the issue. I think it might be low vs high power settings causing this issue. could try enabling or disabling anti aliases to see. to see if that solves the GPU adapter not found issue. If not then it could be their Selection method not working correctly. |
yeah I forgot the default limits are not set for older devices and sometimes wont also work well for web too. Since the texture max dimensions etc matter a lot of older hardware. It would be nice to be able to add a discovery function that could see what the current devices limits are and then choose between regular and downgraded defaults. |
I pull latest code, issue still exists for some example, |
@genusistimelord additional information are: |
thank you, so you are attempting to run GPU apps in Ubuntu thru a VM. Well not really sure how well that is going to work for things that need direct GPU access as normally that right is reserved for the Host machine. Could you try to run these Examples on the main Host machine and not on the VM? You can try the command lspci and see if you can find your GPU mentioned in there. @skydig https://www.intel.com/content/www/us/en/support/articles/000005520/graphics.html you can try running the command they give there to find it too. also try disabling Anti-aliasing for the solar example as you are also using a low powered GPU https://github.com/iced-rs/iced/blob/master/examples/solar_system/src/main.rs#L19 Disabling it should allow it to search for low powered Devices. This issue is due to Anti-aliasing requiring high powered device which it shouldn't. it is found here as to what it does when enabled or disabled. iced/wgpu/src/window/compositor.rs Line 38 in adce9e0
|
lspci -k|grep -EA3 'VGA|3D|DISPLAY' sudo lshw -c video You are right, after disable anti-aliasing, solar_system can be started. |
@genusistimelord cargo run --features "iced/glow iced/glow_canvas" --package tour |
yeah this tells me that the VM does not see your GPU at all. Also the trait issue is another issue altogether. @hecrj |
@skydig Can you try running my branch PR to see if this solves some of your issues as well automatically? https://github.com/genusistimelord/iced/tree/WGPU_Power_Limits |
@hecrj With this in Cargo.toml iced = { git = "https://github.com/hecrj/iced.git"}
iced_native = {git = "https://github.com/hecrj/iced.git"}
iced_graphics = {git = "https://github.com/hecrj/iced.git"}
iced_wgpu = {git = "https://github.com/hecrj/iced.git"} got a ton of errors, this is some of them: https://bpa.st/QU6Q I also did |
do you have resolver = "2" in your cargo.toml underneath package? Also try to avoid using Master atm till he gets the pure widgets done. However in this moment i see he asked you to try it so it might just be a resolver issue. also give cargo clean a try as sometimes cargo update does not always work correctly for some things. |
@genusistimelord |
can you do a lldb walk thru and start it at https://github.com/genusistimelord/iced/blob/ac3e477bb34fb804cdacc1b02023a6315b156e43/wgpu/src/window/compositor.rs#L35 and see what part it is failing on exactly? |
Oh oops, I forgot that I was just supposed to try to run the example anyway. But thanks your suggestion indeed worked. Anyway, when running the |
@Ploppz I sent you a email to your gmail. Also yeah id like to see if you have discord or telegram or something so i can directly help you so we can diagnose the issue faster that way it can get fixed. |
So yeah After running a few tests with Ploppz I have verified that the issue indeed does stem from WGPU itself and in fact that it does not properly handle Software based wrappers that link back to the main OS for GPU usage. This causes the Limits to not be truthful for the GPU and causes it to not render correctly as well. This is due to it seeing the GPU as an internal or low powered GPU before it see's it as a software based GPU. As in things like WSL it can still See the GPU just cant get Direct Access to the GPU. |
Is there an existing issue for this?
Is this issue related to iced?
What happened?
When running the
clock
example in WSL with WSLg installed (graphics support for WSL), the example exits withError: GraphicsAdapterNotFound
.Note that the
xclock
command runs fine in the same terminal.I found that in the
wgpu
repo,cd wgpu ; cargo run --example cube
works fine also. So it seems to be an iced issue.What is the expected behavior?
It should work without error
Version
master
Operative System
Windows
Do you have any log output?
No response
The text was updated successfully, but these errors were encountered: