LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2022, 02:35 AM   #1
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Rep: Reputation: 39
nvidia HW accelerated hybrid graphics


Hi!

I installed Slackware64-15-current on machine with nVidia and Intel graphic card (hybrid).

Threads here are outdated, suggestions cause X not to start.

Questions:
Do VLC & ffmpeg from Alien or default ffmpeg support nVidia HW acceleration?
Proper xorg.conf file?
How to enable switching graphic card, or use nVidia with GPU intensive apps (VLC, ffmpeg) else iGPU?
Do not point to The Latest NVIDIA Linux Driver Release as i've already followed suggestions there with unsatisfactory results with SBo compiled/installed NVIDIA-Linux-x86_64-510.60.02

Is maybe better to disable iGPU in BIOS and use only nVidia?
 
Old 03-31-2022, 09:18 AM   #2
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,730

Rep: Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393
I have a similiar setup on my laptop, except mine has a AMD graphics and a discrete NVIDIA graphics card. You basically have 3 options.

1) Disable intel GPU in bios and just use NVIDIA card (by far the easiest solution).
2) configure the nvidia driver to just use the nvidia card and bypass the intel GPU (this is what I do since I can't disabled in bios).
3) Use Nvidia Prime render offload.

Prime render off load is where you use the integrated intel card unless you speciify the program to use the NVIDIA card. This is the best solution if you really need to watch your battery life. Once it is setup if you wanted to use the NVIDIA card for a program you would run it like this...

Code:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <program name>
It is not terribly difficult to setup but it can be a bit tedious to get running.

See the debian and arch wiki's. The information is still relevant to Slackware.
https://wiki.debian.org/NVIDIA%20Optimus
https://wiki.archlinux.org/title/NVIDIA_Optimus
 
3 members found this post helpful.
Old 03-31-2022, 09:56 AM   #3
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
Thank you Daedra.

I tested Prime render off load. Is works but VNC can not render video (HEVC).
I will test ffmpeg if it works that way.
 
Old 03-31-2022, 02:16 PM   #4
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
nVidia proprietary useless

packages installed:
libva-2.14.0-x86_64-1
libva-compat32-2.14.0-x86_64-1compat32
libva-utils-2.14.0-x86_64-1
libva-vdpau-driver-0.7.4-x86_64-3alien
libvdpau-1.5-x86_64-1
libvdpau-compat32-1.5-x86_64-1compat32
libvdpau-va-gl-0.4.2-x86_64-1_SBo

Code:
env  |grep VDP
VDPAU_DRIVER=va_gl
VDPAU_LOG=0
SBo repo compiled:
nvidia-driver-510.60.02_multilib-x86_64-1_SBo
nvidia-kernel-510.60.02_5.16.17-x86_64-1_SBo

/etc/X11/xorg.conf.d/21-LAR-nvidia-screens.conf

Checked VLC-3.0.16 from Alien - cli on terminal show only Intel accelerated video, nVidia never with any settings (HW acceleration an Video output auto or vdpau)

Checked ffmpeg from Alien (and Pat's is the same):
Quote:
ffmpeg -hwaccels
vdpau
Quote:
ffmpegffmpeg -hide_banner -encoders |grep h26
V..... h261 H.261
V..... h263 H.263 / H.263-1996
V..... h263_v4l2m2m V4L2 mem2mem H.263 encoder wrapper (codec h263)
V.S... h263p H.263+ / H.263-1998 / H.263 version 2
V..... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
V..... libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
V..... h264_qsv H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)
V..... h264_v4l2m2m V4L2 mem2mem H.264 encoder wrapper (codec h264)
V....D h264_vaapi H.264/AVC (VAAPI) (codec h264)
Quote:
ffmpeg -hide_banner -encoders |grep hevc
V..... libx265 libx265 H.265 / HEVC (codec hevc)
V..... hevc_qsv HEVC (Intel Quick Sync Video acceleration) (codec hevc)
V..... hevc_v4l2m2m V4L2 mem2mem HEVC encoder wrapper (codec hevc)
V....D hevc_vaapi H.265/HEVC (VAAPI) (codec hevc)
From above ffmpeg outputs it is clear that hwaccel vdpau is compiled but no nVidia encoders are available, only Intels qsv.
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia in front of vlc do not help.

Do anybody have VLC and ffmpeg with full nVidia hardware acceleration support?

At above state my nVidia cart is useless!
 
Old 03-31-2022, 07:45 PM   #5
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,730

Rep: Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393
can you post the output of these two commands..

Code:
glxinfo | grep OpenGL
Code:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep OpenGL
 
Old 03-31-2022, 09:17 PM   #6
biker_rat
Member
 
Registered: Feb 2010
Posts: 373

Rep: Reputation: 220Reputation: 220Reputation: 220
export __VK_LAYER_NV_optimus=NVIDIA_only
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
#export __GLX_VENDOR_LIBRARY_NAME=nvidia
I use the above in .profile with no xorg.conf
If I want opengl to be by nvidia, I preface the launch command with the commented out line. X won't launch if the commented out line is uncommented. Wayland will some times work with it uncommented.
 
Old 04-01-2022, 06:42 AM   #7
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,408
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
I use primusrun with my laptop, provided by bumblebee. If it could be relevent I will find you the slackbuilds links.

Edit : there https://docs.slackware.com/howtos:ha...nvidia_optimus

Last edited by Tonus; 04-01-2022 at 06:44 AM. Reason: It's in the docs
 
Old 04-01-2022, 01:13 PM   #8
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
Code:
glxinfglxinfo | grep OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
Code:
__NV_P__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro P2000/PCIe/SSE2
I already checked the above at first when searching for a solution.
nVidia proprietary driver is installed correctly and work as expected.


In my previous post:
Quote:
Checked VLC-3.0.16 from Alien - cli on terminal show only Intel accelerated video, nVidia never with any settings (HW acceleration an Video output auto or vdpau)
Checked ffmpeg from Alien (and Pat's is the same):
From above ffmpeg outputs it is clear that hwaccel vdpau is compiled but no nVidia encoders are available, only Intels qsv.
So the problem is that nVidia support is not compiled in Aliens VLC and ffmpeg (also Pats from Slackware).

Can anybody confirm that?

Did someone successfully compiled VLC and ffmpeg (adjusted Aliens slackbuild scripts)?
 
Old 04-14-2022, 08:52 AM   #9
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
ffmpeg compiled with nVidia support

I have successfully compiled ffmpeg-5 with nVidia support.
The crucial was installing nv-codec-headers first.

So now I can use h264_nvenc and hevc_nvenc and -hwaccel cuda for transcoding.
Huge improvement in speed.

For video play VLC uses compiled in intel iGPU, which is enough. CPU usage never reach high load even playing hevc UHD 10 bit.
 
1 members found this post helpful.
Old 04-14-2022, 10:36 AM   #10
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by zdolar View Post
I have successfully compiled ffmpeg-5 with nVidia support.
The crucial was installing nv-codec-headers first.

So now I can use h264_nvenc and hevc_nvenc and -hwaccel cuda for transcoding.
Huge improvement in speed.

For video play VLC uses compiled in intel iGPU, which is enough. CPU usage never reach high load even playing hevc UHD 10 bit.
Nice !

What version of Slackware do you run ?

Thanks

-- kjh
 
1 members found this post helpful.
Old 04-14-2022, 09:41 PM   #11
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I'd like very much to know how to compile the ffmpeg5 also! I tried and installed it, but for some reason the system didn't take to it and I had to re-install the one that came with the 'current' I'd installed. Reason I want to compile the ffmpeg5, is because I use several network cameras on the property for security and wildlife watching and hevc encoding would be really, really nice to have to save space on my hard drive.
 
1 members found this post helpful.
Old 04-15-2022, 02:37 AM   #12
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
Hi!

I'm running Slackware64-current.
Recently I've got a machine with nVidia P2000.
I need it for video transcoding.
As Slackware + Alien VLC & ffmpeg do not have compiled in nVidia support, I had to do it on my own.
For transcoding I need ffmpeg, for video play VLC restricted from Alien is fast enough with Intel iGPU.
So I compiled only ffmpeg.

WARNING: Installing ffmpeg-5 compiled by me RUIN ALL Slackware video applications! None of them are working.

As Alien compiled VLC (smartly) with all libraries included, VLC works. It works even without ffmpeg installed on a system.
I am satisfied with above, as ffmpeg & VLC are the only video apps I use on Slackware.
For Slackware video apps to work again, they have to be recompiled/reinstalled to grab installed ffmpeg-5.
I will not do that.

The other possibility is to compile/install ffmpeg-5 with other (custom) destination folder.
Then both ffmpeg-4 and ffmpeg-5 can then coexist on the system. That is only my idea, I do not know if this is possible.
If I need that, I will investigate it.

From my previous post:
Code:
The crucial was installing nv-codec-headers first.
This must be done before ffmpeg configure/compile, as ffmpeg configure script autodetect nVidia header files and enable nVidia options to be compiled.

For ffmpeg-5 to compile, I adapted original Slackwares slackbuild.
I chanced version number and allow nonfree libs to compile.
Also nVidia options must be enabled.

If interested, I can add slackbuild script - at the evening (I live in Slovenia/EU).
 
4 members found this post helpful.
Old 04-17-2022, 05:01 AM   #13
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Quote:
Originally Posted by zdolar View Post
[...]WARNING: Installing ffmpeg-5 compiled by me RUIN ALL Slackware video applications! None of them are working.
[...]
The other possibility is to compile/install ffmpeg-5 with other (custom) destination folder.
Then both ffmpeg-4 and ffmpeg-5 can then coexist on the system. That is only my idea, I do not know if this is possible.
I have a very quick and dirty method to leave the system FFmpeg binaries alone and also install and run the latest git FFmpeg. I install the 3 FFmpeg binaries to $HOME/bin after setting the $PATH to allow this preference:

Code:
andrew@ilium~$ echo $PATH
/home/andrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:etc..etc
The script is completely unpolished and rough and ready:

Code:
#!/bin/sh

set -e

rm -rfv /tmp/ffmpeg

cd /tmp

git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git ffmpeg

cd ffmpeg

./configure \
  --prefix="$HOME/bin" \
  --bindir="$HOME/bin" \
  --disable-doc \
  --enable-static \
  --disable-shared \
  --enable-libaom \
  --enable-openssl \
  --enable-libvorbis \
  --enable-libmp3lame \
  --enable-libx264 \
  --enable-libx265 \
  --enable-libvpx \
  --enable-libopus \
  --enable-libfdk-aac \
  --enable-libtheora \
  --enable-zlib \
  --enable-libfreetype \
  --enable-libpulse \
  --enable-libfribidi \
  --enable-libass \
  --enable-libdav1d \
  --enable-librav1e \
  --enable-nvenc \
  --enable-gpl \
  --enable-nonfree

make -j 32

# Strip the 3 executables:
strip --strip-unneeded /tmp/ffmpeg/{ffmpeg,ffplay,ffprobe}

cp -v /tmp/ffmpeg/{ffmpeg,ffplay,ffprobe} $HOME/bin

rm -rfv /tmp/ffmpeg
No libraries installed and so far no issues with system FFmpeg libraries which are undisturbed. This leaves:

Code:
andrew@ilium~$ ffmpeg -version | head -n 1 && /usr/bin/ffmpeg -version | head -n 1
ffmpeg version git-2022-03-17-c606736 Copyright (c) 2000-2022 the FFmpeg developers
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
andrew@ilium~$
Have done this successfully for many years...
 
3 members found this post helpful.
Old 04-21-2022, 04:43 AM   #14
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by andrew.46 View Post
I have a very quick and dirty method to leave the system FFmpeg binaries alone and also install and run the latest git FFmpeg. I install the 3 FFmpeg binaries to $HOME/bin after setting the $PATH to allow this preference:

Have done this successfully for many years...

Thank you for sharing this.
Will do that also.

Best regards,

Zdenko
 
2 members found this post helpful.
Old 08-09-2022, 07:45 AM   #15
zdolar
Member
 
Registered: Jul 2009
Location: Slovenija
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 39
ffmpeg5 and ffmpeg4 coexistence

As some apps on Slackware do not work without ffmpeg-4 I decided to install ffmpeg-5 with coexisting ffmpeg-4.
The easiest way is to change ffmpeg-5 slackbuild - all install paths from /usr to /usr/local
After compile/install the system is happy.
All default apps that need ffmpeg-4 work and as PATH starts with /usr/local/.. calling ffmpeg from CLI run ffmpeg-5 without any changes elsewhere.
This is what I need, as I compiled ffmpeg-5 with nVidia HW support.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: FFmpeg 4.4 Released with Hardware Accelerated AV1 Decoding, VDPAU Accelerated HEVC and VP9 Decoding LXer Syndicated Linux News 0 04-09-2021 06:21 PM
Xfce 4.12 and hybrid suspend (aka hybrid sleep) atelszewski Slackware 0 06-15-2017 10:00 PM
Use Nvidia graphics card on linux mint mate 17.3 when in a hybrid graphics card environment betty _frances Linux Mint 1 06-08-2016 06:31 AM
Kernel 3.14 - how to change graphics card?(Radeon and Intel hybrid graphics) kamils096 Linux - Kernel 3 07-12-2014 05:09 PM
nvidia accelerated graphics not working.. ubuntu.fan Linux - Hardware 6 05-02-2012 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration