# GPU ID, load balancing

**URL:** <https://community.wowza.com/t/gpu-id-load-balancing/55402>\
**Category:** Wowza Streaming Engine\
**Tags:** transcoder\
**Created:** [June 15, 2020, 4:50pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402 "2020-06-15T16:50:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Jun](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Ben\_Jun](https://community.wowza.com/u/Ben_Jun)\
**Post date:** [June 15, 2020, 4:50pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/1 "2020-06-15T16:50:53Z")

</div>

I have some questions relating to GPU ID selection:1/ My understanding is that GPU ID specifies the GPU card. I believe “Use first available GPU” (-1 in the transcoder template XML) is essentially equivalent to saying “always use card 0”. Is this correct?

2/ What about NVIDIA cards with multiple NVENC cores? Does that change the indexing? Or are both cores auto load balanced?

3/ I understand that there is no platform support for load balancing. It appears that the transcoder template .XML is re-read every time the specific incoming stream starts (no application restart required). WDYT if we were to build a poor-man’s load balancer that changes in the template .XML file based on system conditions? The goal would be to steer the next new stream to the selected GPU.

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [June 15, 2020, 4:57pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/2 "2020-06-15T16:57:19Z")

</div>

Hi @Ben Jun. You’re not the first one to ask this - about a year ago I had a similar case for a customer 😉 and with some Googling I found back the following article: [https://www.wowza.com/docs/how-to-load-balance-nvidia-cuda-accelerated-transcoding-across-gpus](https://www.wowza.com/docs/how-to-load-balance-nvidia-cuda-accelerated-transcoding-across-gpus). Will that help?

---

<div class="post-metadata">

**Author:** ![Ben\_Jun](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Ben\_Jun](https://community.wowza.com/u/Ben_Jun)\
**Post date:** [June 15, 2020, 6:05pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/3 "2020-06-15T18:05:46Z")

</div>

Light at the end of the tunnel! Unfortunately my java coding resources are limited.

Does this require the IDE + manual code change or can we just copy over a file and refer to it in Server.xml ?

---

<div class="post-metadata">

**Author:** ![Ben\_Jun](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Ben\_Jun](https://community.wowza.com/u/Ben_Jun)\
**Post date:** [June 15, 2020, 6:16pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/4 "2020-06-15T18:16:51Z")

</div>

I did read the article, but I thought I had to manually add the code file. Thank you!

Quick clarification: if a GPU card has multiple NVENC cores, is anything special required to use the full set of NVENC cores?

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [June 15, 2020, 6:31pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/5 "2020-06-15T18:31:02Z")

</div>

AFAIK no.

---

<div class="post-metadata">

**Author:** ![Karel\_Boek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/karel_boek/32/454_2.png) [@Karel\_Boek](https://community.wowza.com/u/Karel_Boek)\
**Post date:** [June 15, 2020, 6:11pm UTC](https://community.wowza.com/t/gpu-id-load-balancing/55402/6 "2020-06-15T18:11:47Z")

</div>

Have you read the article? “_The **TranscoderVideoLoadBalancerCUDASimple** class is built into Wowza Streaming Engine (4.5.0.01 and later). It can be used without any additional coding to do fairly simplistic load balancing_” …
