Getting Vcube to run on Nvidia dGPU on a workstation with additional Intel iGPU

My final plan is to get FFmpeg with Vulkan hwaccel video transcoding working. A first step is to get Vcube working on the Nvidia dGPU using switcherooctl. This is an older dual GPU/SkyLake based workstation rebuild with a MSI Z-170A mobo with default Intel HD 530 iGPU, where Vcube runs out the box on the latter.

And as I think I Nvidia did work on an earlier openSUSE distro, my guess is that this may be a current driver issue on Slowroll.

Beside I have experimented with the BIOS PEG Multimonitor setup to force the PCIe Nvidia dGPU as default, which caused just another practical issue with output port to monitor.

As I have re-installed packages back and from during troubleshooting, the following setup and outputs were at some stage(s) and not the last one, just as background information:

inxi -G
Graphics:
  Device-1: Intel HD Graphics 530 driver: i915 v: kernel
  Device-2: NVIDIA GM206 [GeForce GTX 960] driver: nvidia v: 390.157
  Display: unspecified server: X.org v: 1.21.1.21 with: Xwayland v: 24.1.8
    driver: gpu: i915 resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6 vendor: intel mesa v: 25.3.1 renderer: Mesa Intel HD
    Graphics 530 (SKL GT2)
  API: Vulkan v: 1.4.335 drivers: intel,llvmpipe surfaces: N/A
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
  Info: Tools: api: glxinfo,vulkaninfo gpu: nvidia-settings,nvidia-smi
    x11: xprop,xrandr
ls /etc/modprobe.d
50-yast.conf

cat /etc/modprobe.d/50-yast.conf

vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu

switcherooctl list
Device: 0
  Name:        Intel® HD Graphics 530
  Default:     yes
  Discrete:    no
  Environment: DRI_PRIME=pci-0000_00_02_0 VK_LOADER_DRIVERS_SELECT=*intel*

Device: 1
  Name:        NVIDIA Corporation GM206 [GeForce GTX 960]
  Default:     no
  Discrete:    yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=*nvidia*


switcherooctl launch -g 1 vkcube
Selected WSI platform: wayland
vkEnumeratePhysicalDevices reported zero accessible devices.

Do you have a compatible Vulkan installable client driver (ICD) installed?
Please look at the Getting Started guide for additional information.

switcherooctl launch -g 0 vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu

switcherooctl launch -g 2 vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu

lspci | grep -E 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)

ls /usr/share/vulkan/icd.d/
intel_hasvk_icd.i686.json    intel_icd.i686.json    lvp_icd.x86_64.json
intel_hasvk_icd.x86_64.json  intel_icd.x86_64.json  nvidia_icd.x86_64.json

===============

switcherooctl list
Device: 0
  Name:        NVIDIA Corporation GM206 [GeForce GTX 960]
  Default:     yes
  Discrete:    yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=*nvidia*

Device: 1
  Name:        Intel® HD Graphics 530
  Default:     no
  Discrete:    no
  Environment: DRI_PRIME=pci-0000_00_02_0 VK_LOADER_DRIVERS_SELECT=*intel*


still vkcube is running automatic on Intel iGPU

vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu

Nvidia doesn't work:

switcherooctl launch -g 0 vkcube
Selected WSI platform: wayland
vkEnumeratePhysicalDevices reported zero accessible devices.

Do you have a compatible Vulkan installable client driver (ICD) installed?
Please look at the Getting Started guide for additional information.

Intel iGPU works:

switcherooctl launch -g 1 vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu


1 Like

Is there a reason why you use the (kind of wrong) v390 aka G04 driver for this card? The GTX 960 / GTX 960 Mobile needs the v580 aka G06 drivers.

2 Likes

@terjejh you don’t show all the info as need the Nvidia GPU PCI ID’s…

Add a /etc/environment and add to that file MESA_VK_DEVICE_SELECT="xxxx:nnnn" where xxxx:nnnn corresponds with the Nvidia GPU PCI ID.

1 Like

Not a selection I remember I did. By the way, this is output from my last “(re)installation” after I installed kernel-longterm, but seemingly no Nvidia drivers yet (N/A). I also thougt to try suse-prime in case swicherooctl doesn’t work in this case. Sorry for (too much) diffusing output…:

nvidia-smi
Failed to initialize NVML: Driver/library version mismatch
NVML library version: 580.119
zypper se -is kernel-
i+ | kernel-default                         | package    | 6.18.2-1.0.4.1                | x86_64 | openSUSE-Slowroll-Update

zypper rm kernel-default

zypper in -f kernel-longterm

Reboot

uname -r
6.12.63-1.0.4.sr20251204-longterm
  Remove existing drivers:
    Clear out potentially conflicting NVIDIA packages:
    
zypper rm "nvidia-*" "libnvidia-*"


Nvidia non-free for tw is still there 

zypper lr -u

1 | NVIDIA:repo-non-free                   | repo-non-free           | Ja      | (r ) Ja   | Ja      | https://download.nvidia.com/opensuse/tumbleweed

Reinstall the Drivers:
Use the automated installer to find the correct match for your kernel:

zypper install-new-recommends
Oppdaterer tjenesten 'NVIDIA'.
Oppdaterer tjenesten 'openSUSE'.
Laster pakkebrønndata...
Leser installerte pakker...
Kontrollerer pakkeavhengigheter...

The following 15 NEW packages are going to be installed:
  kernel-longterm-6.12.41-1.0.4.1.sr20250801 libnvidia-egl-gbm1 libnvidia-egl-wayland1 libnvidia-egl-x111 libnvidia-gpucomp nvidia-common-G06 nvidia-compute-G06
  nvidia-compute-utils-G06 nvidia-gl-G06 nvidia-modprobe nvidia-open-driver-G06-signed-kmp-longterm nvidia-persistenced nvidia-userspace-meta-G06
  nvidia-video-G06 ovpn-dco-kmp-longterm

The following package requires a system reboot:
  kernel-longterm-6.12.41-1.0.4.1.sr20250801

......

Leter etter filkonflikter: ...........................................................................................................................[fullført]
( 1/15) Installerer: libnvidia-egl-gbm1-1.1.2-7.17.x86_64 ............................................................................................[fullført]
( 2/15) Installerer: libnvidia-egl-x111-1.0.3-21.5.x86_64 ............................................................................................[fullført]
( 3/15) Installerer: libnvidia-gpucomp-580.82.07-39.1.x86_64 .........................................................................................[fullført]
( 4/15) Installerer: nvidia-modprobe-580.119.02-21.1.x86_64 ..........................................................................................[fullført]
( 5/15) Installerer: nvidia-persistenced-580.119.02-2.1.x86_64 .......................................................................................[fullført]
( 6/15) Installerer: nvidia-common-G06-580.82.07-39.1.x86_64 .........................................................................................[fullført]
Created symlink '/etc/systemd/system/multi-user.target.wants/nvidia-persistenced.service' -> '/usr/lib/systemd/system/nvidia-persistenced.service'.
( 7/15) Installerer: nvidia-compute-G06-580.82.07-39.1.x86_64 ........................................................................................[fullført]
( 8/15) Installerer: nvidia-compute-utils-G06-580.82.07-39.1.x86_64 ..................................................................................[fullført]
SKIP: /etc/uefi/certs/F8CEAA94.crt is already in the enrollment request
( 9/15) Installerer: kernel-longterm-6.12.41-1.0.4.1.sr20250801.x86_64 ...............................................................................[fullført]
(10/15) Installerer: libnvidia-egl-wayland1-1.1.20-1.1.x86_64 ........................................................................................[fullført]
(11/15) Installerer: ovpn-dco-kmp-longterm-0.2.20241216~git0.a08b2fd_k6.12.41_1.0.4.sr20250801-3.36.4.1.sr20250801.x86_64 ............................[fullført]
(12/15) Installerer: nvidia-open-driver-G06-signed-kmp-longterm-580.82.07_k6.12.46_1-1.2.x86_64 ......................................................[fullført]
(13/15) Installerer: nvidia-gl-G06-580.82.07-39.1.x86_64 .............................................................................................[fullført]
Created symlink '/etc/systemd/system/systemd-hibernate.service.wants/nvidia-hibernate.service' -> '/usr/lib/systemd/system/nvidia-hibernate.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/nvidia-powerd.service' -> '/usr/lib/systemd/system/nvidia-powerd.service'.
Created symlink '/etc/systemd/system/systemd-suspend.service.wants/nvidia-resume.service' -> '/usr/lib/systemd/system/nvidia-resume.service'.
Created symlink '/etc/systemd/system/systemd-hibernate.service.wants/nvidia-resume.service' -> '/usr/lib/systemd/system/nvidia-resume.service'.
Created symlink '/etc/systemd/system/systemd-suspend-then-hibernate.service.wants/nvidia-resume.service' -> '/usr/lib/systemd/system/nvidia-resume.service'.
Created symlink '/etc/systemd/system/systemd-suspend.service.wants/nvidia-suspend.service' -> '/usr/lib/systemd/system/nvidia-suspend.service'.
(14/15) Installerer: nvidia-video-G06-580.82.07-39.1.x86_64 ..........................................................................................[fullført]
(15/15) Installerer: nvidia-userspace-meta-G06-580.82.07-12.1.noarch .................................................................................[fullført]
Kjører ettertransaksjon skript .....................................

-----------


Adds nvidia-settings

zypper in nvidia-settings
....

Leter etter filkonflikter: ........................................................................................[fullført]
(1/2) Installerer: nvidia-libXNVCtrl-580.119.02-49.1.x86_64 .......................................................[fullført]
(2/2) Installerer: nvidia-settings-580.119.02-49.1.x86_64 .........................................................[fullført]
Kjører ettertransaksjon skript ......................


zypper se -is nvidia-
Laster pakkebrønndata...
Leser installerte pakker...

S  | Name                                       | Type  | Version                  | Arch   | Repository
---+--------------------------------------------+-------+--------------------------+--------+----------------------
i  | libnvidia-egl-gbm1                         | pakke | 1.1.2-7.17               | x86_64 | repo-non-free
i  | libnvidia-egl-wayland1                     | pakke | 1.1.20-1.1               | x86_64 | update-slowroll
i  | libnvidia-egl-wayland1                     | pakke | 1.1.20-1.1               | x86_64 | Hovedpakkebrønn (OSS)
i  | libnvidia-egl-wayland1                     | pakke | 1.1.20-1.1               | x86_64 | repo-oss
i  | libnvidia-egl-x111                         | pakke | 1.0.3-21.5               | x86_64 | repo-non-free
i  | libnvidia-gpucomp                          | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
i  | nvidia-common-G06                          | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
i  | nvidia-compute-G06                         | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
i  | nvidia-compute-utils-G06                   | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
i  | nvidia-gl-G06                              | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
i  | nvidia-libXNVCtrl                          | pakke | 580.119.02-49.1          | x86_64 | repo-non-free
i  | nvidia-modprobe                            | pakke | 580.119.02-21.1          | x86_64 | repo-non-free
i  | nvidia-open-driver-G06-signed-kmp-longterm | pakke | 580.82.07_k6.12.46_1-1.2 | x86_64 | update-slowroll
i  | nvidia-persistenced                        | pakke | 580.119.02-2.1           | x86_64 | repo-non-free
i+ | nvidia-settings                            | pakke | 580.119.02-49.1          | x86_64 | repo-non-free
i  | nvidia-userspace-meta-G06                  | pakke | 580.82.07-12.1           | noarch | repo-non-free
i  | nvidia-userspace-meta-G06                  | pakke | 580.82.07-12.1           | noarch | repo-non-free
i  | nvidia-video-G06                           | pakke | 580.82.07-39.1           | x86_64 | repo-non-free
---------------


# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

# inxi -G
Graphics:
  Device-1: Intel HD Graphics 530 driver: i915 v: kernel
  Device-2: NVIDIA GM206 [GeForce GTX 960] driver: N/A

# lsmod | grep nvidia


Synes ikke som om Nvidia drivere er lastet inn og aktivert


zypper install-new-recommends --repo NVIDIA

zypper in x11-video-nvidiaG06 nvidia-gl-G06

zypper in suse-prime

prime-select nvidia

1 Like

Your card does not support the open driver (Maxwell architecture). You need to install the correct kmp package.

That one is wrong:
nvidia-open-driver-G06-signed-kmp-longterm

You need the normal kmp. Either
nvidia-driver-G06-kmp-default
or
nvidia-driver-G06-kmp-longterm

Do NOT use suse-prime. It is deprecated and switcheroctl is the successor.

2 Likes

I happen to have the GeForce GTX960M (slightly different dev ID but still Maxwell architecture), so as a reference:

bruno@LT-B:~> cat /etc/environment
MESA_VK_DEVICE_SELECT="10de:139b!"
bruno@LT-B:~> vkcube
Selected WSI platform: wayland
MESA-INTEL: warning: Haswell Vulkan support is incomplete
Selected GPU 0: NVIDIA GeForce GTX 960M, type: DiscreteGpu
^C
bruno@LT-B:~> zypper se -si nvidia
Loading repository data...
Reading installed packages...

S  | Name                             | Type    | Version                   | Arch   | Repository
---+----------------------------------+---------+---------------------------+--------+--------------
i+ | libnvidia-egl-gbm1               | package | 1.1.2-7.17                | x86_64 | repo-non-free
i+ | libnvidia-egl-wayland1           | package | 1.1.20-52.3               | x86_64 | repo-non-free
i+ | libnvidia-egl-x111               | package | 1.0.3-21.5                | x86_64 | repo-non-free
i+ | libnvidia-gpucomp                | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | nvidia-common-G06                | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | nvidia-compute-G06               | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | nvidia-compute-utils-G06         | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | nvidia-driver-G06-kmp-default    | package | 580.119.02_k6.18.0_1-43.1 | x86_64 | repo-non-free
i+ | nvidia-driver-G06-kmp-meta       | package | 580.119.02-26.1           | x86_64 | repo-non-free
i+ | nvidia-gl-G06                    | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | nvidia-libXNVCtrl                | package | 580.119.02-49.1           | x86_64 | repo-non-free
i+ | nvidia-modprobe                  | package | 580.119.02-21.1           | x86_64 | repo-non-free
i+ | nvidia-persistenced              | package | 580.119.02-2.1            | x86_64 | repo-non-free
i+ | nvidia-settings                  | package | 580.119.02-49.1           | x86_64 | repo-non-free
i+ | nvidia-userspace-meta-G06        | package | 580.119.02-26.1           | x86_64 | repo-non-free
i+ | nvidia-video-G06                 | package | 580.119.02-43.1           | x86_64 | repo-non-free
i+ | openSUSE-repos-Tumbleweed-NVIDIA | package | 20250728.9adc675-1.1      | x86_64 | repo-oss
bruno@LT-B:~>

Please be aware that I have the -default kernel installed and that you have to adjust for the correct device ID in /etc/environment.

1 Like

@huy
Thank you for discovering and pointing on the wrong driver.
I force installed the correct driver

zypper in -f nvidia-driver-G06-kmp-longterm

rebooted and now it looks ok

inxi -Ga
Graphics:
  Device-1: Intel HD Graphics 530 vendor: Micro-Star MSI driver: i915
    v: kernel arch: Gen-9 process: Intel 14n built: 2015-16 ports:
    active: HDMI-A-2 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-3 bus-ID: 00:02.0
    chip-ID: 8086:1912 class-ID: 0300
  Device-2: NVIDIA GM206 [GeForce GTX 960] vendor: Micro-Star MSI
    driver: nvidia v: 580.119.02 alternate: nouveau,nvidia_drm
    non-free: 550-580.xx+ status: current (as of 2025-11; EOL~2026-12-xx)
    arch: Maxwell code: GMxxx process: TSMC 28nm built: 2014-2019 pcie: gen: 1
    speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s ports:
    active: none empty: DP-3, DP-4, DP-5, DVI-I-1, HDMI-A-4 bus-ID: 01:00.0
    chip-ID: 10de:1401 class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.21 with: Xwayland v: 24.1.8
    compositor: gnome-shell v: 49.2 driver: gpu: i915 display-ID: 0
  Monitor-1: HDMI-A-2 model: Philips 244E serial: DL11047733014 built: 2010
    res: 1920x1080 dpi: 92 gamma: 1.2 size: 531x299mm (20.91x11.77")
    diag: 609mm (24") ratio: 16:9 modes: max: 1920x1080 min: 720x400
  API: OpenGL v: 4.6 vendor: intel mesa v: 25.3.1 glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: Mesa Intel HD Graphics 530 (SKL GT2)
    device-ID: 8086:1912 memory: 61.22 GiB unified: yes display-ID: :0.0
  API: Vulkan v: 1.4.335 layers: 3 device: 0 type: integrated-gpu name: Intel
    HD Graphics 530 (SKL GT2) driver: mesa intel v: 25.3.1
    device-ID: 8086:1912 surfaces: N/A device: 1 type: discrete-gpu
    name: NVIDIA GeForce GTX 960 driver: nvidia v: 580.119.02
    device-ID: 10de:1401 surfaces: N/A device: 2 type: cpu name: llvmpipe
    (LLVM 21.1.7 256 bits) driver: mesa llvmpipe v: 25.3.1 (LLVM 21.1.7)
    device-ID: 10005:0000 surfaces: N/A
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
  Info: Tools: api: glxinfo,vulkaninfo gpu: nvidia-settings,nvidia-smi
    x11: xprop,xrandr
    
nvidia-smi
Mon Jan  5 18:34:44 2026       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.119.02             Driver Version: 580.119.02     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 960         On  |   00000000:01:00.0 Off |                  N/A |
| 30%   27C    P8             14W /  120W |      23MiB /   2048MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            2557      G   /usr/bin/gnome-shell                      0MiB |
|    0   N/A  N/A            4618    C+G   /usr/bin/nautilus                        16MiB |
+-----------------------------------------------------------------------------------------+

lsmod | grep nvidia
nvidia_drm            143360  3
nvidia_modeset       1933312  4 nvidia_drm
nvidia_uvm           3850240  0
drm_ttm_helper         16384  1 nvidia_drm
nvidia              111591424  44 nvidia_uvm,nvidia_modeset
video                  81920  2 i915,nvidia_modeset


switcherooctl list
Device: 0
  Name:        Intel® HD Graphics 530
  Default:     yes
  Discrete:    no
  Environment: DRI_PRIME=pci-0000_00_02_0 VK_LOADER_DRIVERS_SELECT=*intel*

Device: 1
  Name:        NVIDIA Corporation GM206 [GeForce GTX 960]
  Default:     no
  Discrete:    yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=*nvidia*

And Vkcube runs fine on both Nvidida sGPU and on Intel iGPU :slight_smile:

vkcube
Selected WSI platform: wayland
Selected GPU 1: NVIDIA GeForce GTX 960, type: DiscreteGpu
^C

switcherooctl launch -g 0 vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu
^C
1 Like

@malcolmlewis
I created the environment file with the content

cat environment
MESA_VK_DEVICE_SELECT="10de:1401"

Vkcube ran before it was created, so I wonder what is the purpose of this file and what is it really used for?

vulkaninfo --summary | egrep -i "intel|nvidia"
VK_LAYER_NV_optimus         NVIDIA Optimus layer         1.4.312  version 1
VK_LAYER_NV_present         NVIDIA GR2608 layer          1.4.312  version 1
	deviceName         = NVIDIA GeForce GTX 960
	driverID           = DRIVER_ID_NVIDIA_PROPRIETARY
	driverName         = NVIDIA
	deviceName         = Intel(R) HD Graphics 530 (SKL GT2)
	driverID           = DRIVER_ID_INTEL_OPEN_SOURCE_MESA
	driverName         = Intel open-source Mesa driver

Currently I have BIOS set to PEG Multimonitor (PCIe Nvidia dGPU) and have to use the Nvidia DVI(-HDMI) port to get BIOS and Grub2-efi menu displayed.
More practical I want to switch back BIOS setup to Integrated Grapchic IGP as default and use the MSI mobo DP(-HDMI), if Nvidia dGPU still can be accessed via switcherooctl?

switcherooctl list
Device: 0
  Name:        Intel® HD Graphics 530
  Default:     yes
  Discrete:    no
  Environment: DRI_PRIME=pci-0000_00_02_0 VK_LOADER_DRIVERS_SELECT=*intel*

Device: 1
  Name:        NVIDIA Corporation GM206 [GeForce GTX 960]
  Default:     no
  Discrete:    yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=*nvidia*


vkcube 
Selected WSI platform: wayland
Selected GPU 1: NVIDIA GeForce GTX 960, type: DiscreteGpu
^C

switcherooctl launch -g 0 vkcube
Selected WSI platform: wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu
^C

switcherooctl launch -g 1 vkcube
Selected WSI platform: wayland
Selected GPU 0: NVIDIA GeForce GTX 960, type: DiscreteGpu
^C

switcherooctl launch -g 2 vkcube
Selected WSI platform: wayland
Selected GPU 1: NVIDIA GeForce GTX 960, type: DiscreteGpu
^C

As seen above, Vkcube works default on Nvidia and on Intel as device 0, but why does it also run on Nvidia as device 2 etc.?

1 Like

While running Vkcube confirms which gpu it runs on, Nvidia or Intel, I wonder if and how it is possible to get this verified when running ffmpeg next?

1 Like

@terjejh If you look at your previous output from inxi, the Intel GPU is default, have a look with that environment variable and the Nvidia gpu will be default.

For other applications, if you install the likes of nvtop you can see which processes are using which GPU etc. I would expect if ffmpeg in use has NVENC enabled it will use…

1 Like

Please see vulkan-mesa-device-select.

1 Like

and MESA_VK_DEVICE_SELECT=list vulkaninfo

1 Like

With Vkcube and switcherooctl working on each Intel iGPU and Nvidia dGPU, I’ve continued with my initial and final task to get FFmpeg with Vulkan hwaccel to work for transcoding a short mpeg2video to h264.mp4.

This post and url is used as a reference example:

FFmpeg Vulkan commands are of the structure:
ffmpeg -init_hw_device "vulkan=vk:1" -hwaccel vulkan -hwaccel_output_format vulkan ....

To find the correct index of the GPU (vk:0, vk:1 ), I applied the following command:

ffmpeg -hide_banner -v verbose -init_hw_device "vulkan"
[Vulkan @ 0x562a48d46b80] Supported layers:
[Vulkan @ 0x562a48d46b80] 	VK_LAYER_MESA_device_select
[Vulkan @ 0x562a48d46b80] 	VK_LAYER_NV_optimus
[Vulkan @ 0x562a48d46b80] 	VK_LAYER_NV_present
[Vulkan @ 0x562a48d46b80] GPU listing:
[Vulkan @ 0x562a48d46b80]     0: NVIDIA GeForce GTX 960 (discrete) (0x1401)
[Vulkan @ 0x562a48d46b80]     1: Intel(R) HD Graphics 530 (SKL GT2) (integrated) (0x1912)
[Vulkan @ 0x562a48d46b80]     2: llvmpipe (LLVM 21.1.7, 256 bits) (software) (0x0)
[Vulkan @ 0x562a48d46b80] Device 0 selected: NVIDIA GeForce GTX 960 (discrete) (0x1401)

Environment variable for Intel ANV (vk:1)
export ANV_DEBUG="video-decode,video-encode"

ffmpeg -hide_banner -init_hw_device "vulkan=vk:1" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv1080i50.m2t -vf "format=nv12,hwupload" -c:v h264_vulkan -profile:v main -y hdv1080i50_h264_main_vulkan_nv12_vk1.mp4
.......
frame=  123 fps=0.0 q=-0.0 Lsize=   19983KiB time=00:00:05.30 bitrate=30863.5kbits/s speed=14.6x elapsed=0:00:00.36  

However, using corresponding for Nvidia (vk:0) conversion fails:

ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv1080i50.m2t -vf "format=nv12,hwupload" -c:v h264_vulkan -profile:v main -y hdv1080i50_h264_main_vulkan_nv12_vk0.mp4
...........
[h264_vulkan @ 0x563b685fd200] Device does not support the VK_KHR_video_encode_queue extension!
.......
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.04    
[aac @ 0x563b685e5780] Qavg: 175.195
Conversion failed!

Is some specific export environment variable required also for Nvidia ?
I could not find that switcherooctl either was useful for ffmpeg hwaccel.

Beside I tested that the ffmpeg code worked also on my Dell XPS13-9370 ultrabook w/ Intel HD620 iGPU.
And disappointing, conversion fails on my most powerful Alder Lake workstation with Arch 750 (DG2) dGPU:

[h264_vulkan @ 0x55c6ede10380] Unable to perform query: VK_ERROR_DEVICE_LOST!psed=0:00:07.00    
[h264_vulkan @ 0x55c6ede10380] Output failed: -542398533.
[vost#0:0/h264_vulkan @ 0x55c6ede0ed80] [enc:h264_vulkan @ 0x55c6eddba640] Error submitting video frame to the encoder
[vost#0:0/h264_vulkan @ 0x55c6ede0ed80] [enc:h264_vulkan @ 0x55c6eddba640] Error encoding a frame: Generic error in an external library
[vost#0:0/h264_vulkan @ 0x55c6ede0ed80] Task finished with error code: -542398533 (Generic error in an external library)
[vost#0:0/h264_vulkan @ 0x55c6ede0ed80] Terminating thread with return code -542398533 (Generic error in an external library)
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[hwupload @ 0x7f4314004580] Failed to upload frame: -542398533.
[vf#0:0 @ 0x55c6ede4a780] Error while filtering: Generic error in an external library
[vf#0:0 @ 0x55c6ede4a780] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 0x55c6ede4a780] Terminating thread with return code -542398533 (Generic error in an external library)
[out#0/mp4 @ 0x55c6eddb5140] video:0KiB audio:21KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 5.062934%
frame=    0 fps=0.0 q=0.0 Lsize=      22KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:07.27    
[aac @ 0x55c6ede4bec0] Qavg: 181.433
Conversion failed!

1 Like

Can you provide a link to a test file? From where is the ffmpeg from?

1 Like
Informasjon for pakke ffmpeg-8:
-------------------------------
Pakkebrønn           : Packman
Navn                 : ffmpeg-8
Versjon              : 8.0-1699.4.pm.26
Arkitektur           : x86_64
Leverandør           : http://packman.links2linux.de
Installert størrelse : 2,8 MiB
Installert           : Ja
Status               : oppdatert
Kildepakke           : ffmpeg-8-8.0-1699.4.pm.26.src
Upstream URL         : https://ffmpeg.org/
Sammendrag           : Set of libraries for working with various multimedia formats
Beskrivelse          : 
    FFmpeg is a multimedia framework, able to decode, encode,
    transcode, mux, demux, stream, filter and play several formats
    that humans and machines have created.

I’ll try to upload my own recorded “hdv1080i50.m2t” test file

ffprobe -hide_banner hdv1080i50.m2t
Input #0, mpegts, from 'hdv1080i50.m2t':
  Duration: 00:00:05.32, start: 1.400000, bitrate: 24535 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn, start 1.840000
    Side data:
      cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A
  Stream #0:1[0x101]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s, start 1.400000

1 Like

Link to test file “hdv1080i50.m2t”

1 Like

Regarding the issue on Alder Lake/DG2, I have submitted a bug report to mesa

1 Like

@terjejh I’d be intersted to see the outputs from vulkaninfo | grep VK_KHR_video from your gpu’s. On my A380 is see av1 and vp9, on the RTX4000 I see h264, h265 and vp9.

I also don’t use packman, but I do see compute used with vp9 on Nvidia.

export ANV_VIDEO_DECODE="1"
export ANV_DEBUG="video-decode,video-encode"

ffmpeg -init_hw_device "vulkan=vk:0" -hwaccel vulkan \
       -hwaccel_output_format vulkan -i hdv1080i50.m2t \
       -c:v vp9 hdv1080i50_vp9.mp4

-rw-r--r-- 1 user user  16M Jan  6 18:02 hdv1080i50.m2t
-rw-r--r-- 1 user user 1.3M Jan  6 20:42 hdv1080i50_vp9.mp4

You may need to compile your own ffmpeg since there are errors with external libraries…

1 Like

@terjejh you might also want to look at QSVEnc for the Intel ARC system…

1 Like

I compiled ffmpeg, but it errored out on “-profile:v main -y”

Very quick… 0.45 of a second!

 ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" \
       -hwaccel vulkan -hwaccel_output_format vulkan \
       -i hdv1080i50.m2t -vf "format=nv12,hwupload" -c:v h264_vulkan \
       -y hdv1080i50_h264_main_vulkan_nv12_vk1.mp4
Input #0, mpegts, from 'hdv1080i50.m2t':
  Duration: 00:00:05.32, start: 1.400000, bitrate: 24535 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn, start 1.840000
    Side data:
      cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A
  Stream #0:1[0x101]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s, start 1.400000
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_vulkan))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_vulkan @ 0x55f475ebfcc0] No rate control settings specified, using fixed QP = 18
Output #0, mp4, to 'hdv1080i50_h264_main_vulkan_nv12_vk1.mp4':
  Metadata:
    encoder         : Lavf62.3.100
  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), vulkan(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn
    Metadata:
      encoder         : Lavc62.11.100 h264_vulkan
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc62.11.100 aac
[out#0/mp4 @ 0x55f475ebeb80] video:19608KiB audio:83KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.024787%
frame=  123 fps=0.0 q=-0.0 Lsize=   19696KiB time=00:00:05.30 bitrate=30420.7kbits/s speed=11.8x elapsed=0:00:00.45
 ffprobe -hide_banner hdv1080i50_h264_main_vulkan_nv12_vk1.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv1080i50_h264_main_vulkan_nv12_vk1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf62.3.100
  Duration: 00:00:05.36, start: 0.000000, bitrate: 30102 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1440x1080 [SAR 4:3 DAR 16:9], 32648 kb/s, 25 fps, 25 tbr, 12800 tbn, start 0.440000 (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc62.11.100 h264_vulkan
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
1 Like