# This line is to have VoWi accept the file, since files starting with #!/bin/bash are not allowed for some reason. Delete this line to make the script work. #!/bin/bash # Installer script to setup the packages for Vulkan development on Fedora (dnf package manager). # Requires superuser privileges (sudo). # This script was tested on a fresh installation of Fedora KDE Workstation 43, with only Jetbrains Toolbox, # IntelliJ and CLion installed beforehand; it should work on any recent-enough Fedora installation. # Since Fedora ships with Vulkan drivers, no drivers will be installed by this script. # The script assumes an x86_64 system. AARM or similar alternative architectures will require some tweaking. # Install packages: # - C++ and some miscellaneous required packages # - Vulkan development libraries # - Python, QT and associated libaries for the Vulkan SDK # - XCB and Wayland libraries for the Vulkan SDK # - Other libraries for the Vulkan SDK # - Vulkan runtime dependencies echo "[Vulkan Installer] Installing required packages..." sudo dnf update sudo dnf -y install \ @development-tools git wget xz zip gcc gcc-g++ gdb make cmake ninja-build \ vulkan-loader-devel vulkan-tools vulkan-utility-libraries-devel vulkan-validation-layers \ python3 python3-distutils-extra python3-jsonschema qt qt5-qtbase-devel qt6-qtbase-devel \ libxcb libxcb-devel xcb-util xcb-util-keysyms-devel xcb-util-wm-devel wayland-devel wayland-protocols-devel \ glm-devel libpciaccess-devel libpng-devel libX11-devel libXpresent libXrandr-devel libzstd-devel lz4-devel \ xinput libXinerama xcb-util-cursor # Read version and install location read -r -p "[Vulkan Installer] Enter the Vulkan version (\"1.x.yy.z\") you want to install: " VULKAN_VERSION read -r -p "[Vulkan Installer] Enter the path where the Vulkan files should be stored [/var/vulkan]: " VULKAN_PATH VULKAN_PATH=${VULKAN_PATH:-/var/vulkan} sudo mkdir -p "$VULKAN_PATH" # Download and extract Vulkan SDK echo "[Vulkan Installer] Downloading Vulkan SDK $VULKAN_VERSION..." sudo wget -O "$VULKAN_PATH/vulkan.tar.xz" "https://sdk.lunarg.com/sdk/download/$VULKAN_VERSION/linux/vulkansdk-linux-x86_64-$VULKAN_VERSION.tar.xz" echo "[Vulkan Installer] Extracting Vulkan SDK..." sudo tar -C "$VULKAN_PATH" -xf "$VULKAN_PATH/vulkan.tar.xz" echo "[Vulkan Installer] Deleting downloaded Vulkan SDK archive..." sudo rm "$VULKAN_PATH/vulkan.tar.xz" # Set environment variables echo "[Vulkan Installer] Setting Vulkan environment variables..." sudo touch /etc/profile.d/vulkan.sh sudo chmod 644 /etc/profile.d/vulkan.sh # Use sudo sh -c here so that the whole thing, including the >>, runs as superuser sudo sh -c 'echo "export VULKAN_SDK=\"'"$VULKAN_PATH/$VULKAN_VERSION/x86_64"'\"" >> /etc/profile.d/vulkan.sh' sudo sh -c 'echo "export PATH=\"\$VULKAN_SDK/bin:\$PATH\"" >> /etc/profile.d/vulkan.sh' sudo sh -c 'echo "export LD_LIBRARY_PATH=\"\$VULKAN_SDK/lib\"" >> /etc/profile.d/vulkan.sh' sudo sh -c 'echo "export VK_LAYER_PATH=\"\$VULKAN_SDK/share/vulkan/explicit_layer.d\"" >> /etc/profile.d/vulkan.sh' sudo sh -c 'echo "export VK_ADD_LAYER_PATH=\"\$VULKAN_SDK/share/vulkan/explicit_layer.d\"" >> /etc/profile.d/vulkan.sh' sudo sh -c 'echo "export PKG_CONFIG_PATH=\"\$VULKAN_SDK/lib/pkgconfig/\"" >> /etc/profile.d/vulkan.sh' echo "[Vulkan Installer] Done! You might need to restart your shell or your computer for the changes to take full effect."