ubuntu:gpu:vulkan:vulkan_try_new_version
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:gpu:vulkan:vulkan_try_new_version [2023/08/02 22:56] – peter | ubuntu:gpu:vulkan:vulkan_try_new_version [2023/08/03 00:14] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubuntu - GPU - Vulkan - Vulkan Try New Version ====== | ====== Ubuntu - GPU - Vulkan - Vulkan Try New Version ====== | ||
+ | |||
+ | Vulkan applications interact with Vulkan drivers through the loader. | ||
+ | |||
+ | * The loader is responsible for supporting multiple GPUs and their drivers. | ||
+ | * For supporting the latest Vulkan API version, the loader also needs to be the matching version. | ||
+ | |||
+ | More information about the loader is available here: [[https:// | ||
The upstream Vulkan loader source code is available in the following git repos: | The upstream Vulkan loader source code is available in the following git repos: | ||
Line 6: | Line 13: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | | + | |
+ | ---- | ||
+ | |||
+ | ==== Vulkan Validation Layers ==== | ||
+ | |||
+ | The loader also supports the Vulkan validation layers, which are optional components that augment the Vulkan system. | ||
+ | |||
+ | * Layers can intercept, evaluate, and modify existing Vulkan functions on their way from the application down to the hardware. | ||
+ | * Layers are a critical component of developing correct Vulkan applications. | ||
+ | * More information about the validation layers is available here: [[https:// | ||
---- | ---- | ||
+ | |||
+ | ===== Build the loader ===== | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get update && sudo apt-get install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev cmake | ||
+ | git clone https:// | ||
+ | cd Vulkan-Loader | ||
+ | mkdir build | ||
+ | cd build | ||
+ | python ../ | ||
+ | cmake -C helper.cmake .. | ||
+ | cmake --build . | ||
+ | </ | ||
+ | |||
+ | or for tests... | ||
+ | |||
+ | <code bash> | ||
+ | cmake -D UPDATE_DEPS=ON -D BUILD_TESTS=ON .. | ||
+ | cmake --build . | ||
+ | |||
+ | ctest | ||
+ | </ | ||
+ | |||
+ | or for install... | ||
<code bash> | <code bash> | ||
Line 13: | Line 54: | ||
git clone https:// | git clone https:// | ||
cd Vulkan-Loader && mkdir build && cd build | cd Vulkan-Loader && mkdir build && cd build | ||
- | ../ | + | python3 |
cmake -DCMAKE_BUILD_TYPE=Release -DVULKAN_HEADERS_INSTALL_DIR=$(pwd)/ | cmake -DCMAKE_BUILD_TYPE=Release -DVULKAN_HEADERS_INSTALL_DIR=$(pwd)/ | ||
make -j8 | make -j8 | ||
</ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * Optionally instead of the 2 last lines use this instead: <code bash> | ||
+ | cmake -C helper.cmake .. | ||
+ | cmake --build . | ||
+ | </ | ||
+ | |||
+ | * **CMAKE_BUILD_TYPE**: | ||
+ | * **VULKAN_HEADERS_INSTALL_DIR**: | ||
+ | * **CMAKE_INSTALL_PREFIX**: | ||
+ | * The default value for CMAKE_INSTALL_PREFIX is /usr/local, which would be used if you do not specify CMAKE_INSTALL_PREFIX. | ||
+ | * Setting CMAKE_INSTALL_PREFIX to /tmp/build causes the loader to search / | ||
+ | * The loader also searches the " | ||
+ | * Then run make install as before, which will install the files in /tmp/build <code bash> | ||
+ | |||
+ | </ | ||
+ | |||
---- | ---- | ||
Line 44: | Line 104: | ||
</ | </ | ||
+ | ---- | ||
+ | ===== Test ===== | ||
- | ==== | + | <code bash> |
+ | VK_ICD_FILENAMES=/ | ||
+ | VK_ICD_FILENAMES=/ | ||
+ | VK_ICD_FILENAMES=/ | ||
+ | </ | ||
+ | <code bash> | ||
+ | LD_LIBRARY_PATH=/ | ||
+ | LD_LIBRARY_PATH=/ | ||
+ | LD_LIBRARY_PATH=/ | ||
+ | LD_LIBRARY_PATH=/ | ||
+ | </ | ||
+ | ---- | ||
- | ===== Download latest Vulkan-Tools | + | ===== Test ===== |
- | * https:// | + | A test suite for the Vulkan |
- | * https:// | + | |
- | + | ||
- | or | + | |
<code bash> | <code bash> | ||
- | git clone https:// | + | ctest |
</ | </ | ||
- | ---- | + | returns: |
- | + | ||
- | ===== Extract to a temporary directory ===== | + | |
- | + | ||
- | Chdir to that temporary directory. | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Build ===== | + | |
<code bash> | <code bash> | ||
- | sudo apt update && sudo apt install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev cmake | + | Test project / |
+ | Start 1: Allocation.Instance | ||
+ | 1/538 Test #1: Allocation.Instance ............................................................................. | ||
+ | Start 2: Allocation.GetInstanceProcAddr | ||
+ | 2/538 Test #2: Allocation.GetInstanceProcAddr .................................................................. | ||
+ | Start 3: Allocation.EnumeratePhysicalDevices | ||
+ | 3/538 Test #3: Allocation.EnumeratePhysicalDevices ............................................................. | ||
+ | Start 4: Allocation.InstanceAndDevice | ||
+ | 4/538 Test #4: Allocation.InstanceAndDevice .................................................................... | ||
+ | Start 5: Allocation.InstanceButNotDevice | ||
+ | 5/538 Test #5: Allocation.InstanceButNotDevice ................................................................. | ||
+ | Start 6: Allocation.DeviceButNotInstance | ||
+ | ... | ||
+ | ... | ||
+ | 100% tests passed, 0 tests failed out of 538 | ||
- | mkdir build | + | Total Test time (real) = |
- | cd build | + | |
- | ../ | + | |
- | + | ||
- | + | ||
- | cmake -DCMAKE_BUILD_TYPE=Release -DVULKAN_HEADERS_INSTALL_DIR=$(pwd)/ | + | |
- | make -j8 | + | |
- | + | ||
- | or | + | |
- | cmake -C helper.cmake .. | + | |
- | cmake --build . | + | |
- | + | ||
- | + | ||
- | To use the newly built loader: | + | |
- | + | ||
- | export LD_LIBRARY_PATH=$(pwd)/ | + | |
- | + | ||
- | or | + | |
- | + | ||
- | VK_ICD_FILENAMES=/ | + | |
- | VK_ICD_FILENAMES=/ | + | |
- | VK_ICD_FILENAMES=/ | + | |
</ | </ | ||
- | |||
---- | ---- | ||
- | ===== Test ===== | + | ===== References |
+ | https:// | ||
- | <code bash> | + | https://github.com/KhronosGroup/Vulkan-Headers |
- | LD_LIBRARY_PATH=/home/peter/ | + | |
+ | https:// | ||
- | LD_LIBRARY_PATH=/home/peter/ | + | https://github.com/KhronosGroup/ |
- | LD_LIBRARY_PATH=/home/peter/Downloads/ | + | https://github.com/KhronosGroup/Vulkan-Loader/blob/main/loader/LoaderAndLayerInterface.md |
- | LD_LIBRARY_PATH=/home/peter/Downloads/ | + | https://github.com/KhronosGroup/ |
- | </code> | + | |
- | ---- | + | https:// |
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
- | ===== References ===== | ||
- | https:// |
ubuntu/gpu/vulkan/vulkan_try_new_version.1691016988.txt.gz · Last modified: 2023/08/02 22:56 by peter