Gstreamer and Multi-core

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Gstreamer and Multi-core

ROSH CHERIAN
As multi-core processor systems  are increasingly being used in high end media applications such as near-zero latency 3D video conferencing, what kind of support does Gstreamer provide so that this could be used to the full extent?

In such high load applications, there could be plugins that need to communicate with hardware which are asymmetrically distributed among cores. For eg:in the HP ProLiant DL785 G5  machine(with 32 cores), only some cores are designed to have direct connection to PCI Express.  Hence a camera capture source plugin might prefer to be run in one of such cores.

Wouldn't it be nice to have plugins to be able to specify the affinity to a certain core as a property, thereby bypassing kernel's allocation?
In other words, the thread that runs the work doing function of all the plugins that belong to the same thread, should be able to be started in the core that is specified by one of the plugins in that thread.

Is this an item of interest in the gstreamer community?

regards,
Rosh






-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer and Multi-core

Wim Taymans
On Wed, 2008-11-05 at 14:30 +0100, ROSH CHERIAN wrote:
> As multi-core processor systems  are increasingly being used in high end media applications such as near-zero latency 3D video conferencing, what kind of support does Gstreamer provide so that this could be used to the full extent?
>
> In such high load applications, there could be plugins that need to communicate with hardware which are asymmetrically distributed among cores. For eg:in the HP ProLiant DL785 G5  machine(with 32 cores), only some cores are designed to have direct connection to PCI Express.  Hence a camera capture source plugin might prefer to be run in one of such cores.
>
> Wouldn't it be nice to have plugins to be able to specify the affinity to a certain core as a property, thereby bypassing kernel's allocation?
> In other words, the thread that runs the work doing function of all the plugins that belong to the same thread, should be able to be started in the core that is specified by one of the plugins in that thread.
>
> Is this an item of interest in the gstreamer community?

Yes, I think it relates to controlling the scheduling priority of
certain streaming threads, which is something we're going to try to
implement in the next months.

Wim

>
> regards,
> Rosh
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer and Multi-core

Eric Zhang-6
Hi, gstreamer-devel:

    This is interesting. AFAIK, the OS schedules the thread/process to cpu/core in it's own logic. Is there a way to specify a cpu(core) to run a specific thread(process)? This is a OS feature or just use some special cpu instructions to achieve this?

Eric Zhang

2008/11/5 Wim Taymans <[hidden email]>
On Wed, 2008-11-05 at 14:30 +0100, ROSH CHERIAN wrote:
> As multi-core processor systems  are increasingly being used in high end media applications such as near-zero latency 3D video conferencing, what kind of support does Gstreamer provide so that this could be used to the full extent?
>
> In such high load applications, there could be plugins that need to communicate with hardware which are asymmetrically distributed among cores. For eg:in the HP ProLiant DL785 G5  machine(with 32 cores), only some cores are designed to have direct connection to PCI Express.  Hence a camera capture source plugin might prefer to be run in one of such cores.
>
> Wouldn't it be nice to have plugins to be able to specify the affinity to a certain core as a property, thereby bypassing kernel's allocation?
> In other words, the thread that runs the work doing function of all the plugins that belong to the same thread, should be able to be started in the core that is specified by one of the plugins in that thread.
>
> Is this an item of interest in the gstreamer community?

Yes, I think it relates to controlling the scheduling priority of
certain streaming threads, which is something we're going to try to
implement in the next months.

Wim
>
> regards,
> Rosh
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer and Multi-core

Paul Davis-2
On Thu, 2008-11-06 at 09:17 +0800, Eric Zhang wrote:
> Hi, gstreamer-devel:
>
>     This is interesting. AFAIK, the OS schedules the thread/process to
> cpu/core in it's own logic. Is there a way to specify a cpu(core) to
> run a specific thread(process)? This is a OS feature or just use some
> special cpu instructions to achieve this?

its an OS feature. its also very easy to mis-use if you don't have a
very deep understanding of parallel computing.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer and Multi-core

ROSH CHERIAN
In reply to this post by Wim Taymans

Thank you Wim, for the quick comment.
Good to know that you are working on a solution for scheduling priority and I hope core affinity would also be looked into.
I have a proposal for implementation, which is to set the affinity in the gst_pad_push_event() of the gstpads.c file.

I enclose the result of a test that I did to verify the result of my implementation,

regards,
Rosh



file: gstpads.c


/*
CPU Affinity setting patch
[hidden email]
*/

gint set_affinity(GstPad* pad) {

  GstObject* objPar =  (GstObject*) GST_OBJECT_PARENT (pad);
  cpu_set_t set;
  struct sched_param param;

  if(objPar->_cpu_affinity!=-1){
    printf("###########  Setting affinity of '%s' running in thread %x to %d ######## \n",
           objPar->name,
           pthread_self(),
           objPar->_cpu_affinity);

    CPU_ZERO(&set);
    CPU_SET(objPar->_cpu_affinity,&set);

    sched_setaffinity(0, sizeof(cpu_set_t),
                          &set);

    objPar->_cpu_affinity=-1;


    /*
    //this part is for setting real time priority, if needed
    memset(&param, 0, sizeof(sched_param));
    param.sched_priority = objPar->_prio;
    if(sched_setscheduler(0, SCHED_FIFO, &param) == -1)
      {
        printf("error in setting priority >>>>>>>>>>> \n");
      }

    */
}
________________________________________
From: Wim Taymans [[hidden email]]
Sent: 05 November 2008 16:00
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Gstreamer and Multi-core

On Wed, 2008-11-05 at 14:30 +0100, ROSH CHERIAN wrote:
> As multi-core processor systems  are increasingly being used in high end media applications such as near-zero latency 3D video conferencing, what kind of support does Gstreamer provide so that this could be used to the full extent?
>
> In such high load applications, there could be plugins that need to communicate with hardware which are asymmetrically distributed among cores. For eg:in the HP ProLiant DL785 G5  machine(with 32 cores), only some cores are designed to have direct connection to PCI Express.  Hence a camera capture source plugin might prefer to be run in one of such cores.
>
> Wouldn't it be nice to have plugins to be able to specify the affinity to a certain core as a property, thereby bypassing kernel's allocation?
> In other words, the thread that runs the work doing function of all the plugins that belong to the same thread, should be able to be started in the core that is specified by one of the plugins in that thread.
>
> Is this an item of interest in the gstreamer community?

Yes, I think it relates to controlling the scheduling priority of
certain streaming threads, which is something we're going to try to
implement in the next months.

Wim

>
> regards,
> Rosh
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

GstreamerCpuAffinityTest.pdf (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer and Multi-core

Eric Zhang-6
In reply to this post by Paul Davis-2
Hi, gstreamer-devel:

    Cool. Paul, could you explain more details about this? Or just give some references to me? I worked in HPC area for 4 years before so I am interesting about this. Thanks a lot.

Eric Zhang

2008/11/6 Paul Davis <[hidden email]>
On Thu, 2008-11-06 at 09:17 +0800, Eric Zhang wrote:
> Hi, gstreamer-devel:
>
>     This is interesting. AFAIK, the OS schedules the thread/process to
> cpu/core in it's own logic. Is there a way to specify a cpu(core) to
> run a specific thread(process)? This is a OS feature or just use some
> special cpu instructions to achieve this?

its an OS feature. its also very easy to mis-use if you don't have a
very deep understanding of parallel computing.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel