ublue-os / bluefin

The next generation Linux workstation, designed for reliability, performance, and sustainability.
https://projectbluefin.io
Apache License 2.0
1.26k stars 162 forks source link

Nvidia VA-API issues on Optimus Laptop #1581

Open onxzy opened 3 months ago

onxzy commented 3 months ago

Describe the bug

I am trying to get hardware acceleration on my Laptop but I never see any process in the output of nvidia-smi. To start I'm trying on Firefox with some video from Youtube.

What did you expect to happen?

See some process in the output of nvidia-smi

Output of rpm-ostree status

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/aurora-nvidia:stable
                   Digest: sha256:f15637029615cf74931bff1c5dbd9403ec9ea59c7b749b0c1517f04b141d96d7
                  Version: 40.20240807.0 (2024-08-07T14:15:57Z)
             InitramfsEtc: /etc/vconsole.conf

  ostree-image-signed:docker://ghcr.io/ublue-os/aurora-nvidia:stable
                   Digest: sha256:121752f194aa0c6b16393e6e690f1ced73cb62bbfe351277f3d576e77f97e173
                  Version: 40.20240807.0 (2024-08-07T14:15:57Z)
             InitramfsEtc: /etc/vconsole.conf

Output of groups

thomas wheel

Extra information or context

I followed the steps here : https://universal-blue.discourse.group/t/codecs-and-multimedia-support/314 I ran ujust configure-nvidia and ujust configure-nvidia-optimus and I've set the media.ffmpeg.vaapi.enabled flag to true in Firefox. I have rebooted multiple times.

I also ran the CUDA test from ujust configure-nvidia to check that my GPU what working, and the driver seems to be installed correctly as neither nvidia-smi nor nvidia-settings complained.

$ nvidia-smi
Thu Aug  8 14:07:31 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.58.02              Driver Version: 555.58.02      CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| 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 RTX 3050 ...    On  |   00000000:01:00.0 Off |                  N/A |
| N/A   51C    P8              8W /   60W |       1MiB /   4096MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

$ ujust configure-nvidia
Configuring Nvidia drivers
What would you like to do?
[Vector addition of 50000 elements]
Copy input data from the host memory to the CUDA device
CUDA kernel launch with 196 blocks of 256 threads
Copy output data from the CUDA device to the host memory
Test PASSED
Done

On the about:support tab I see only references to my Intel GPU and the vainfo command shows that my Intel iGPU is used and not my Nvidia GPU:

$ vainfo
Trying display: wayland
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.5 ()
vainfo: Supported profile and entrypoints

I am using the default Firefox flatpak. My flatpak runtimes list :

$ flatpak list --runtime
Name                                            Application ID                                         Version                           Branch               Installation
Freedesktop Platform                            org.freedesktop.Platform                               freedesktop-sdk-23.08.21          23.08                system
Mesa                                            org.freedesktop.Platform.GL.default                    24.1.3                            23.08                system
Mesa (Extra)                                    org.freedesktop.Platform.GL.default                    24.1.3                            23.08-extra          system
nvidia-555-58-02                                org.freedesktop.Platform.GL.nvidia-555-58-02                                             1.4                  system
Intel                                           org.freedesktop.Platform.VAAPI.Intel                                                     23.08                system
ffmpeg-full                                     org.freedesktop.Platform.ffmpeg-full                                                     23.08                system
openh264                                        org.freedesktop.Platform.openh264                      2.1.0                             2.2.0                system
openh264                                        org.freedesktop.Platform.openh264                      2.4.1                             2.4.1                system
GNOME Application Platform version 45           org.gnome.Platform                                                                       45                   system
GNOME Application Platform version 46           org.gnome.Platform                                                                       46                   system
Adwaita theme                                   org.kde.KStyle.Adwaita                                                                   5.15-23.08           system
Adwaita theme                                   org.kde.KStyle.Adwaita                                                                   6.6                  system
Adwaita theme                                   org.kde.KStyle.Adwaita                                                                   6.7                  system
KDE Application Platform                        org.kde.Platform                                                                         5.15-23.08           system
KDE Application Platform                        org.kde.Platform                                                                         6.6                  system
KDE Application Platform                        org.kde.Platform                                                                         6.7                  system

But it looks like Firefox is not using the ffmpeg runtime I installed using the tutorial linked above.

$ flatpak info org.mozilla.firefox | grep Runtime
      Runtime: org.freedesktop.Platform/x86_64/23.08

I tried forcing it but I get the following result :

$ flatpak run --runtime=org.freedesktop.Platform.ffmpeg-full --branch=stable --arch=x86_64 --command=firefox org.mozilla.firefox
bwrap: execvp firefox: No such file or directory

I am sorry if I just missed something very trivial.

Device info :

castrojo commented 2 weeks ago

Team is investigating vaapi issues in general currently so unstaling this.