how do I setup VULKAN_SDK environment variables in Debian/Raspberry Pi Os
0
votes
2
answers
112
views
First things first; I am new to Linux and I don't understand a lot of things.
I'm working on a Raspberry Pi OS which is Debian based.
There is a file with environment variables: "setup-env.sh".
Execute the code in the terminal:
source ~/vulkan/1.x.yy.z/setup-env.sh
And we are in business.
Except after I reboot, obviously. So how can I set up these environment variables automatically at boot? I am finding a lot of answers saying :
Except after I reboot, obviously. So how can I set up these environment variables automatically at boot? I am finding a lot of answers saying :
sudo ~/.bashrc
. But that gives me a "command not found" error. In the Vulkan docs they advise to implement it in *.profile*. But again sudo ~/.profile
is command not found on my Raspberry Pi OS.
And I found out the hard way that adding a PATH to /etc/environment
definitely doesn't brighten your day.
It seems so simpel, but most people/tutorials skip over it with the mention "*you are on Linux to you probably know how to.*"
These are the Vulkan docs if you wish to have a look:
https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
So what is the proper way to setup the VULKAN_SDK environment variables from the setup-env.sh
file at boot?
Thank you sincerely!
Here is the contents of the file *setup-env.sh*:
# Copyright (c) 2015-2023 LunarG, Inc.
# source this file into an existing shell to setup your environment.
#
# See docs for in depth documentation:
# https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
ARCH="$(uname -m)"
VULKAN_SDK="$(dirname "$(readlink -f "${BASH_SOURCE:-$0}" )" )/$ARCH"
export VULKAN_SDK
PATH="$VULKAN_SDK/bin:$PATH"
export PATH
LD_LIBRARY_PATH="$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
VK_ADD_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d${VK_ADD_LAYER_PATH:+:$VK_ADD_LAYER_PATH}"
export VK_ADD_LAYER_PATH
if [ -n "${VK_LAYER_PATH-}" ]; then
echo "Unsetting VK_LAYER_PATH environment variable for SDK usage"
unset VK_LAYER_PATH
fi
Asked by Desert Wind
(21 rep)
Mar 7, 2025, 06:53 PM
Last activity: Mar 11, 2025, 04:12 PM
Last activity: Mar 11, 2025, 04:12 PM