Issue with go scrip running at startup.


Recommended Posts

Hey everyone,

 

Basically I am trying to pass through the graphic driver to a docker to enable emby to access hardware accelleration.

I have found some instuctions for plex that run a treat to get the driver to appear so it can be passed through, except it is does not retain after a reboot of the server.

 

The instructions I had followed were: https://forums.unraid.net/topic/77943-guide-plex-hardware-acceleration-using-intel-quick-sync/

 

There was a step to update the /boot/config/go file with the following at the end:

modprobe i915

chmod -R 777 /dev/dri

My go file is as following:

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#Setup drivers for hardware transcoding in Emby
modprobe i915
chmod -R 777 /dev/dri/

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

 

Has this changes with the latest release of  unraid 6.7.2?

Cheers,

Sean

 

Link to comment
20 minutes ago, SeanGoneWild said:

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

What do you  mean by this "sometimes"?  IF it does not always work when you run it manually, why would you expect it to work in a script environment?  

Link to comment

First thing, you need to trap the error code on exit.  (All proper behaving Linux commands will have an exit code on completion which 'tells' if it completed successfully.  A properly written BASH script should 'trap' this code and test it for proper execution if there is any possibility of failure.  OF course, it is up to the script writer to figure out a way to gracefully handle this.)    

 

What I also can't remember is exactly where the 'go' file executes in the boot process.   It could be that you are executing the modprobe command before the OS is fully installed.  

 

There is a plugin called 'CA User Scripts' which can be used to run user scripts.  It might be the solution to your problem.

 

You might also have to learn a bit of programing.  The shell used by Unraid is named BASH   (Bourne Again Shell)  and, if you google it, you can find tutorials to help you write a script for your use.  It is very powerful scripting language!  (The preclear script is written in BASH!)   These tutorials could also provide you with the knowledge of a way to integrate your commands (or call another 'script' from it) into the 'go' script and have it work. 

 

Now for the disclaimer.  It has been forty years since I had a course in Shell language and it was for the Bourne Shell.  (BASH came along in the late 1980's.)  I forgotten so much that I would be starting over in attempting to provide assistance in helping you write one. 

Link to comment
On 8/18/2019 at 8:57 AM, SeanGoneWild said:

Hey everyone,

 

Basically I am trying to pass through the graphic driver to a docker to enable emby to access hardware accelleration.

I have found some instuctions for plex that run a treat to get the driver to appear so it can be passed through, except it is does not retain after a reboot of the server.

 

The instructions I had followed were: https://forums.unraid.net/topic/77943-guide-plex-hardware-acceleration-using-intel-quick-sync/

 

There was a step to update the /boot/config/go file with the following at the end:

modprobe i915

chmod -R 777 /dev/dri

My go file is as following:


#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#Setup drivers for hardware transcoding in Emby
modprobe i915
chmod -R 777 /dev/dri/

 

However this appear to not be running as the /dev/dri folder does not appear but sometimes does when the steps are running manually.

 

Has this changes with the latest release of  unraid 6.7.2?

Cheers,

Sean

 

It should be like this. You want modules loaded (and permissions changed) before the array is started (which will then start dockers and VMs)

#!/bin/bash
# enable iGPU for docker use
/sbin/modprobe i915
chmod -R 0777 /dev/dri
# Start the Management Utility
/usr/local/sbin/emhttp &

These are discussed in the varius plex/emby support threads

  • Like 1
Link to comment

@ken-ji, did a fresh setup of another unraid box.  Can't get the emby gpu transcoding to work.  Using Intel Celeron G3930.  Already did the following:

 

#!/bin/bash

# enable iGPU for docker use

/sbin/modprobe i915

chmod -R 0777 /dev/dri

# Start the Management Utility

/usr/local/sbin/emhttp &

 

Does anything have to be done with Emby server?

 

Thanks in advance.

 

 

Link to comment
  • 2 weeks later...
On 8/20/2019 at 3:49 PM, ken-ji said:

It should be like this. You want modules loaded (and permissions changed) before the array is started (which will then start dockers and VMs)


#!/bin/bash
# enable iGPU for docker use
/sbin/modprobe i915
chmod -R 0777 /dev/dri
# Start the Management Utility
/usr/local/sbin/emhttp &

These are discussed in the varius plex/emby support threads

Cheers  @ken-ji.

 

Ammended my go file and rebooted my unraid server, it is now working correctly.

 

Thanks,

Sean

Link to comment
On 8/25/2019 at 9:25 AM, jang430 said:

@ken-ji, did a fresh setup of another unraid box.  Can't get the emby gpu transcoding to work.  Using Intel Celeron G3930.  Already did the following:

 

#!/bin/bash

# enable iGPU for docker use

/sbin/modprobe i915

chmod -R 0777 /dev/dri

# Start the Management Utility

/usr/local/sbin/emhttp &

 

Does anything have to be done with Emby server?

 

Thanks in advance.

 

 

Yes, have Emby Premiere and turn on Hardware Transcoding in Emby. Set it to Advanced to see if the iGPU is correctly setup

image.thumb.png.e6e558171ce0c52771410d9e379defa9.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.