workspaces-issues icon indicating copy to clipboard operation
workspaces-issues copied to clipboard

[Bug] - GPU acceleration not working properly for Brave and OBS (and possibly more apps)

Open EpicLPer opened this issue 2 years ago • 0 comments

This was originally asked on Reddit but I figured it might be better to post this here: https://www.reddit.com/r/kasmweb/comments/16djn4f/gpu_acceleration_doesnt_seem_to_work_for_apps_but/

Existing Resources

  • [X] Please search the existing issues for related problems
  • [X] Consult the product documentation : Docs
  • [X] Consult the FAQ : FAQ
  • [X] Consult the Troubleshooting Guide : Guide
  • [X] Reviewed existing training videos: Youtube

Describe the bug

I just installed a dedicated GPU for my Debian install into my server and tried to use the GPU inside the Ubuntu Focal workspace.
Everything seems to work, as example both nvidia-smi and glxheads show and use NVidia as the GPU, but things like Brave or OBS aren't able to detect it for some reason.

Running the following commands produces the following errors:
Brave: Doesn't start, only shows below error message. Without vglrun it starts, but of course without any acceleration, this aquarium test also doesn't work and shows "No WebGL support". /opt/VirtualGL/bin/vglrun -d "${KASM_EGL_CARD}" /opt/brave.com/brave/brave "\$@"

ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libvglfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
[3340:3340:0908/211846.514449:FATAL:zygote_host_impl_linux.cc(202)] Check failed: . : Operation not permitted (1)
[0908/211846.524933:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0908/211846.525050:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Trace/breakpoint trap
[3362:3362:0100/000000.543640:ERROR:zygote_linux.cc(661)] write: Broken pipe (32)

OBS: Starts and seems to detect the NVidia card just fine, adding a Browser source to this aquarium test works too and displays the fish, however going to "Output" only shows Software rendering as an option, not the NVidia card. /opt/VirtualGL/bin/vglrun -d "${KASM_EGL_CARD}" obs

info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation Quadro P2000/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 470.182.03, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
	base resolution:   1920x1080
	output resolution: 1920x1080
	downscale filter:  Bicubic
	fps:               60/1
	format:            NV12
	YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------

Later down the line it shows this for ffmpeg:

error: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory
info: FFmpeg VAAPI H264 encoding not supported
info: FFmpeg VAAPI HEVC encoding not supported

Not sure what I'm doing wrong, everything seems to semi-work fine but with a few hiccups :)

To Reproduce

Steps to reproduce the behavior:

  1. Install GPU into Server + all drivers + NVidia Docker component
  2. Enable GPU in Workspace
  3. Run the above mentioned commands

Expected behavior Brave should start, OBS should find the GPU as an encoder

Screenshots X

Workspaces Version 1.14.0.d9a19b

Workspaces Installation Method Debian 11 Single-Server

Client Browser (please complete the following information):

  • Latest Edge on Windows

Workspace Server Information (please provide the output of the following commands):

  • uname -a: Linux Debian-Docker1 5.10.0-25-amd64 #1 SMP Debian 5.10.191-1 (2023-08-16) x86_64 GNU/Linux
  • cat /etc/os-release:
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
  • sudo docker info:
Client: Docker Engine - Community
 Version:    24.0.6
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.21.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan
  • sudo docker ps | grep kasm:
62bf570a4f5b   ubuntu-focal-desktop-stefan:develop   "/dockerstartup/kasm…"   40 minutes ago   Up 40 minutes         4901/tcp, 5901/tcp, 6901/tcp
  adminkasm.lo_0ac04663
84a3a1aeca41   kasmweb/nginx:1.25.1                  "/docker-entrypoint.…"   2 weeks ago      Up 3 days             80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
  kasm_proxy
65a90598be07   kasmweb/agent:1.14.0                  "/bin/sh -c '/usr/bi…"   2 weeks ago      Up 3 days (healthy)   4444/tcp
  kasm_agent
dc20118a3c83   kasmweb/share:1.14.0                  "/bin/sh -c '/usr/bi…"   2 weeks ago      Up 3 days (healthy)   8182/tcp
  kasm_share
3f735f8302b5   kasmweb/manager:1.14.0                "/bin/sh -c '/usr/bi…"   2 weeks ago      Up 3 days (healthy)   8181/tcp
  kasm_manager
cea348cb11e1   kasmweb/api:1.14.0                    "/bin/sh -c '/usr/bi…"   2 weeks ago      Up 3 days (healthy)   8080/tcp
  kasm_api
d0942a3257ba   postgres:12-alpine                    "docker-entrypoint.s…"   2 weeks ago      Up 3 days (healthy)   5432/tcp
  kasm_db
0a058cae52ed   kasmweb/kasm-guac:1.14.0              "/dockerentrypoint.sh"   2 weeks ago      Up 3 days (healthy)
  kasm_guac
0902ded178aa   redis:5-alpine                        "docker-entrypoint.s…"   2 weeks ago      Up 3 days             6379/tcp
  kasm_redis

Additional context See above.

EpicLPer avatar Sep 12 '23 12:09 EpicLPer