nowrep / obs-vkcapture

OBS Linux Vulkan/OpenGL game capture
GNU General Public License v2.0
508 stars 25 forks source link

OBS-vkcapture does not capture CS:GO running on dGPU (iGPU works) #152

Closed keybangz closed 1 year ago

keybangz commented 1 year ago

As described in the title, CS:GO recording with obs-vkcapture in fullscreen mode works perfectly, although my iGPU gives poor performance so I force the game to run under my dGPU.

Compositor: Wayland

Specs: image

OBS running under my iGPU

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/locale/en-GB.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-GB.ini
info: Using preferred locale 'en-GB'
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Using EGL/X11
info: CPU Name: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
info: CPU Speed: 2634.154MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15676MB Total, 2831MB Free
info: Kernel Version: Linux 6.3.5-arch1-1
info: Distribution: ArcoLinux Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.23.1
info: Qt Version: 6.5.1 (runtime), 6.5.1 (compiled)
info: Portable mode: false
info: OBS 29.1.1-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
    max buffering:   960 milliseconds
    buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter Intel Mesa Intel(R) Xe Graphics (TGL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.1, shading language 4.60
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: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
warning: Failed to load 'en-GB' text for module: 'frontend-tools.so'
warning: Failed to load 'en-GB' text for module: 'linux-alsa.so'
warning: Failed to load 'en-GB' text for module: 'linux-capture.so'
warning: Failed to load 'en-GB' text for module: 'linux-jack.so'
warning: Failed to load 'en-GB' text for module: 'linux-pipewire.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: Failed to load 'en-GB' text for module: 'linux-pulseaudio.so'
warning: v4l2loopback not installed, virtual camera disabled
warning: Failed to load 'en-GB' text for module: 'linux-vkcapture.so'
info: [linux-vkcapture] plugin loaded successfully (version 1.3.3)
info: NVENC supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
info: FFmpeg VAAPI H264 encoding not supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
info: FFmpeg VAAPI HEVC encoding not supported
warning: Failed to load 'en-GB' text for module: 'obs-libfdk.so'
warning: Failed to load 'en-GB' text for module: 'obs-vst.so'
warning: Failed to load 'en-GB' text for module: 'rtmp-services.so'
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Game Capture' (vkcapture-source)
info: ------------------------------------------------
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: [linux-vkcapture] Client 1 connected (pid=32729)
info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:72057594037927944
info: [linux-vkcapture]  [0] fd:44 stride:7680 offset:0
info: [linux-vkcapture]  [1] fd:45 stride:960 offset:8388608
info: [linux-vkcapture]  [2] fd:46 stride:64 offset:8421376

image

CSGO is selected in OBS & utilizes the right resolution for the game capture, just does not show.

OBS running through prime-run (uses dGPU)

prime-run obs
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/locale/en-GB.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-GB.ini
info: Using preferred locale 'en-GB'
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Using EGL/X11
info: CPU Name: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
info: CPU Speed: 4300.000MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15676MB Total, 1322MB Free
info: Kernel Version: Linux 6.3.5-arch1-1
info: Distribution: ArcoLinux Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.23.1
info: Qt Version: 6.5.1 (runtime), 6.5.1 (compiled)
info: Portable mode: false
info: OBS 29.1.1-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
    max buffering:   960 milliseconds
    buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter Intel Mesa Intel(R) Xe Graphics (TGL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.1, shading language 4.60
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: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
warning: Failed to load 'en-GB' text for module: 'frontend-tools.so'
warning: Failed to load 'en-GB' text for module: 'linux-alsa.so'
warning: Failed to load 'en-GB' text for module: 'linux-capture.so'
warning: Failed to load 'en-GB' text for module: 'linux-jack.so'
warning: Failed to load 'en-GB' text for module: 'linux-pipewire.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: Failed to load 'en-GB' text for module: 'linux-pulseaudio.so'
warning: v4l2loopback not installed, virtual camera disabled
warning: Failed to load 'en-GB' text for module: 'linux-vkcapture.so'
info: [linux-vkcapture] plugin loaded successfully (version 1.3.3)
info: NVENC supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
info: FFmpeg VAAPI H264 encoding not supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
info: FFmpeg VAAPI HEVC encoding not supported
warning: Failed to load 'en-GB' text for module: 'obs-libfdk.so'
warning: Failed to load 'en-GB' text for module: 'obs-vst.so'
warning: Failed to load 'en-GB' text for module: 'rtmp-services.so'
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Game Capture' (vkcapture-source)
info: ------------------------------------------------
info: [linux-vkcapture] Client 1 connected (pid=32729)
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: adding 21 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)

info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:72057594037927944
info: [linux-vkcapture]  [0] fd:42 stride:7680 offset:0
info: [linux-vkcapture]  [1] fd:43 stride:960 offset:8388608
info: [linux-vkcapture]  [2] fd:44 stride:64 offset:8421376

image

Same thing applies when running OBS on my DGPU, consistent when running OBS with DRI_PRIME=1 too.

Kernel parameters: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=494a4c72-384c-4380-a2a8-a9cb1f8fa2dd rw quiet loglevel=3 audit=0 nvme_load=yes nvidia-drm.modeset=1

CSGO Launch Options: obs-vkcapture __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%

EDIT: Flatpak Steam & Native OBS installed. (With Capture Tools)

Please note using my old AMD (Ryzen 5 5600x + RX6600 8GB) setup OBS-vkcapture worked perfectly.

Any help would be appreciated, thanking you.

keybangz commented 1 year ago

image

Running OBS on iGPU and vkcube with obs-vkcapture is working fine, maybe just a CS:GO issue?

nowrep commented 1 year ago

Both logs you sent are using Intel GPU. Is CS:GO using OpenGL? Can you try eglgears_x11?

keybangz commented 1 year ago

Both logs you sent are using Intel GPU. Is CS:GO using OpenGL? Can you try eglgears_x11?

CSGO is using OpenGL, using -vulkan option does not change anything.

eglgears_x11 works fine.

Didn't read the too much when posting, my bad, using any type of "forcing" it to run on my dGPU still outputs its running on my iGPU but I mean if it works for games I imagine it's just reporting the wrong GPU?

Please excuse my lack of replying quick, I work 12 hours a day don't have much time to get things sorted.

Logs from eglgears_x11

prime-run obs
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/locale/en-GB.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-GB.ini
info: Using preferred locale 'en-GB'
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Using EGL/X11
info: CPU Name: 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
info: CPU Speed: 3713.895MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15676MB Total, 2023MB Free
info: Kernel Version: Linux 6.3.5-arch1-1
info: Distribution: ArcoLinux Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.23.1
info: Qt Version: 6.5.1 (runtime), 6.5.1 (compiled)
info: Portable mode: false
info: OBS 29.1.1-2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
    max buffering:   960 milliseconds
    buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter Intel Mesa Intel(R) Xe Graphics (TGL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.1, shading language 4.60
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: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
warning: Failed to load 'en-GB' text for module: 'frontend-tools.so'
warning: Failed to load 'en-GB' text for module: 'linux-alsa.so'
warning: Failed to load 'en-GB' text for module: 'linux-capture.so'
warning: Failed to load 'en-GB' text for module: 'linux-jack.so'
warning: Failed to load 'en-GB' text for module: 'linux-pipewire.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: Failed to load 'en-GB' text for module: 'linux-pulseaudio.so'
warning: v4l2loopback not installed, virtual camera disabled
warning: Failed to load 'en-GB' text for module: 'linux-vkcapture.so'
info: [linux-vkcapture] plugin loaded successfully (version 1.3.3)
info: NVENC supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
info: FFmpeg VAAPI H264 encoding not supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
info: FFmpeg VAAPI HEVC encoding not supported
warning: Failed to load 'en-GB' text for module: 'obs-libfdk.so'
warning: Failed to load 'en-GB' text for module: 'obs-vst.so'
warning: Failed to load 'en-GB' text for module: 'rtmp-services.so'
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.71) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: [window-capture: 'CSGO (Xcom)'] update settings:
    title: Counter-Strike: Global Offensive - OpenGL
    class: csgo_linux64

info: PipeWire initialized
info: Switched to scene 'Replay Clips'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Replay Clips':
info:     - source: 'CSGO (Xcom)' (xcomposite_input)
info:     - source: 'CSGO (Pipe)' (pipewire-window-capture-source)
info:     - source: 'Game Capture' (vkcapture-source)
info: ------------------------------------------------
info: [linux-vkcapture] Client 1 connected (pid=33408)
info: [pipewire] Screencast session created
info: [pipewire] Asking for window
info: [linux-vkcapture] Client 2 connected (pid=34127)
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:72057594037927944
info: [linux-vkcapture]  [0] fd:46 stride:7680 offset:0
info: [linux-vkcapture]  [1] fd:47 stride:960 offset:8388608
info: [linux-vkcapture]  [2] fd:48 stride:64 offset:8421376
warning: [pipewire] Failed to start screencast, denied or cancelled by user
info: [linux-vkcapture] Creating texture from dmabuf 300x300 modifier:72057594037927938
info: [linux-vkcapture]  [0] fd:46 stride:1536 offset:0

image

nowrep commented 1 year ago

If you are trying to capture OpenGL game on proprietary nvidia driver, it won't work. See #42