Skip to content
New issue

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

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

Already on GitHub? # to your account

Sniffnet crashes when screen color depth is set below 24 bit #589

Open
1 task done
TyseEX opened this issue Aug 15, 2024 · 12 comments
Open
1 task done

Sniffnet crashes when screen color depth is set below 24 bit #589

TyseEX opened this issue Aug 15, 2024 · 12 comments
Labels
Linux Something related to Linux operating system renderer Problem related to the renderer used by the GUI library

Comments

@TyseEX
Copy link

TyseEX commented Aug 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

What's the problem?

I installed Sniffnet on Manjaro Linux from pacman repos and when I tried to launch it, nothing happened.
Then I reinstalled package, but nothing changed. I tried to run Sniffnet in a terminal and got this:

thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_tiny_skia-0.12.1/src/window/compositor.rs:56:10:
Create softbuffer surface for window: PlatformError(Some("Visual 0x21 does not use softbuffer's pixel format and is unsupported"), None)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After trying nvidia-xconfig --depth=24 Sniffnet launched normally.
Is there any way to use Sniffnet with 16-bit color depth?

How did you install the app?

downloaded one of the provided packages

Operating System

Linux

Additional context

No response

@GyulyVGC
Copy link
Owner

Hi @TyseEX,
the GUI library in use by Sniffnet supports choosing different graphical renderers at runtime via the environment variable ICED_BACKEND.
By default, wgpu is used, but in your case it appears that it's trying to use tiny-skia.
Can you try to set this environment variable to either of these two values and see if it works?

@GyulyVGC GyulyVGC added bug Something isn't working Linux Something related to Linux operating system renderer Problem related to the renderer used by the GUI library and removed bug Something isn't working labels Aug 15, 2024
@TyseEX
Copy link
Author

TyseEX commented Aug 15, 2024

Something like this: env ICED_BACKEND=wgpu sniffnet?
изображение

@GyulyVGC
Copy link
Owner

Ok, so the problem is that your graphical adapter doesn't support wgpu and the app is falling back to use tiny-skia.
This issue cannot be solved with the tiny-skia renderer since it appears to be an intrinsic limitation of it.
A possible strategy to solve this would be to try to understand why wgpu isn't working, but if your graphical adapter is up to date, I think there isn't much we can do.

@GyulyVGC
Copy link
Owner

I think reading this can be of help for your use case: iced-rs/iced#1898

@TyseEX
Copy link
Author

TyseEX commented Aug 15, 2024

I think it may be a solution, but WGPU_BACKEND=vulkan doesn't work and gives the same issue.
A guy, that solved it with nvidia-dkms probably used a driver that was installed from a package. I installed driver from Nvidia official website and my system didn't had any packages except for nvidia-dkms.
The most interesting thing about this is that my package has version 550.107.02-1, when the repositories already have version 555.58.02-15.
pacman -Syu still can't detect version 555, which means I'll probably have to remove the current driver and install a new one from the repositories.
Maybe then the environment variables will work fine, but I need time to check it. Anyway, thanks for helping me solve my problem :)

@GyulyVGC
Copy link
Owner

No problem!
Let me know when you have some news.

@TyseEX
Copy link
Author

TyseEX commented Aug 15, 2024

Unfortunately, removing the driver and installing it from the repositories did not help in any way. Even the Nvidia package that lies in the repositories is defined as Nvidia-utils, and when you try to install it through pacman -U, it looks for the "Nvidia" package as a dependency, which it itself should be.
Nvidia-dkms from repositories also doesn't help. Probably, this problem is definitely not in the drivers, and it's worth waiting for some solutions from the developers of Iced...

@GyulyVGC
Copy link
Owner

Yeah... in the meantime I hope it's not a big problem for you to use it with depth 24.

@i-amgeek
Copy link

ICED_BACKEND=tiny-skia sniffnet worked for me in resolving this issue.

@GyulyVGC
Copy link
Owner

Interesting, thanks @i-amgeek

@GyulyVGC
Copy link
Owner

Something like this: env ICED_BACKEND=wgpu sniffnet?

@TyseEX could you try setting it to tiny-skia as suggested by @i-amgeek?

@TyseEX
Copy link
Author

TyseEX commented Sep 14, 2024

Something like this: env ICED_BACKEND=wgpu sniffnet?

@TyseEX could you try setting it to tiny-skia as suggested by @i-amgeek?

I sold my old GPU and today I bought GTX 1060, but issue didn't gone. Setting backend to tiny-skia craches Sniffnet with the same message:

thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_tiny_skia-0.12.1/src/window/compositor.rs:56:10:
Create softbuffer surface for window: PlatformError(Some("Visual 0x21 does not use softbuffer's pixel format and is unsupported"), None)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

wgpu also says GraphicsAdapterNotFound...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Linux Something related to Linux operating system renderer Problem related to the renderer used by the GUI library
Projects
None yet
Development

No branches or pull requests

3 participants