Linux Tech Tips EP#20: Building Mesa from source with custom patches to test Raytracing performance

Subscribers:
1,170
Published on ● Video Link: https://www.youtube.com/watch?v=_O1SCfv2PKc



Doom Eternal
Game:
Duration: 5:30
1,018 views
38


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


2023-11-10Gaming on Linux EP#119: The Invincible | First Look | 3700X 6600XT
2023-11-04Gaming on Linux EP#118: Robocop Rogue City | Linux vs Windows | 3700X 6600XT
2023-10-31Linux Tech Tips EP#22: Installing CyberFSR in Alan Wake 2 | Optimization
2023-10-29Gaming on Linux EP#117: Alan Wake 2 | Linux vs Windows | 3700X 6600XT
2023-10-23Gaming on Linux EP#116: Tribe: Primitive Builder | First Look | 3700X 6600XT
2023-10-15Linux Tech Tips EP#21: Testing Mangohud Alternatives
2023-10-14Gaming on Linux EP#115: Lords of the Fallen 2023 | UE5 | 3700X 6600XT
2023-10-05Gaming on Linux EP#114: Robocop Rogue City Demo | UE5 | 3700X 6600XT
2023-10-01Gaming on Linux EP#113: Soulstice | First Look | 3700X 6600XT
2023-09-30Gaming on Linux EP#112: Cyberpunk 2077 2.0 Update | SMT Sucks on my Zen 2 | 3700X 6600XT
2023-09-09Linux Tech Tips EP#20: Building Mesa from source with custom patches to test Raytracing performance
2023-09-02Gaming on Linux EP#111: Starfield | Linux vs Windows | 3700X 6600XT
2023-08-26Gaming on Linux EP#110: Forspoken Tested | Linux vs Windows | NVME vs SSD vs HDD | 3700X 6600XT
2023-08-23Gaming on Linux EP#109: Daymare: 1994 Sandcastle | Steam | Demo | 3700X 6600XT
2023-08-23Gaming on Linux EP#108: Fort Solis | Linux vs Windows 10 | Steam | UE5 | 3700X 6600XT
2023-08-20Linux Tech Tips EP#19: Enable Raytracing in Ratchet and Clank | AMD to Nvidia GPU Spoofing
2023-08-19Gaming on Linux EP#107: Shadow Gambit: The Cursed Crew | Steam | Demo | 3700X 6600XT
2023-08-11Gaming on Linux EP#106: Atlas Fallen | Steam | Linux vs Windows 10 | 3700X 6600XT
2023-08-05Gaming on Linux EP#105: Baldur's Gate 3 | Steam | 3700X 6600XT
2023-08-04Gaming on Linux EP#104: Atomic Heart | Linux vs Windows | 3700X 6600XT
2023-07-29Gaming on Linux EP#103 Part 2: Ratchet & Clank: Rift Apart | Linux vs Windows | Portal Sequence



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.