How to set LIBVA_DRIVER... variables to have video hardware acceleration by default for all users?

There are several discussions on the topic and a lot of confusion. The idea I have is that by setting the LIBVA_DRIVERS_PATH variable in libva.sh you should have hardware video acceleration available by default for all users. I read somewhere that, once the variable has been set, the file must be made executable with the “chmod +x” command, but I don’t know if this is really necessary. Anyway, this procedure should avoid requiring you to set the LIBVA_DRIVER_NAME variable (but I’m not sure about that either).
Let me know yours!

I’ll try to summarize (with an example) what you wrote in another way (correct me if I’m wrong):

sudo dnf install intel-media-driver
sudo nano /etc/profile.d/libva.sh

export LIBVA_DRIVERS_PATH=/usr/lib/dri/iHD_drv_video.so
export LIBVA_DRIVER_NAME=iHD

Did we write the same thing? @vgaetera

Another option is to create a file in /etc/environment.d/. See man environment.d.

That is indeed not necessary. The profile.d drop-ins are sourced, not executed.

In this case I should create a *.conf file with:

LIBVA_DRIVERS_PATH=…
LIBVA_DRIVER_NAME=…

Am I right?

@chrisawi @vgaetera

Thank you for your precious support!