From 4745638f18e07979a0a2e60c0d2d4f290221b58c Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Mon, 7 Feb 2022 11:43:57 +0200 Subject: [PATCH] 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 Reviewed-by: Daniel Stone Part-of: --- .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"