Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimus hardware + latest from git => segfault #71

Closed
MageSlayer opened this issue Apr 6, 2022 · 27 comments
Closed

Optimus hardware + latest from git => segfault #71

MageSlayer opened this issue Apr 6, 2022 · 27 comments

Comments

@MageSlayer
Copy link

Hi

I am trying to start vainfo, but it segfaults.
See log below.

My variables:

denis@devuan-nb:~$ set | grep "NV\|GLX\|LIBVA\|VDPA\|DRI"
DRI_PRIME=1
LIBVA_DRIVER_NAME=nvidia
VDPAU_DRIVER=nvidia
__GLX_VENDOR_LIBRARY_NAME=nvidia
__NV_PRIME_RENDER_OFFLOAD=1

Hardware:

denis@devuan-nb:~$ lspci | grep "VGA\|3D"
00:02.0 VGA compatible controller: Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05)
01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] (rev a1)
denis@devuan-nb:~$ NVD_LOG=1 gdb vainfo
GNU gdb (Debian 10.1-2+b1) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from vainfo...
(No debugging symbols found in vainfo)
(gdb) r
Starting program: /usr/bin/vainfo 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
[New Thread 0x7fffee885640 (LWP 10934)]
libva info: Found init function __vaDriverInit_1_0
[10928-10928] ../src/vabackend.c:1642       __vaDriverInit_1_0 Initialising NVIDIA VA-API Driver: 0x55555556b3d0 10
[10928-10928] ../src/vabackend.c:1645       __vaDriverInit_1_0 Non-DRM display type detected, defaulting to GPU ID 0. Use NVD_GPU to pick a specific GPU.
[10928-10928] ../src/export-buf.c: 164       findGPUIndexFromFd Looking for GPU index: 0
[10928-10928] ../src/export-buf.c: 175       findGPUIndexFromFd Found 4 EGL devices
[10928-10928] ../src/export-buf.c: 184       findGPUIndexFromFd Got EGL_CUDA_DEVICE_NV value '0' for EGLDevice 0
[10928-10928] ../src/export-buf.c: 136 checkModesetParameterFromFd Unable to check nvidia_drm modeset setting
[10928-10928] ../src/export-buf.c: 208       findGPUIndexFromFd Selecting EGLDevice 0
[New Thread 0x7fffed746640 (LWP 10935)]
[New Thread 0x7fffecd81640 (LWP 10936)]
[10928-10928] ../src/export-buf.c: 270             initExporter Driver doesn't support 16-bit surfaces
[10928-10928] ../src/export-buf.c: 103                reconnect Reconnecting to stream
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver

Thread 1 "vainfo" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007ffff7fb9801 in vaToCuCodec (profile=VAProfileMPEG2Simple) at ../src/vabackend.c:261
#2  0x00007ffff7fb9d98 in nvQueryConfigProfiles (ctx=0x55555556b3d0, profile_list=0x555555bff070, num_profiles=0x7fffffffde9c) at ../src/vabackend.c:376
#3  0x00007ffff7e224b5 in vaQueryConfigProfiles () at /usr/lib/x86_64-linux-gnu/libva.so.2
#4  0x00005555555564e3 in  ()
#5  0x00007ffff7c547fd in __libc_start_main (main=
    0x555555556370, argc=1, argv=0x7fffffffdfc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdfb8) at ../csu/libc-start.c:332
#6  0x00005555555568aa in  ()

Any help?

@elFarto
Copy link
Owner

elFarto commented Apr 7, 2022

That's a very odd error, which shouldn't happen unless the compiler didn't build the driver correctly. Did you have any CFLAGS set while building it?

@MageSlayer
Copy link
Author

Nope.

denis@devuan-nb:~$ echo $CFLAGS

@elFarto
Copy link
Owner

elFarto commented Apr 7, 2022

Can you send me the nvidia_drv_video.so binary that the build produced? It seems it somehow missing a critical section of the executable that's needed for it to work.

@rkoot
Copy link

rkoot commented Apr 7, 2022

VA-API 1.10 might be too old?

@MageSlayer
Copy link
Author

nvidia_drv_video.so.gz

@MageSlayer
Copy link
Author

MageSlayer commented Apr 8, 2022

VA-API 1.10 might be too old?

Bingo. After upgrading to libva-dev to 2.14.0-1 it looks much better now.

denis@devuan-nb:~/temp/nvidia-vaapi-driver$ vainfo 
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'nvidia'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      <unknown profile>               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

I guess it's now to check acceleration :)
Perhaps you need to check this version at setup phase?

@MageSlayer
Copy link
Author

Nope.
Still no good.
Firefox 99 still using software video decode - my laptop still produces sounds like a hurricane :)

denis@devuan-nb:~/temp/nvidia-vaapi-driver$ firefox
[GFX1-]: No GPUs detected via PCI
[GFX1-]: glxtest: process failed (received signal 11)

Does this log help somehow?

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

Firefox 99 has a separate issue that's preventing it from working at the moment. You'll need to try FF98 or one of the FF100 nightlies.

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

VA-API 1.10 might be too old?

Bingo. After upgrading to libva-dev to 2.14.0-1 it looks much better now.

Honestly, I'm surprised that was the issue. I can't see any changes to libva between 2.10 (1.10 is the API version, not the release version number) and 2.14 that would cause that sort of issue, which amounts to it failing to load/initialise the executable correctly.

@MageSlayer
Copy link
Author

Firefox 99 has a separate issue that's preventing it from working at the moment. You'll need to try FF98 or one of the FF100 nightlies.

98 was removed from Debian repos and nightly does not work either :(

@MageSlayer
Copy link
Author

Hm.
Perhaps I am doing something wrong, but FF98 also does not use acceleration with my prime configuration.

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

Are you starting firefox with MOZ_DISABLE_RDD_SANDBOX=1 set? Either way, start Firefox with the follow variables and post the log file: NVD_LOG=1 MOZ_LOG="PlatformDecoderModule:5,Dmabuf:5" firefox.

@MageSlayer
Copy link
Author

MageSlayer commented Apr 8, 2022

Are you starting firefox with MOZ_DISABLE_RDD_SANDBOX=1 set?

Nope. But enabling it for FF98 makes no difference.
ff.log.gz

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

Ok, it seems you're missing a bunch of the Firefox config options that are in the README (media.ffmpeg.vaapi.enabled, etc...), set those, restart Firefox and try again.

@MageSlayer
Copy link
Author

Hm.
It was a clear issue with that. However even after I disabled autoupdate which messed it, rechecked those settings, I can't still get low processor usage. Youtube video are still consume more that 1 core at a time.

Could you check my log again?
ff.log.gz

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

EGL isn't enabled, ensure that gfx.x11-egl.force-enabled is set to true (you'll need to restart FF on setting that).

@MageSlayer
Copy link
Author

FF98-1

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

Can you paste the output of about:support, there's a Copy text to clipboard button at the top.

@MageSlayer
Copy link
Author

  <h2 xmlns="http://www.w3.org/1999/xhtml" class="major-section" id="app-basics" data-l10n-id="app-basics-title">Application Basics</h2>
Name Firefox
98.0
20220304153049
 
release
Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
Linux 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17)
Adwaita / Adwaita
1/1
1/1 Enabled by default
5
Inactive
Found
Found
Found
false
Application Basics

Name: Firefox
Version: 98.0
Build ID: 20220304153049
Distribution ID:
Update Channel: release
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
OS: Linux 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17)
OS Theme: Adwaita / Adwaita
Multiprocess Windows: 1/1
Fission Windows: 1/1 Enabled by default
Remote Processes: 5
Enterprise Policies: Inactive
Google Location Service Key: Found
Google Safebrowsing Key: Found
Mozilla Location Service Key: Found
Safe Mode: false

Crash Reports for the Last 3 Days

Firefox Features

Name: DoH Roll-Out
Version: 2.0.0
ID: [email protected]

Name: Firefox Screenshots
Version: 39.0.1
ID: [email protected]

Name: Form Autofill
Version: 1.0.1
ID: [email protected]

Name: Picture-In-Picture
Version: 1.0.0
ID: [email protected]

Name: Web Compatibility Interventions
Version: 30.0.0
ID: [email protected]

Name: WebCompat Reporter
Version: 1.4.2
ID: [email protected]

Remote Features

bug-1759000-rollout-initial-rollout-of-tcp-release-91-99: active
bug-1762636-rollout-disable-webassembly-code-caching-release-98-99: active

Remote Processes

Type: Privileged About
Count: 1

Type: Extension
Count: 1

Type: Preallocated
Count: 3

Add-ons

Name: Add-ons Search Detection
Type: extension
Version: 2.0.0
Enabled: true
ID: [email protected]

Name: Amazon.com
Type: extension
Version: 1.3
Enabled: true
ID: [email protected]

Name: Bing
Type: extension
Version: 1.3
Enabled: true
ID: [email protected]

Name: DuckDuckGo
Type: extension
Version: 1.1
Enabled: true
ID: [email protected]

Name: Google
Type: extension
Version: 1.1
Enabled: true
ID: [email protected]

Name: Wikipedia (en)
Type: extension
Version: 1.1
Enabled: true
ID: [email protected]

Graphics

Features
Compositing: WebRender (Software)
Asynchronous Pan/Zoom: wheel input enabled; scrollbar drag enabled; keyboard enabled; autoscroll enabled; smooth pinch-zoom enabled
WebGL 1 Driver WSI Info: -
WebGL 1 Driver Renderer: WebGL creation failed: * WebglAllowWindowsNativeGl:false restricts context creation on this system. () * Exhausted GL driver options. (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS)
WebGL 1 Driver Version: -
WebGL 1 Driver Extensions: -
WebGL 1 Extensions: -
WebGL 2 Driver WSI Info: -
WebGL 2 Driver Renderer: WebGL creation failed: * AllowWebgl2:false restricts context creation on this system. ()
WebGL 2 Driver Version: -
WebGL 2 Driver Extensions: -
WebGL 2 Extensions: -
Window Protocol: x11
Desktop Environment: unknown
Target Frame Rate: 60
GPU #1
Active: Yes
Description: See failure log
RAM: 0

Diagnostics
AzureCanvasBackend: skia
AzureContentBackend: skia
AzureFallbackCanvasBackend: skia
CMSOutputProfile: Empty profile data
Decision Log
HW_COMPOSITING:
available by default
blocked by env: Acceleration blocked by platform
OPENGL_COMPOSITING:
unavailable by default: Hardware compositing is disabled
WEBRENDER:
available by default
disabled by env: Not qualified
WEBRENDER_QUALIFIED:
available by default
blocklisted by env: No qualified hardware
WEBRENDER_COMPOSITOR:
disabled by default: Disabled by default
blocklisted by env: Blocklisted by gfxInfo
WEBRENDER_PARTIAL:
available by default
blocklisted by env: Blocklisted by gfxInfo
WEBRENDER_SHADER_CACHE:
disabled by default: Disabled by default
blocklisted by env: Blocklisted by gfxInfo
unavailable by runtime: WebRender disabled
WEBRENDER_OPTIMIZED_SHADERS:
available by default
blocklisted by env: Blocklisted by gfxInfo
unavailable by runtime: WebRender disabled
WEBRENDER_ANGLE:
available by default
unavailable by env: OS not supported
WEBRENDER_DCOMP_PRESENT:
available by default
disabled by user: User disabled via pref
unavailable by env: Requires Windows 10 or later
unavailable by runtime: Requires ANGLE
WEBRENDER_SOFTWARE:
available by default
WEBGPU:
disabled by default: Disabled by default
blocked by runtime: WebGPU can only be enabled in nightly
X11_EGL:
available by default
force_enabled by user: Force enabled by pref
blocklisted by env: Blocklisted by gfxInfo
broken by runtime: glxtest could not use EGL
DMABUF:
available by default
force_enabled by user: Force enabled by pref
blocklisted by env: Blocklisted by gfxInfo
unavailable by runtime: Requires EGL

Failure Log
(#0) Error: No GPUs detected via PCI
(#1) Error: glxtest: process failed (received signal 11)

Media

Audio Backend: pulse-rust
Max Channels: 2
Preferred Sample Rate: 48000
Roundtrip latency (standard deviation): 51.87ms (5.12)
Output Devices
Name: Group
sof-soundwire HDMI3/DP3 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire HDMI2/DP2 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire HDMI1/DP1 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire Headphones: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire Speaker: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
Input Devices
Name: Group
Monitor of sof-soundwire HDMI3/DP3 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
Monitor of sof-soundwire HDMI2/DP2 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
Monitor of sof-soundwire HDMI1/DP1 Output: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
Monitor of sof-soundwire Headphones: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
Monitor of sof-soundwire Speaker: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire Headset Microphone: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0
sof-soundwire SoundWire microphones: /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0

Enumerate database

Environment Variables

MOZ_DISABLE_RDD_SANDBOX: 1
DISPLAY: :0
MOZ_ASSUME_USER_NS: 1
MOZ_CRASHREPORTER_EVENTS_DIRECTORY: /home/denis/.mozilla/firefox/6fgtt95t.default-release-3/crashes/events
MOZ_CRASHREPORTER_RESTART_ARG_0: ./firefox-bin
MOZ_CRASHREPORTER_RESTART_ARG_1:
MOZ_CRASHREPORTER_DATA_DIRECTORY: /home/denis/.mozilla/firefox/Crash Reports
MOZ_CRASHREPORTER_PING_DIRECTORY: /home/denis/.mozilla/firefox/Pending Pings
MOZ_CRASHREPORTER_STRINGS_OVERRIDE: /home/denis/temp/ff98/browser/crashreporter-override.ini
MOZ_LAUNCHED_CHILD:
MOZ_APP_SILENT_START:
XRE_PROFILE_PATH:
XRE_PROFILE_LOCAL_PATH:
XRE_START_OFFLINE:
XRE_BINARY_PATH:
XRE_RESTARTED_BY_PROFILE_MANAGER:

Experimental Features

about:home startup cache (browser.startup.homepage.abouthome_cache.enabled): false
Cookies: SameSite=Lax by default (network.cookie.sameSite.laxByDefault): false
Cookies: SameSite=None requires secure attribute (network.cookie.sameSite.noneRequiresSecure): false
Cookies: Schemeful SameSite (network.cookie.sameSite.schemeful): false
CSS: Constructable Stylesheets (layout.css.constructable-stylesheets.enabled): false
CSS: Masonry Layout (layout.css.grid-template-masonry-value.enabled): false
Developer Tools: Compatibility Panel (devtools.inspector.compatibility.enabled): true
Developer Tools: Service Worker debugging (devtools.debugger.features.windowless-service-workers): false
Firefox 100 User-Agent String (general.useragent.forceVersion100): false
Media: JPEG XL (image.jxl.enabled): false
Address Bar: show results during IME composition (browser.urlbar.keepPanelOpenDuringImeComposition): false
Web API: WebGPU (dom.webgpu.enabled): false
WebRTC Global Mute Toggles (privacy.webrtc.globalMuteToggles): false
Win32k Lockdown (security.sandbox.content.win32k-disable): false

Remote Experiments

Important Modified Preferences

browser.contentblocking.category: standard
browser.search.region: UA
browser.sessionstore.upgradeBackup.latestBuildID: 20220304153049
browser.startup.homepage_override.buildID: 20220304153049
browser.startup.homepage_override.mstone: 98.0
browser.urlbar.placeholderName: Google
browser.urlbar.quicksuggest.migrationVersion: 2
browser.urlbar.quicksuggest.scenario: history
doh-rollout.balrog-migration-done: true
doh-rollout.doneFirstRun: true
doh-rollout.home-region: UA
extensions.lastAppVersion: 98.0
gfx.blacklist.canvas2d.acceleration: 4
gfx.blacklist.canvas2d.acceleration.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.d3d11.keyed.mutex: 4
gfx.blacklist.d3d11.keyed.mutex.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.direct2d: 4
gfx.blacklist.direct2d.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.direct3d11angle: 4
gfx.blacklist.direct3d11angle.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.dmabuf: 4
gfx.blacklist.dmabuf.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.dx.interop2: 4
gfx.blacklist.dx.interop2.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.dx.nv12: 4
gfx.blacklist.dx.nv12.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.dx.p010: 4
gfx.blacklist.dx.p010.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.dx.p016: 4
gfx.blacklist.dx.p016.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.gl.swizzle: 4
gfx.blacklist.gl.swizzle.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.gpu.process: 4
gfx.blacklist.gpu.process.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.hardwarevideodecoding: 4
gfx.blacklist.hardwarevideodecoding.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.layers.direct3d10: 4
gfx.blacklist.layers.direct3d10-1: 4
gfx.blacklist.layers.direct3d10-1.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.layers.direct3d10.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.layers.direct3d11: 4
gfx.blacklist.layers.direct3d11.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.layers.direct3d9: 4
gfx.blacklist.layers.direct3d9.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.layers.opengl: 4
gfx.blacklist.layers.opengl.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.stagefright: 4
gfx.blacklist.stagefright.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webgl.allow-oop: 4
gfx.blacklist.webgl.allow-oop.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webgl.angle: 4
gfx.blacklist.webgl.angle.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webgl.msaa: 4
gfx.blacklist.webgl.msaa.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webgl.opengl: 4
gfx.blacklist.webgl.opengl.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webgl2: 4
gfx.blacklist.webgl2.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrender: 4
gfx.blacklist.webrender.compositor: 4
gfx.blacklist.webrender.compositor.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrender.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrender.partial-present: 4
gfx.blacklist.webrender.partial-present.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrtc.hw.acceleration.decode: 4
gfx.blacklist.webrtc.hw.acceleration.decode.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrtc.hw.acceleration.encode: 4
gfx.blacklist.webrtc.hw.acceleration.encode.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.webrtc.hw.acceleration.h264: 4
gfx.blacklist.webrtc.hw.acceleration.h264.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.blacklist.x11.egl: 4
gfx.blacklist.x11.egl.failureid: FEATURE_FAILURE_GLXTEST_FAILED
gfx.x11-egl.force-enabled: true
media.av1.enabled: false
media.ffmpeg.vaapi.enabled: true
media.gmp-gmpopenh264.abi: x86_64-gcc3
media.gmp-gmpopenh264.lastUpdate: 1649436755
media.gmp-gmpopenh264.version: 1.8.1.1
media.gmp-manager.buildID: 20220304153049
media.gmp-manager.lastCheck: 1649436754
media.gmp.storage.version.observed: 1
privacy.sanitize.pending: [{"id":"newtab-container","itemsToClear":[],"options":{}}]
security.remote_settings.intermediates.checked: 1649436759
security.sandbox.content.tempDirSuffix: 575e7194-b8e5-40df-856e-32bfc0d26770
widget.dmabuf.force-enabled: true

Important Locked Preferences

fission.autostart.session: true

Places Database

Accessibility

Activated: false
Prevent Accessibility: 0

Library Versions

NSPR
Expected minimum version: 4.33
Version in use: 4.33

NSS
Expected minimum version: 3.75
Version in use: 3.75

NSSSMIME
Expected minimum version: 3.75
Version in use: 3.75

NSSSSL
Expected minimum version: 3.75
Version in use: 3.75

NSSUTIL
Expected minimum version: 3.75
Version in use: 3.75

Sandbox

Seccomp-BPF (System Call Filtering): true
Seccomp Thread Synchronization: true
User Namespaces: true
Content Process Sandboxing: true
Media Plugin Sandboxing: true
Content Process Sandbox Level: 4
Effective Content Process Sandbox Level: 4
Win32k Lockdown State for Content Process: Win32k Lockdown disabled -- Operating system not supported

Rejected System Calls

Startup Cache

Disk Cache Path: /home/denis/.cache/mozilla/firefox/6fgtt95t.default-release-3/startupCache/startupCache.8.little
Ignore Disk Cache: false
Found Disk Cache on Init: true
Wrote to Disk Cache: false

Internationalization & Localization

Application Settings
Requested Locales: ["en-US"]
Available Locales: ["en-US"]
App Locales: ["en-US"]
Regional Preferences: ["en-US"]
Default Locale: "en-US"
Operating System
System Locales: ["en-US"]
Regional Preferences: ["en-US"]

Remote Debugging (Chromium Protocol)

Accepting Connections: false
URL:

Printing

Modified print settings

@elFarto
Copy link
Owner

elFarto commented Apr 8, 2022

Looks like Firefox has given up trying to initialise the hardware and is falling back to software for everything. You can try removing the gfx.blacklist.* config items.

I'm assuming you've got Xorg running on your Intel card. Trying to get FF to initialise the correct card is a bit tricky. I'll have a play around with it on my other setup tomorrow to see if I can come up with a working solution.

@MageSlayer
Copy link
Author

I tried deleting every blacklist items and restart, but it does help acceleration and just recreated those blacklist records again.

As for hybrid graphics:

denis@devuan-nb:~$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x1df cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:modesetting

@elFarto
Copy link
Owner

elFarto commented Apr 9, 2022

I've spent a while trying to get my Optimus machine to work correctly when running on the Intel GPU, but there doesn't seem to be a way to do it. I'm not quite sure what the root cause of the issue is, but it seems Firefox gets confused when there's multiple EGL implementations available.

It's possible that using this option __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json (assuming that file is in the same place) when starting Firefox might help, but it doesn't work on my PC likely because it's the older 470 driver series.

@MageSlayer
Copy link
Author

I have 460.91.03-1 nvidia-driver.

denis@devuan-nb:~/temp/ff98$ cat /usr/share/glvnd/egl_vendor.d/10_nvidia.json
{
    "file_format_version" : "1.0.0",
    "ICD" : {
        "library_path" : "libEGL_nvidia.so.0"
    }
}

However, FF98 just emits:

[GFX1-]: glxtest: libEGL no display
[GFX1-]: glxtest: libEGL no display

... and acceleration still does not work.

@elFarto
Copy link
Owner

elFarto commented Apr 9, 2022

I have 460.91.03-1 nvidia-driver.

That's quite an old driver series. With a 1650 card you can use the 510 series, which may work better especially with Firefox which really wants GBM.

@MageSlayer
Copy link
Author

Aha.
Looks upgrading to 510.47.03-1 really did the trick.
Now both FF98 & FF-nightly consume only ~20% CPU time.
Thanks a lot.

pobrn added a commit to pobrn/nvidia-vaapi-driver that referenced this issue Apr 11, 2022
Making the `NVCodec` structs maximally aligned was an erroneous
move because the gcc may increase the alignment which can lead
to undesirable behaviour (e.g. elFarto#71).

In the aforementioned case the size of the struct was 496 bytes,
which was properly aligned to the maximum alignment
(`__BIGGEST_ALIGNMENT__`) on the platform (16 bytes - x86-64),
but gcc chose to align the objects at a 32 byte boundary,
which resulted in 16 bytes of padding between each element
that was not accound for at runtime.

Specifying the alignment on the object itself and not
the type prevents gcc from increasing the alignment.

See: https://lore.kernel.org/lkml/[email protected]/

Fixes: 73ddb63 ("vabackend: make NVCodec struct aligned")
pobrn added a commit to pobrn/nvidia-vaapi-driver that referenced this issue Apr 11, 2022
Making the `NVCodec` structs maximally aligned was an erroneous
move because the gcc may increase the alignment which can lead
to undesirable behaviour (e.g. elFarto#71).

In the aforementioned case the size of the struct was 496 bytes,
which was properly aligned to the maximum alignment
(`__BIGGEST_ALIGNMENT__`) on the platform (16 bytes - x86-64),
but gcc chose to align the objects at a 32 byte boundary,
which resulted in 16 bytes of padding between each element
that was not accounted for at runtime.

Specifying the alignment on the object itself and not
the type prevents gcc from increasing the alignment.

See: https://lore.kernel.org/lkml/[email protected]/

Fixes: 73ddb63 ("vabackend: make NVCodec struct aligned")
@pobrn
Copy link
Contributor

pobrn commented Apr 11, 2022

Sorry everyone, I am responsible for the initial segmentation fault. In libva 2.10.0, VABufferTypeMax == 59 which makes the size of the NVCodec struct equal 496 bytes (on x86-64), but gcc decided to increase the alignment to 32 when laying out the objects in the executable file. That means there was 16 bytes of padding between the NVCodec structs in the executable that was not accounted for at runtime. So

        cudaVideoCodec cvc = c->computeCudaCodec(profile);

jumped to a NULL pointer (most likely because the padding was all zeros) as can be seen in the initial stack trace.

Funnily, I have created #67 in order to solve exactly this kind of problem, but it was the wrong approach.

@elFarto
Copy link
Owner

elFarto commented Apr 11, 2022

Ok, for some reason I was thinking that the whole section was missing/null, but just being off by a few bytes would also explain the null pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants