GyulyVGC/sniffnet

Sniffnet crashes when screen color depth is set below 24 bit

TyseEX opened this issue · 14 comments

TyseEX commented

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

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?

TyseEX commented

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

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.

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

TyseEX commented

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 :)

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

TyseEX commented

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...

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

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

Interesting, thanks @i-amgeek

Something like this: env ICED_BACKEND=wgpu sniffnet?

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

TyseEX commented

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...

Hey @TyseEX a new Sniffnet version was released the past month.

When you have some time, I'd like to get an update to know whether your problem was fixed.
If you can pleas try running the app trying with both values for the environment variable again.

Thanks in advance.

Hi @GyulyVGC! There are still no changes with 16-bit color space.

WGPU can't find my graphics adapter...

Error: GraphicsCreationFailed(List([GraphicsAdapterNotFound { backend: "wgpu", reason: RequestFailed("the surface is not compatible") }, GraphicsAdapterNotFound { backend: "tiny-skia", reason: DidNotMatch { preferred_backend: "wgpu" } }]))

Vulkan can't find too...

Error: GraphicsCreationFailed(List([GraphicsAdapterNotFound { backend: "wgpu", reason: DidNotMatch { preferred_backend: "vulkan" } }, GraphicsAdapterNotFound { backend: "tiny-skia", reason: DidNotMatch { preferred_backend: "vulkan" } }]))

And Tiny-Skia can't see softbuffer:

thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_tiny_skia-0.13.0/src/window/compositor.rs:68: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

Full Rust backtrace says this:

stack backtrace:
   0:     0x56abd5a36af9 - <unknown>
   1:     0x56abd5393183 - <unknown>
   2:     0x56abd5a01302 - <unknown>
   3:     0x56abd5a3bf32 - <unknown>
   4:     0x56abd5a3bc7b - <unknown>
   5:     0x56abd5a3b9cf - <unknown>
   6:     0x56abd58df001 - <unknown>
   7:     0x56abd5a3c1f9 - <unknown>
   8:     0x56abd5a3c008 - <unknown>
   9:     0x56abd5a3bf69 - <unknown>
  10:     0x56abd5a3bf5c - <unknown>
  11:     0x56abd52510ff - <unknown>
  12:     0x56abd52514d5 - <unknown>
  13:     0x56abd52b25ba - <unknown>
  14:     0x56abd52bb9da - <unknown>
  15:     0x56abd52bc676 - <unknown>
  16:     0x56abd59d987a - <unknown>
  17:     0x56abd595a42a - <unknown>
  18:     0x56abd52b99f4 - <unknown>
  19:     0x56abd58dcb86 - <unknown>
  20:     0x56abd52ce386 - <unknown>
  21:     0x56abd58da40e - <unknown>
  22:     0x744ace5a6488 - <unknown>
  23:     0x744ace5a654c - __libc_start_main
  24:     0x56abd52a70d5 - <unknown>
  25:                0x0 - <unknown>

I think launching Sniffnet with 16-bit color depth would be possible if I were using nvidia-open driver, or using a Radeon GPU. Probably Radeon graphics card would be noticed in WGPU mode, but I can't check it now...