[SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
Welcome, Guest.
“Theory and practice sometimes clash. And when that happens, theory loses. Every single time.” ― Linus Torvalds

Author Topic: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio  (Read 9627 times)

Offline mitsos1992

  • Jr. Member
  • ***
  • Posts: 25
  • Offensive Security Enthusiast
[SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« on: September 14, 2016, 09:11:05 AM »
Hello I would like to demonstrate how to install:

A) Intel + Nvidia support or Nvidia alone if you are on desktop
B)Nvidia Proprietary stuff and if it works as expected
C)Ffmpeg with nvidia support
D) OBS-Studio and combine with nvidia and ffmpeg
this took me approx. 9 months to figure, but at least i want to share for you if you need it.

"THIS WILL ONLY WORK ON SOME MODELS OF Nvidia CARDS."
(not all cards are supported guys, sorry for that blame nvidia :P )


A) go to manjaro settings and install latest nvidia proprietary stuff, anyting above 360 drivers will suffice. i got 370.28 newly released and kernel 4.4


B) use this cmd $ sudo pacman -Syyu cuda  -- then reboot
then after all these are done and work as expected ( $ optirun nvidia-smi) or desktop version (nvidia-smi)


for this part web itself isnt your friend because nvidia-sdk is broken and aur packages as well
( for this part you will need my custom nvidia-sdk-manjaro which was compiled using some flag  tricks, please allow me to upload external link and you will have it )
else you will have to get the files needed and edit pkgbuild to grab zip in HDD and not web


C) after you install this nvidia-sdk-manjaro package then you can proceed with


$ yaourt ffmpeg-nvenc-manjaro


now you have ensured that ffmpeg uses the nvidia as API but that alone aint enough so,


D) you need to provide the front end to use it effectively.
$ yaourt obs-studio-git


grab 15.4 from this one and self compile like most of it :D
Disclaimer: sorry for long text only trying to help so, i am not to be responsible if that aint working on your pc, as i said only nvidia 6XXm and 7XX series support this.


Images:
https://mega.nz/#!bgZRASKS!LSB89SyIUOfV5pyGiGqs8pAtiNdiI_egEvcnMN9iNys
https://mega.nz/#!PwxRTajY!_-9MM47hWXlHsddiPQbgxmltzHvkxaaBhP4ccKxN_Vo



Update 1
This is the custom compiled file you will have to install else it will fail
https://mega.nz/#!awxzkIiQ!We681T4o9qj_5aureLaCJ76Ec_95Lcv_WhIB1nNWIwE


Update 2:

Cuda 8 updates!

If you want to update or if your system updated on its own from Cuda 7.5 to version 8 
then its high time i popped new freshly compiled versions of ffmpeg with support for it.

Both Arch and Manjaro users can benefit from this.
(Note: If you havent done anything of this then please start from the top thread and just follow this guide after you have installed nvidia proprietary stuff and cuda 8 )

Step 1)
ensure that you have updated to cuda version 8, and perform an all out system update/upgrade

$ sudo pacman -Syyu

Step 2)

Both Arch and Manjaro will need to grab and install this compiled package
 
Link: https://mega.nz/#!b9A3HQiR!XX8ItkNqrYOrbilHzQxbfIiRwDOCKzahoWW8UABCNWg


Step 3) 

For Arch users download and install this package either by click and prompt or via
pacman -U, which allows pacman to see local packages

Link: https://mega.nz/#!W5wnHJrJ!AZhkm8YzcCl6-ala66AfilP1y_rQXFYY_a-qw47wDwI

For Manjaro users  download and install this package double click and it will pop to install

Link: https://mega.nz/#!ahxhyKiT!m-VAqSUszyx0WQjRoNqAi7gMdODLQ993Vu6O0Vfu7n0

Step 4) 

Reboot, and your good to go 

make sure you follow my other thread if you really want to put this NVENC acceleration into good use

Video Trascode, Video Edit, Video Accelerated Screen Capture and many more here: 

http://www.cupoflinux.com/SBB/index.php/topic,5106.0.html
« Last Edit: October 10, 2016, 09:15:34 PM by mitsos1992 »

Offline Kalthrix

  • Staff Member
  • ********
  • Posts: 1293
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #1 on: September 14, 2016, 09:32:00 PM »
Thank you for the detailed guide on installing Nvidia proprietary drivers in Manjaro! I moved this post over to the How/To board in order for it get better visibility and be available as a resource for other members. Thanks again for your contribution! :)

Offline mitsos1992

  • Jr. Member
  • ***
  • Posts: 25
  • Offensive Security Enthusiast
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #2 on: September 15, 2016, 03:07:54 AM »
No problem :)

true Arch Linux Support, had to install arch for this so :P

Links:

https://mega.nz/#!itZx2agJ!niDEvB0rJMoaVc5h0piT6GDWtOtbjF3znuHTV84ZhTY
https://mega.nz/#!W4xj0Q4b!fFI2I3lDIMXeOXLNNIbKEJ3U-P-bTP6rsPse_tXKxSc


how to use them

Install Nvidia drivers 361+

install Cuda 
$ sudo pacman -Syu cuda

then install nvidia sdk ( the first link )

then install ffmpeg custom made ( the second link )

this is manjaro ffmpeg stripped of manjaro depedencies and added the arch depedencies instead wont need java or anything fancy the full edition needs !!!

enjoy :D
« Last Edit: September 26, 2016, 04:27:55 PM by mitsos1992 »

Offline StEvil

  • Newbie
  • **
  • Posts: 2
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #3 on: September 26, 2016, 08:55:45 AM »
Thanks for sharing!!

but it doesn't work for me. I'm a noob so proably i make something worng.
I have the GeForce GTX 860M inside, so its not nvidia 6XXm and 7XX series but newer... so i think thats my problem!?

Code: [Select]
info: ---------------------------------
info: [NVENC encoder: 'simple_h264_stream'] settings:
rate_control: CBR
bitrate:      2500
cqp:          0
keyint:       250
preset:       default
profile:      main
level:        auto
width:        1152
height:       720
2-pass:       true
GPU:          0

[nvenc_h264 @ 0x282f520] This encoder is deprecated, use 'h264_nvenc' instead
NVIDIA: no NVIDIA devices found
[nvenc_h264 @ 0x282f520] Cannot init CUDA
warning: [NVENC encoder: 'simple_h264_stream'] Failed to open NVENC codec: Unknown error occurred
Speicherzugriffsfehler
Code: [Select]
$ optirun nvidia-smi
Mon Sep 26 16:12:10 2016      
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 370.28                 Driver Version: 370.28                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 860M    Off  | 0000:01:00.0     Off |                  N/A |
| N/A   55C    P0    N/A /  N/A |      5MiB /  4043MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                              
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      2794    G   /usr/lib/xorg-server/Xorg                        4MiB |
+-----------------------------------------------------------------------------+


« Last Edit: September 26, 2016, 10:14:08 AM by StEvil »

Offline mitsos1992

  • Jr. Member
  • ***
  • Posts: 25
  • Offensive Security Enthusiast
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #4 on: September 26, 2016, 04:08:12 PM »
Hello 
what OS you use ??
if you have laptop then you need to open an app using optirun or primusrun
eg: primusrun playonlinux OR optirun wine 
so the the 860m utilizes first then it will be "on" for external usage 

also the Arch support i added above had problems so i installed arch and i made custom packages for it, i will upload them tonight :D

Offline StEvil

  • Newbie
  • **
  • Posts: 2
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #5 on: September 26, 2016, 04:56:37 PM »
Ahh yes when i start obs with optirun it runs perfect!! That was my mistake.

Thanks again. It works like a charm ;) 

OS:
Distro: Manjaro Linux
Kernel: 4.6.7-1-MANJARO x86_64 (64 bit)
Desktop: Xfce 4.12.3

Offline mitsos1992

  • Jr. Member
  • ***
  • Posts: 25
  • Offensive Security Enthusiast
Re: [SOLVED] Intel + Nvidia + ffmpeg-nvenc+obs-studio
« Reply #6 on: September 26, 2016, 05:27:45 PM »
i am working on intelquick sync project, all of this stuff are self made support from various resources i gather on net. it takes effort of 9 month research to make this one button install

bringing such support on linux is very hard but as you can see the pleasure you get when something like this works is what i call extraordinary.


i am also working on transcode, you can get it to transcode video via a program called tragtor.
kdenlive is also coming up next :P

enjoy :D