Skip to content

Instantly share code, notes, and snippets.

@nairbspace
Created May 31, 2020 19:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nairbspace/6afed439e244332f088fbee6b2bbd973 to your computer and use it in GitHub Desktop.
Save nairbspace/6afed439e244332f088fbee6b2bbd973 to your computer and use it in GitHub Desktop.
Script to delete iHD_drv_video.so on linuxserver/plex Docker containers
#!/bin/bash
## Bug with iHD_drv_video.so Intel media driver as of 2020-05-31.
## Need to force Plex to choose i965_drv_video.so on Gemini Lake CPUs.
## This is done by:
## adding this script to your /config/custom-cont-init.d/ folder on linuxserver/plex Docker containers
## or
## manually via command line by:
## docker exec -it name_of_plex_container /bin/bash -c "rm /usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so;exit 0"
## References:
## https://forums.plex.tv/t/hardware-transcoding-broken-on-intel-nuc-with-j5005-cpu-on-ubuntu-18-04-lts/487616/24
## https://blog.linuxserver.io/2019/09/14/customizing-our-containers/
IHD_PATH='/usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so'
if [ -e $IHD_PATH ]
then
echo '**** iHD driver found, deleting file. ****'
rm $IHD_PATH
fi
exit 0
@2ndwonder
Copy link

it can't find the path. I'm using Plex from hotio on docker compose. does that make a difference?

@HannesJo0139
Copy link

@nairbspace It seems for me that iHD_drv_video.so is working again using PMS 1.25.8.

@nairbspace
Copy link
Author

it can't find the path. I'm using Plex from hotio on docker compose. does that make a difference?

@2ndwonder no idea, however within the container you should be able to browse the directory path and see if that file exists.

@nairbspace It seems for me that iHD_drv_video.so is working again using PMS 1.25.8.

Thanks for the heads up, I completely forgot about this. This is good I guess since my setup has been running fine without issues. I still see activity on the Intel's media driver github, so I might just leave it as is. 😅

@seiferprod
Copy link

Hi,

I can't find the directory on my server, I'm using Unraid and there is no "/appdata/plex/custom-cont-init.d/" folder, should I create it then?

@2ndwonder
Copy link

2ndwonder commented Apr 25, 2022

I'm not sure. I'm using docker compose on a Synology NAS. I kinda forgot how I solved my issue. I don't have any problems with transcoding anymore since the log files of Plex shows that HW transcoding is enabled and my transcode folder is not empty. I can give you my container if you use docker compose. You'll also have to change the directory settings in Plex itself

@2ndwonder
Copy link

I checked my Plex directory and it seems that I created my transcode map inside the Plex folder. But then again, I'm using docker compose.

@seiferprod
Copy link

Hi,
I can't find the directory on my server, I'm using Unraid and there is no "/appdata/plex/custom-cont-init.d/" folder, should I create it then?
I'm not sure. I'm using docker compose on a Synology NAS. I kinda forgot how I solved my issue. I don't have any problems with transcoding anymore since the log files of Plex shows that HW transcoding is enabled and my transcode folder is not empty. I can give you my container if you use docker compose. You'll also have to change the directory settings in Plex itself

I do not use docker compose actually, I've runned the following script :

docker exec -it Plex-Media-Server bash
rm /usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so

on my server which remove the ihd driver and it works fine. But I will have to do that each time Plex container get an update because I can't find that folder. But thanks anyway for the help.

@2ndwonder
Copy link

Never had issues after Plex was updating. You should be able to put a environment in your container of Plex on unRAID. I can help you out which environment you have to use so it will use the right driver everytime.

@2ndwonder
Copy link

this is the line I use

you use this line on the device section
DEVICE: "/dev/dri:/dev/dri"

On volumes you use this
$DOCKERDIR/plex/Transcode:/transcode

I recommend putting your transcode Map on the same drive where Plex is installed. you can create the map transcode

I don't know if it will work for unRAID. as long as your paths are right, it shouldn't be any issue.

@seiferprod
Copy link

What do you mean by environment?

this is the line I use

you use this line on the device section DEVICE: "/dev/dri:/dev/dri"

On volumes you use this $DOCKERDIR/plex/Transcode:/transcode

I recommend putting your transcode Map on the same drive where Plex is installed. you can create the map transcode

I don't know if it will work for unRAID. as long as your paths are right, it shouldn't be any issue.

I have applied the dev/dri line already, but for some files it keep buffering and all my paths are right about Plex container, so I do not understand why it is struggeling to HW transcode then. But I will have a look if there is a possibility to create an environment on Unraid for a container, it might fix the problem, thank you.

@2ndwonder
Copy link

You should be able to do that. If you'd like I can have a look through TeamViewer. Are you new in Docker? Also do you have a Plex pass. File types of your media is also important. Plex doesn't like some video codecs or audio codecs. Especially if you're streaming it on your TV. Could be all kind of issues. For example, Plex has issues streaming hardcoded subtitles in your media. it will buffer all the time. I understand your frustrations. We've all been there

@seiferprod
Copy link

You should be able to do that. If you'd like I can have a look through TeamViewer. Are you new in Docker? Also do you have a Plex pass. File types of your media is also important. Plex doesn't like some video codecs or audio codecs. Especially if you're streaming it on your TV. Could be all kind of issues. For example, Plex has issues streaming hardcoded subtitles in your media. it will buffer all the time. I understand your frustrations. We've all been there

I have a Plexpass and I am new to Docker, I have set up my NAS two month ago.
The problem is, I think, that Plex have to transcode some files because it doesn't like the audio codec for some of them, because I do not struggle with all of my videos which are H265 encoded. I just have found a topic that may solve my problem using the QuickSync, so it may not be an issue if I do it correctly I think : https://forums.unraid.net/topic/77943-guide-plex-hardware-acceleration-using-intel-quick-sync/

@2ndwonder
Copy link

Yes That's true. Pretty sure it the codecs on your media then. I haven't had any issue with buffering for a while now. You can put custom formats in radarr or sonarr in their settings Wich codes you prefer. You could also use Tdarr to convert your files to the desired codecs for stream. There should be some videos on YouTube which codecs Plex likes and dislike. Let me know if you need help

@seiferprod
Copy link

Yes That's true. Pretty sure it the codecs on your media then. I haven't had any issue with buffering for a while now. You can put custom formats in radarr or sonarr in their settings Wich codes you prefer. You could also use Tdarr to convert your files to the desired codecs for stream. There should be some videos on YouTube which codecs Plex likes and dislike. Let me know if you need help

Thanks for the help!

@defconxt
Copy link

is this still needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment