Linux Tech Tips EP#20: Building Mesa from source with custom patches to test Raytracing performance
Compiling custom Mesa with pending MR's to test Raytracing performance. The "Implement monolithic pipelines" MR seem to be a nice uplift on Raytracing performance in the games I tested.
==Time Stamps==
0:00 Intro
0:16 Test setup
0:37 Test description
0:47 Building your custom Mesa
3:35 Raytracing Benchmark Results
==Setup Notes==
You can use this guide - https://gist.github.com/Venemo/a9483106565df3a83fc67a411191edbd
Step 1. Install dependencies - use your distro's package manager
Step 2. Clone the mesa repo
mkdir -p ~/Projects
cd ~/Projects
git clone https://gitlab.freedesktop.org/mesa/mesa.git
Step 3. Add your custom patches
Download and save them into the newly created mesa folder - /home/YOURUSERNAME/Projects/mesa/
I used these - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21929 and https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24720
use "git apply" to apply diffs
git apply 21929.diff
git apply 24720.diff
Step 4. Create your 64-bit build
meson build64 --libdir lib64 --prefix $HOME/mesa -Dgallium-drivers=radeonsi,swrast,zink -Dvulkan-drivers=amd -Dgallium-nine=true -Dosmesa=false -Dbuildtype=release
ninja -C build64 install
Step 5. Verify build completed
cd ~/mesa && ls -la
Step 6. Using the compiled mesa binaries with a script
nano ~/mesa-run.sh
*If you used a different install prefix or a different lib dir above, you will need to adjust this script accordingly.
Step 6.1 Add the below to your script:
#!/bin/sh
MESA=$HOME/mesa \
LD_LIBRARY_PATH=$MESA/lib64:$MESA/lib:$LD_LIBRARY_PATH \
LIBGL_DRIVERS_PATH=$MESA/lib64/dri:$MESA/lib/dri \
VK_ICD_FILENAMES=$MESA/share/vulkan/icd.d/radeon_icd.x86_64.json:$MESA/share/vulkan/icd.d/radeon_icd.x86.json \
D3D_MODULE_PATH=$MESA/lib64/d3d/d3dadapter9.so.1:$MESA/lib/d3d/d3dadapter9.so.1 \
exec "$@"
Step 6.2 Don't forget to add executable permissions to the script: chmod +x ~/mesa-run.sh
Now you can run your games like: ~/mesa-run.sh vkcube
Step 7. Using the new Mesa driver for testing
Lutris
- Configure - System Options - Vulkan ICD loader - Unspecified
- save and exit, and then:
./mesa-run.sh lutris
Heroic
./mesa-run.sh /opt/Heroic/heroic %U
or if you have a heroic alias defined
./mesa-run.sh heroic
Steam
VK_DRIVER_FILES=$HOME/mesa/share/vulkan/icd.d/radeon_icd.x86_64.json:$HOME/mesa/share/vulkan/icd.d/radeon_icd.x86.json %command%
Other Videos By CTRL ALT REBOOT
Other Statistics
Doom Eternal Statistics For CTRL ALT REBOOT
CTRL ALT REBOOT presently has 1,018 views for Doom Eternal across 1 video, and less than an hour worth of Doom Eternal videos were uploaded to his channel. This makes up less than 0.20% of the total overall content on CTRL ALT REBOOT's YouTube channel.