Images aren't properly loading

Hey y’all. I’m not exactly sure what’s going on here, but I was using the pokedex example to base my code off of, and the image of the pokemon in it wasn’t loading - it was just a black box. I figured it was some issue with the API it used, so I went ahead with my program, and sure enough, I’m having the same problem. The images in my program are obviously loaded into the program, the size seems to be correct, and testing with a differently sized image displays it with the proper size, but it just isn’t displaying the actual image contents.

My source code is at SadlyNotSappho/ggg: a shitty gui rust app to read a webcomic i like - this is a rewrite of my github repo of this over at https://github.com/SadlyNotSappho/ggg - ggg - Forgejo: Beyond coding. We forge., and here’s a screenshot of the problem:

If anyone knows how to fix this, help would be greatly appreciated.

So I just ran it on my laptop to see what would happen, and the images display fine. The only differences between my laptop and desktop are that on my laptop, I’m using KDE with BSPWM as the window manager, and on my desktop, I use pure BSPWM. I really don’t know why it doesn’t work on my desktop, but it doesn’t, so that’s fun.

We are aware of this issue and we have always assumed it’s a graphics driver problem.

Your desktop may not fully support Vulkan. Make sure to update its graphics driver.

Now, it is possible for this to be a bug in the atlas allocator logic; but we haven’t been able to find anything wrong there yet.

Alright. I ran a pretty big update on my desktop a bit after making the post, and havent been able to check if it works yet.

Same problem here

In iced repo:

cargo r --package pokedex

My system info

inxi --full --admin --filter --width

System:
  Kernel: 6.5.5-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64
    root=UUID=d2a55327-f83c-40b1-8b9a-bc1b1919926a rw quiet
    cryptdevice=UUID=4eee9d9f-29e3-4002-95e1-a9b95a5beeff:luks-4eee9d9f-29e3-4002-95e1-a9b95a5beeff
    root=/dev/mapper/luks-4eee9d9f-29e3-4002-95e1-a9b95a5beeff splash
    resume=/dev/mapper/luks-560ef57a-391b-4666-a575-d79d2bd0f88f
    udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.8 tk: Qt v: 5.15.10 wm: kwin_x11 vt: 2 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Strix G614JU_G614JU v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: G614JU v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: G614JU.318 date: 07/28/2023
Battery:
  ID-1: BAT0 charge: 87.3 Wh (100.0%) condition: 87.3/90.0 Wh (97.0%)
    volts: 17.6 min: 16.0 model: AS3GYFG3KC R220358 type: Unknown
    serial: <filter> status: full
CPU:
  Info: model: 13th Gen Intel Core i9-13980HX bits: 64 type: MST AMCP
    arch: Raptor Lake gen: core 13 level: v3 note: check built: 2022+
    process: Intel 7 (10nm) family: 6 model-id: 0xB7 (183) stepping: 1
    microcode: 0x119
  Topology: cpus: 1x cores: 24 mt: 8 tpc: 2 st: 16 threads: 32 smt: enabled
    cache: L1: 2.1 MiB desc: d-16x32 KiB, 8x48 KiB; i-8x32 KiB, 16x64 KiB
    L2: 32 MiB desc: 8x2 MiB, 4x4 MiB L3: 36 MiB desc: 1x36 MiB
  Speed (MHz): avg: 848 high: 1561 min/max: 800/5400:5600:4000 scaling:
    driver: intel_pstate governor: powersave cores: 1: 935 2: 800 3: 800 4: 800
    5: 865 6: 863 7: 800 8: 800 9: 966 10: 1561 11: 990 12: 800 13: 800 14: 800
    15: 964 16: 800 17: 800 18: 800 19: 800 20: 800 21: 800 22: 800 23: 800
    24: 800 25: 800 26: 800 27: 800 28: 800 29: 800 30: 800 31: 800 32: 800
    bogomips: 154880
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS, IBPB: conditional,
    RSB filling, PBRSB-eIBRS: SW sequence
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Raptor Lake-S UHD Graphics vendor: ASUSTeK driver: i915
    v: kernel arch: Gen-13 process: Intel 7 (10nm) built: 2022+ ports:
    active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 0000:00:02.0
    chip-ID: 8086:a788 class-ID: 0300
  Device-2: NVIDIA AD107M [GeForce RTX 4050 Max-Q / Mobile] vendor: ASUSTeK
    driver: nvidia v: 535.113.01 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-09) arch: Lovelace code: AD1xx
    process: TSMC n4 (5nm) built: 2022-23+ bus-ID: 0000:01:00.0
    chip-ID: 10de:28e1 class-ID: 0300
  Device-3: Sonix USB2.0 HD UVC WebCam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-8:3 chip-ID: 322e:2122
    class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.2.1
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris gpu: i915 display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1680x1050 s-dpi: 96 s-size: 444x277mm (17.48x10.91")
    s-diag: 523mm (20.6")
  Monitor-1: eDP-1 model: TL160ADMP03-0 built: 2022 res: 1680x1050 hz: 60
    dpi: 124 gamma: 1.2 size: 345x215mm (13.58x8.46") diag: 407mm (16")
    ratio: 16:10 modes: 2560x1600
  API: EGL v: 1.5 hw: drv: intel iris drv: nvidia platforms: device: 0
    drv: nvidia device: 1 drv: iris device: 3 drv: swrast surfaceless:
    drv: nvidia x11: drv: iris inactive: gbm,wayland,device-2
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa v: 23.1.8-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel Graphics (RPL-S)
    device-ID: 8086:a788 memory: 22.55 GiB unified: yes
  API: Vulkan v: 1.3.264 layers: 12 device: 0 type: integrated-gpu
    name: Intel Graphics (RPL-S) driver: mesa intel v: 23.1.8-manjaro1.1
    device-ID: 8086:a788 surfaces: xcb,xlib device: 1 type: discrete-gpu
    name: NVIDIA GeForce RTX 4050 Laptop GPU driver: nvidia v: 535.113.01
    device-ID: 10de:28e1 surfaces: xcb,xlib
Audio:
  Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel
    alternate: snd_sof_pci_intel_tgl bus-ID: 0000:00:1f.3 chip-ID: 8086:7a50
    class-ID: 0403
  Device-2: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 0000:01:00.1 chip-ID: 10de:22be class-ID: 0403
  API: ALSA v: k6.5.5-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 0.3.80 status: off with: pipewire-media-session
    status: active tools: pw-cat,pw-cli
  Server-3: PulseAudio v: 16.1 status: active with: 1: pulseaudio-alsa
    type: plugin 2: pulseaudio-jack type: module tools: pacat,pactl
Network:
  Device-1: Intel driver: iwlwifi v: kernel port: N/A bus-ID: 0000:00:14.3
    chip-ID: 8086:7a70 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel port: 4000 bus-ID: 0000:6c:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp108s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s
    lanes: 1 mode: 1.1 bus-ID: 1-14:4 chip-ID: 8087:0033 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
RAID:
  Hardware-1: Intel Volume Management Device NVMe RAID Controller Intel
    driver: vmd v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:a77f rev:
    class-ID: 0104
Drives:
  Local Storage: total: 953.87 GiB used: 192.25 GiB (20.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 2400 MTFDKBA1T0QFM
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: V3MA003 temp: 41.9 C
    scheme: GPT
Partition:
  ID-1: / raw-size: 936.8 GiB size: 921.02 GiB (98.32%)
    used: 192.21 GiB (20.9%) fs: ext4 dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-4eee9d9f-29e3-4002-95e1-a9b95a5beeff
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 37.6 MiB (12.5%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: partition size: 16.77 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/dm-1 maj-min: 254:1
    mapped: luks-560ef57a-391b-4666-a575-d79d2bd0f88f
Sensors:
  System Temperatures: cpu: 37.0 C mobo: N/A
  Fan Speeds (rpm): cpu: 2500
Info:
  Processes: 515 Uptime: 52m wakeups: 3 Memory: total: 24 GiB note: est.
  available: 23.1 GiB used: 3.98 GiB (17.2%) Init: systemd v: 254
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6
  Packages: 1487 pm: pacman pkgs: 1454 libs: 391 tools: pamac pm: flatpak
  pkgs: 33 Shell: Zsh v: 5.9 default: Bash v: 5.1.16 running-in: konsole
  inxi: 3.3.30

The example works fine with WGPU_BACKEND=vulkan cargo r --package pokedex

what backend was it using by default?

How can i know that ?

On Linux it’s very likely gl. But to be sure you can include and enable tracing-subscriberin the application and then set RUST_LOG to info and check if either Vulkan or OpenGL is used.

Problem solved in the current stable kernel i am running 6.7.6

System info
System:
  Kernel: 6.7.6-060706-generic arch: x86_64 bits: 64 compiler: N/A
    clocksource: tsc available: acpi_pm
    parameters: BOOT_IMAGE=/vmlinuz-6.7.6-060706-generic
    root=/dev/mapper/ubuntu--vg-ubuntu--lv ro quiet splash vt.handoff=7
  Desktop: GNOME v: 45.2 tk: GTK v: 3.24.38 wm: gnome-shell dm: GDM3
    v: 45.beta Distro: Ubuntu 23.10 (Mantic Minotaur)
Machine:
  Type: Laptop System: ASUSTeK product: ROG Strix G614JU_G614JU v: 1.0
    serial: <filter>
  Mobo: ASUSTeK model: G614JU v: 1.0 serial: <filter> UEFI: American
    Megatrends LLC. v: G614JU.321 date: 10/24/2023
Battery:
  ID-1: BAT0 charge: 84.9 Wh (100.0%) condition: 84.9/90.0 Wh (94.3%)
    volts: 17.3 min: 16.0 model: AS3GYFG3KC R220358 type: Unknown
    serial: <filter> status: full
CPU:
  Info: model: 13th Gen Intel Core i9-13980HX socket: U3E1 bits: 64
    type: MST AMCP arch: Raptor Lake gen: core 13 level: v3 note: check
    built: 2022+ process: Intel 7 (10nm) family: 6 model-id: 0xB7 (183)
    stepping: 1 microcode: 0x11D
  Topology: cpus: 1x cores: 24 mt: 8 tpc: 2 st: 16 threads: 32 smt: enabled
    cache: L1: 2.1 MiB desc: d-16x32 KiB, 8x48 KiB; i-8x32 KiB, 16x64 KiB
    L2: 32 MiB desc: 8x2 MiB, 4x4 MiB L3: 36 MiB desc: 1x36 MiB
  Speed (MHz): avg: 829 high: 980 min/max: 800/5400:5600:4000
    base/boost: 5346/8500 scaling: driver: intel_pstate governor: powersave
    volts: 1.4 V ext-clock: 100 MHz cores: 1: 800 2: 800 3: 960 4: 800 5: 800
    6: 800 7: 800 8: 800 9: 800 10: 800 11: 980 12: 800 13: 910 14: 800
    15: 895 16: 800 17: 800 18: 953 19: 800 20: 800 21: 800 22: 800 23: 800
    24: 800 25: 800 26: 800 27: 896 28: 939 29: 800 30: 800 31: 800 32: 800
    bogomips: 154828
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS, IBPB:
    conditional, RSB filling, PBRSB-eIBRS: SW sequence
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Raptor Lake-S UHD Graphics vendor: ASUSTeK driver: i915
    v: kernel arch: Gen-13 process: Intel 7 (10nm) built: 2022+ ports:
    active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 0000:00:02.0
    chip-ID: 8086:a788 class-ID: 0300
  Device-2: NVIDIA AD107M [GeForce RTX 4050 Max-Q / Mobile]
    vendor: ASUSTeK GN21-X2 driver: nvidia v: 545.29.06
    alternate: nvidiafb,nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-08) arch: Lovelace code: AD1xx
    process: TSMC n4 (5nm) built: 2022-23+ ports: active: none
    empty: DP-3,HDMI-A-3,eDP-2 bus-ID: 0000:01:00.0 chip-ID: 10de:28e1
    class-ID: 0300
  Device-3: Sonix USB2.0 HD UVC WebCam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-8:4 chip-ID: 322e:2122
    class-ID: 0e02
  Display: server: X.Org v: 1.23.2 with: Xwayland v: 23.2.0
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    unloaded: fbdev,nouveau,vesa dri: iris gpu: i915 display-ID: :1 screens: 1
  Screen-1: 0 s-res: 1440x900 s-dpi: 96 s-size: 381x238mm (15.00x9.37")
    s-diag: 449mm (17.69")
  Monitor-1: eDP-1 model: TL160ADMP03-0 built: 2022 res: 1440x900 hz: 240
    dpi: 105 gamma: 1.2 size: 350x220mm (13.78x8.66") diag: 407mm (16")
    ratio: 16:10 modes: 2560x1600
  API: OpenGL v: 4.6 Mesa 23.2.1-1ubuntu3.1 renderer: Mesa Intel Graphics
    (RPL-S) direct-render: Yes
Audio:
  Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel
    alternate: snd_sof_pci_intel_tgl bus-ID: 0000:00:1f.3 chip-ID: 8086:7a50
    class-ID: 0403
  Device-2: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 0000:01:00.1 chip-ID: 10de:22be class-ID: 0403
  API: ALSA v: k6.7.6-060706-generic status: kernel-api
    tools: alsactl,alsamixer,amixer
  Server-1: PipeWire v: 0.3.79 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin tools: pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel driver: iwlwifi v: kernel port: N/A bus-ID: 0000:00:14.3
    chip-ID: 8086:7a70 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel port: 4000 bus-ID: 0000:6c:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp108s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s
    lanes: 1 mode: 1.1 bus-ID: 1-14:5 chip-ID: 8087:0033 class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 0 state: down
    bt-service: enabled,running rfk-block: hardware: no software: yes
    address: <filter>
  Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch sniff
    link-mode: peripheral accept
RAID:
  Hardware-1: Intel Volume Management Device NVMe RAID Controller Intel
    driver: vmd v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:a77f rev:
    class-ID: 0104
Drives:
  Local Storage: total: 953.87 GiB used: 177.78 GiB (18.6%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 2400 MTFDKBA1T0QFM
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: V3MA003 temp: 43.9 C
    scheme: GPT
Partition:
  ID-1: / raw-size: 950.8 GiB size: 934.8 GiB (98.32%)
    used: 177.12 GiB (18.9%) fs: ext4 block-size: 4096 B dev: /dev/dm-1
    maj-min: 252:1 mapped: ubuntu--vg-ubuntu--lv
  ID-2: /boot raw-size: 2 GiB size: 1.9 GiB (95.01%) used: 662.8 MiB (34.1%)
    fs: ext4 block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-3: /boot/efi raw-size: 1.05 GiB size: 1.05 GiB (99.80%)
    used: 6.1 MiB (0.6%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1
    maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: file size: 8 GiB used: 512 KiB (0.0%) priority: -2
    file: /swap.img
Sensors:
  System Temperatures: cpu: N/A mobo: N/A
  Fan Speeds (rpm): cpu: 1900
Info:
  Processes: 565 Uptime: 10h 6m wakeups: 4 Memory: total: 32 GiB note: est.
  available: 30.97 GiB used: 7.76 GiB (25.1%) igpu: 64 MiB Init: systemd
  v: 253 target: graphical (5) default: graphical tool: systemctl Compilers:
  gcc: 13.2.0 alt: 12/13 clang: 16.0.6 Packages: 2477 pm: dpkg pkgs: 2444
  libs: 1456 tools: apt,apt-get pm: flatpak pkgs: 24 pm: snap pkgs: 9
  Shell: Sudo (sudo) v: 1.9.14p2 default: Bash v: 5.2.15
  running-in: gnome-terminal inxi: 3.3.29

cargo r --package pokedex

I think this was probably fixed by this PR:

1 Like