Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 05-20-09, 10:49 AM   #1
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Cool Can I use two VdpDecoders on the same GPU?

Hi, everyone,

I want to use a multi-thread program to decode 2 h.264 bitstreams on Linux. But I failed to create two VdpDecoder instances in two child threads.
Can one create two VdpDecoders in the same process space?
Or we can only create one VdpDecoder per process?
Or only one VdpDecoder is available per each nVidia video card?
Or only one VdpDecoder is available in Linux?

There is a H.264 player sample in CUDA on Windows. I could run two players at the same time, so I guess it is feasible to have multiple h.264 bitstreams be decoded in the same GPU.

Thank you for your time
dean1873 is offline   Reply With Quote
Old 05-20-09, 11:12 AM   #2
crisalide
Registered User
 
Join Date: Dec 2008
Posts: 173
Default Re: Can I used two VdpDecoders on the same GPU?

Some highlights/limitations of NVIDIA's current implementation:

* Supported on NVIDIA GPUs with the NVIDIA second generation video processors or later (as of driver version 180.22, see the driver's README file for a list of supported GPUs).
* Currently, only one video stream can be decoded at a time; we hope to lift this restriction eventually.
* Available in 180.xx and later NVIDIA driver releases
crisalide is offline   Reply With Quote
Old 05-20-09, 10:43 PM   #3
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Default Re: Can I used two VdpDecoders on the same GPU?

Hi, Crisalide,

Thank you for your information! Could you explain more details? Do you mean that the nVidia Linux Driver 180.22 supports multiple VdpDecoders on a single GPU? How soon can this feature be release to the market?

Why I can run several(I tried 3 ) players on Windows XP? Does it mean that we can create multiple VdpDecoder instance on a single GPU on Windows but it is just not supported on linux? In a word, the hardware can supported multiple channel decoding on a single core, but the driver is not ready yet for the linux platform.

Thanks again
dean1873 is offline   Reply With Quote
Old 05-20-09, 11:45 PM   #4
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Can I used two VdpDecoders on the same GPU?

VDPAU only supports creating a single VdpDecoder per GPU (or set of GPUs in SLI).

I'm not completely familiar with Windows, but I believe what's happening is that the first window gets HW acceleration, but subsequent windows won't, and automatically fall back to SW decoding.
Stephen Warren is offline   Reply With Quote
Old 05-21-09, 02:34 AM   #5
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Default Re: Can I used two VdpDecoders on the same GPU?

Hi, Stephen,

The application I used on Windows is the video player from the sample directory of CUDA on windows, which is used to show the decoding capability of CUDA Video API. I think the sample just uses the HW acceleration, because it is just a sample code, the design is not necessarily consider multiple players run on a single GPU in Windows XP. But I will check that anyway.

I wrote emails to fjargstorff@nvidia.com and eyoung@nvidia.com, asking for the same video decoding API on Linux platform. However, there is no such an offer in Linux CUDA.

I think it is possible to decode multiple stream on a single GPU, as the decoding context are maintained in the user's memory space, which is the VDPH264PictureInfo Structure. Different stream uses different decoding context, but share the same HW pipeline. Just like a printer shared by many people. All the people can use that HW, but they certainly need to decide what they are going to input to the printer.

Not sure whether this is just a software implementation limit or a hardware limit ....
dean1873 is offline   Reply With Quote
Old 05-21-09, 01:53 PM   #6
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Can I used two VdpDecoders on the same GPU?

I looked into this, and it appears DXVA always did support multiple streams decoding in parallel.

However, there are some implementation details that prevent us from exposing in VDPAU at present. These are SW limitations in the VDPAU driver and related SW components. We do hope to lift this restriction at some point in the future, but at present have no publicly available schedule.
Stephen Warren is offline   Reply With Quote
Old 05-22-09, 05:37 AM   #7
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Cool Re: Can I use two VdpDecoders on the same GPU?

Thanks Stephen

So, it could be a long time till we get the new Linux driver. Could we round this road blocker by a different design?

I thought for a while. Here is what I guess one could try:
We have 2 streams, A.264 B.264. We create two buffer bufferA and bufferB to associate with these 2 streams, and two context associate with them. But there is just one VdpDecoder here. We can use lock to make sure that only 1 stream can use this decoder at a time.

I don't know if the driver allows such a context shifting. I thought it is slice independent: every time you input a NAL and the context structure to the hardware, the YUV data is rendered to a video surface. The connection among the NAL sequence is 100% kept in the context. No temporal information is kept by the hardware.

Is the decoding process in the HW an atom operation for each and every NAL?

Looking forwards to your soon reply~

Last edited by dean1873; 05-22-09 at 05:43 AM. Reason: Grammar mistake :P
dean1873 is offline   Reply With Quote
Old 05-25-09, 02:34 AM   #8
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Can I used two VdpDecoders on the same GPU?

Unfortunately, some state needs to be saved inside the decoder that isn't represented by the video surface. So, you won't be able to intermingle two streams together in the same decoder. You can switch from one stream to another (i.e. at the end of one, start of another), but again, no interleaving.
Stephen Warren is offline   Reply With Quote

Old 05-30-09, 11:50 PM   #9
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Default Re: Can I used two VdpDecoders on the same GPU?

Hi, Stephen,

Now I have two GeForce 9600 GT on my workstation, with the Bus ID 1:0:0 and 2:0:0. I create two X-Windows on these 2 GPUs respectively, and create two VdpDevices which associate with these 2 GPUs. However, I am not able to create two presentation queues on them!

What is the problem? Can only one presentation queue be supported on the current driver even if we have two independent graphic cards?

Thanks
dean1873 is offline   Reply With Quote
Old 05-31-09, 12:47 AM   #10
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Can I used two VdpDecoders on the same GPU?

Multiple presentation queues should work fine, and have been tested various scenarios.

What's your X display configuration; separate screens, separate displays (X servers), or ...?

Can you please post an nvidia-bug-report, and also run your app with VDPAU_NVIDIA_DEBUG=3 and post any VDPAU error messages etc.

Thanks.
Stephen Warren is offline   Reply With Quote
Old 06-01-09, 08:31 AM   #11
dean1873
Registered User
 
Join Date: Feb 2009
Posts: 19
Default Re: Can I used two VdpDecoders on the same GPU?

Hi, Stephen,

One thing that I forgot to tell you is that it is OK to create multiple representation queues on the graphic card which is associated with the default X *Display (:0.0) handle.

Here is the error message when I export VDPAU_TRACE=1 and VDPAU_NVIDIA_DEBUG=3, the VdpDevice is assocaited with X *Display (:0.1):

================================================== ==============
vdp_presentation_queue_target_create_x11(1, 62914562, -)
-> 0, 21
vdp_presentation_queue_create(1, 21, -)
VDPAU nvidia: Error detected 1 205
VDPAU nvidia: Backtrace:
01: /usr/lib/libvdpau_nvidia.so [0xb791431e]
02: /usr/lib/libvdpau_nvidia.so [0xb79143e9]
03: /usr/lib/libvdpau_nvidia.so [0xb791dabb]
04: /usr/lib/libvdpau_nvidia.so [0xb791d40a]
05: /usr/lib/libvdpau_nvidia.so [0xb791a081]
06: /usr/lib/libvdpau_trace.so [0xb7f3d1d1]
07: ./1player [0x8050e32]
08: ./1player [0x804923f]
09: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7dd2775]
10: ./1player [0x8048c11]
VDPAU nvidia: Error detected 0 4532
VDPAU nvidia: Backtrace:
01: /usr/lib/libvdpau_nvidia.so [0xb791431e]
02: /usr/lib/libvdpau_nvidia.so [0xb79143e9]
03: /usr/lib/libvdpau_nvidia.so [0xb791a1d3]
04: /usr/lib/libvdpau_trace.so [0xb7f3d1d1]
05: ./1player [0x8050e32]
06: ./1player [0x804923f]
07: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7dd2775]
08: ./1player [0x8048c11]
-> 23
FATAL ERROR: Obtain VpdVideoPresentationQueueCreate failed, vdp_status = 23
vdp_get_error_string(23)
-> 'The system does not have enough resources to complete the requested operation at this time.'
VDPAU >>>>>> The system does not have enough resources to complete the requested operation at this time.
Can't intialize VDPAU decoder components, force quit...

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

I guess the Xserver configuration is also very important, so here I pasted my /etc/X11/xorg.conf:
================================================== =================
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 1.0 (buildmeister@builder63) Mon Mar 23 15:34:19 PST 2009

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection

Section "ServerFlags"
Option "Xinerama" "0"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "ViewSonic VX1940w"
HorizSync 24.0 - 82.0
VertRefresh 50.0 - 75.0
Option "DPMS"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor1"
VendorName "Unknown"
ModelName "ViewSonic VX1940w"
HorizSync 24.0 - 82.0
VertRefresh 50.0 - 75.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 9600 GT"
BusID "PCI:1:0:0"
EndSection

Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 9600 GT"
BusID "PCI:2:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
================================================== ==============

Here is the system information:
Kernel 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3

Thank you, any more details you need to know, feel free to contact me
dean1873 is offline   Reply With Quote
Old 06-01-09, 11:42 AM   #12
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: Can I used two VdpDecoders on the same GPU?

Which driver version was that error message and backtrace from? Thanks.
Stephen Warren is offline   Reply With Quote
Reply


Thread Tools

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 On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintain Your Privacy by Manually Accepting and Rejecting "Cookies" (nV News) MikeC Open Forum 2 02-02-13 08:15 PM
Choosing The Right GPU To Take Adobe Workflows To The Max News Archived News Items 0 05-29-12 06:40 PM
GTC Poster Session Shows Breadth of GPU Research News Archived News Items 0 05-15-12 02:50 AM
GPU Tech Conference Off to a Fast Start in San Jose News Archived News Items 0 05-14-12 06:00 PM
New GPU from Nvidia Announced Today, the GeForce GTX 670 News Archived News Items 0 05-10-12 02:50 PM

All times are GMT -5. The time now is 07:26 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.