summaryrefslogtreecommitdiff
path: root/.gitlab-ci/piglit
diff options
context:
space:
mode:
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>2022-02-07 11:43:57 +0200
committerMarge Bot <emma+marge@anholt.net>2022-02-17 06:32:30 +0000
commit4745638f18e07979a0a2e60c0d2d4f290221b58c (patch)
treef658635538e0f8161b6687cd53f77b9d851c721d /.gitlab-ci/piglit
parent8e138b8bd14d988c2d99a569fdb6b475e8e4f059 (diff)
ci: Ensure Mesa Shader Cache resides on tmpfs
Having the Mesa Shader Cache stored on a tmpfs mount point reduces the tests execution duration by 2-3 %, while preventing several hundreds of megabytes to be written on the storage media. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>
Diffstat (limited to '.gitlab-ci/piglit')
-rwxr-xr-x.gitlab-ci/piglit/piglit-runner.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/.gitlab-ci/piglit/piglit-runner.sh b/.gitlab-ci/piglit/piglit-runner.sh
index e07f2b7882b..6f537c95b5a 100755
--- a/.gitlab-ci/piglit/piglit-runner.sh
+++ b/.gitlab-ci/piglit/piglit-runner.sh
@@ -17,6 +17,15 @@ export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_C
RESULTS=`pwd`/${PIGLIT_RESULTS_DIR:-results}
mkdir -p $RESULTS
+# Ensure Mesa Shader Cache resides on tmpfs.
+GLSL_CACHE_HOME=${XDG_CACHE_HOME:-${HOME}/.cache}
+GLSL_CACHE_DIR=${MESA_GLSL_CACHE_DIR:-${GLSL_CACHE_HOME}/mesa_shader_cache}
+
+findmnt -n tmpfs ${GLSL_CACHE_HOME} || findmnt -n tmpfs ${GLSL_CACHE_DIR} || {
+ mkdir -p ${GLSL_CACHE_DIR}
+ mount -t tmpfs -o nosuid,nodev,size=2G,mode=1755 tmpfs ${GLSL_CACHE_DIR}
+}
+
if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
# deqp is to use virpipe, and virgl_test_server llvmpipe
export GALLIUM_DRIVER="$GALLIUM_DRIVER"