summarylogtreecommitdiffstats
path: root/progl
blob: a872bc65bdbba7fcd09eb5d450dba70a813ec5c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

# This script applies amdgpu-pro OpenGL driver for specific application.
# For example, running "$ progl davinci-resolve" will start DR with AMDGPU PRO driver.
# You can test the difference (GL_VENDOR, GL_RENDERER, GL_VERSION) with glmark2 utility.

progl() {
    export LD_LIBRARY_PATH="/usr/lib/amdgpu-pro/:${LD_LIBRARY_PATH}"
#   export LIBGL_DRIVERS_PATH="/usr/lib/dri/" # unneeded, because already a system path
}

progl32() {
    export LD_LIBRARY_PATH="/usr/lib32/amdgpu-pro/:${LD_LIBRARY_PATH}"
#   export LIBGL_DRIVERS_PATH="/usr/lib32/dri/" # unneeded, because already a system path
}

# export dri_driver="amdgpu" # Do not know if needed, there is already a file in drirc.d, is not it sufficient?


if [[ $(basename $0) == progl ]]; then
    progl
elif [[ $(basename $0) == progl32 ]]; then
    progl32
else
    echo "Unknown function"
    exit 1
fi

# applied variables, now execute the rest of the command
"$@"