dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Permissions issue when trying to create graphics buffers or allocate resources related to graphics processing

Open nazmulshuvo03 opened this issue 1 year ago • 3 comments

Problem

When I run dx serve --platform desktop I am getting this error:

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
Failed to create GBM buffer of size 800x600: Permission denied
Failed to create EGL images for DMABufs with file descriptors -1, -1 and -1

May be this is OS related problem or GPU. I am not sure. I have given my current user access to /dev/dri. I have added my user to the appropriate groups (video and/or render) to grant it access to the graphics devices with the following commands:

sudo usermod -aG video <username>
sudo usermod -aG render <username>

And offcourse checked and double checked the packages. But noting is working.

Steps To Reproduce

  • Just follow the documentation for desktop platform

Expected behavior

  • Should start the desktop app

Screenshots Selection_004

Environment:

  • Dioxus version: [0.4.3]
  • Rust version: [1.75.0,]
  • OS info: [Kubuntu (22.04)]
  • App platform: [desktop]
  • GPU: [01:00.0 VGA compatible controller: NVIDIA Corporation GK208B [GeForce GT 710] (rev a1)]
  • More information about my gpu:
 *-display
      description: VGA compatible controller
      product: GK208B [GeForce GT 710]
      vendor: NVIDIA Corporation
      physical id: 0
      bus info: pci@0000:01:00.0
      version: a1
      width: 64 bits
      clock: 33MHz
      capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
      configuration: driver=nvidia latency=0
      resources: irq:132 memory:f6000000-f6ffffff memory:e8000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff
 *-graphics
      product: VESA VGA
      physical id: 2
      logical name: /dev/fb0
      capabilities: fb
      configuration: depth=32 resolution=640,480
  • More information about my desktop:
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 6.5.0-17-generic (64-bit)
Graphics Platform: X11
Processors: 6 × Intel® Core™ i5-9400F CPU @ 2.90GHz
Memory: 23.4 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 710/PCIe/SSE2

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [x] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

nazmulshuvo03 avatar Feb 07 '24 15:02 nazmulshuvo03

I have found the following solution from another Github repo, but it looks like a workaround to the problem, not an exact solution. Any further explanation will be very much appreciated.

env WEBKIT_DISABLE_COMPOSITING_MODE=1 dx serve --platform desktop

nazmulshuvo03 avatar Feb 07 '24 15:02 nazmulshuvo03

I ran into this issue trying use webkit2gtk on arch linux (with an nvidia card) and I was able to fix it without setting WEBKIT_DISABLE_DMABUF_RENDERER=1.

Here is how I fixed it:

  1. Check if you have modesetting enabled via

     cat /sys/module/nvidia_drm/parameters/modeset
    
  2. If you see printed N then you need to enable it with

     echo options nvidia_drm modeset=1 | sudo tee /etc/modprobe.d/nvidia_drm.conf
    
  3. Restart your computer

nobane avatar Mar 02 '24 22:03 nobane

Same bug here (same conf as described but with rust 1.77) and modeset already set to Y. Only the workaround with env WEBKIT_DISABLE_COMPOSITING_MODE=1 dx serve --platform desktopworks.

jbousquie avatar Mar 24 '24 14:03 jbousquie

Same problem here:

libEGL warning: egl: failed to create dri2 screen

** (geo-rustic:49891): WARNING **: 05:36:01.641: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.

Failed to get GBM device

using the workaround does indeed work. I'm using KDE Plasma 6.1.1, nvidia 555.52.04, on Wayland.

Operating System: Arch Linux KDE Plasma Version: 6.1.1 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.2 Kernel Version: 6.9.7-zen1-1-zen (64-bit) Graphics Platform: Wayland Graphics Processor: NVIDIA GeForce RTX 3070 Ti

matty-r avatar Jul 03 '24 19:07 matty-r

Unfortunately this is all quite upstream. Seems to be an issue hitting a set of users running linux + nvidia cards.

https://bugs.webkit.org/show_bug.cgi?id=180739 https://github.com/tauri-apps/wry/issues/1252

I'm going to close this and put documenting the workaround on our "document 0.6" milestone.

I also spun out an issue for dx to recognize these issues and give helpful suggestions on fixing them.

https://github.com/DioxusLabs/dioxus/issues/2747

jkelleyrtp avatar Jul 30 '24 20:07 jkelleyrtp