Mesa (main): ci: Ensure Mesa Shader Cache resides on tmpfs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 17 07:43:50 UTC 2022


Module: Mesa
Branch: main
Commit: 4745638f18e07979a0a2e60c0d2d4f290221b58c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4745638f18e07979a0a2e60c0d2d4f290221b58c

Author: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
Date:   Mon Feb  7 11:43:57 2022 +0200

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 at collabora.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14995>

---

 .gitlab-ci/deqp-runner.sh          | 9 +++++++++
 .gitlab-ci/piglit/piglit-runner.sh | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/.gitlab-ci/deqp-runner.sh b/.gitlab-ci/deqp-runner.sh
index c4a6cec5ba1..1bdcef58942 100755
--- a/.gitlab-ci/deqp-runner.sh
+++ b/.gitlab-ci/deqp-runner.sh
@@ -20,6 +20,15 @@ export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_C
 RESULTS=`pwd`/${DEQP_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}
+}
+
 HANG_DETECTION_CMD=""
 
 if [ -z "$DEQP_SUITE" ]; then
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"



More information about the mesa-commit mailing list