User Tools

Site Tools


ubuntu:gpu:vulkan:vulkan_try_new_version

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:gpu:vulkan:vulkan_try_new_version [2023/08/02 22:49] peterubuntu: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 ======
  
-===== Download latest Vulkan-Tools =====+Vulkan applications interact with Vulkan drivers through the loader.
  
-  * https://github.com/KhronosGroup/Vulkan-Tools +  * The loader is responsible for supporting multiple GPUs and their drivers
-  * https://github.com/KhronosGroup/Vulkan-Tools/tree/main.+  * For supporting the latest Vulkan API version, the loader also needs to be the matching version.
  
-or+More information about the loader is available here: [[https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md|Vulkan Loader]]
  
-<code bash> +The upstream Vulkan loader source code is available in the following git repos: 
-git clone https://github.com/KhronosGroup/Vulkan-Tools.git + 
-</code>+  * [[https://github.com/KhronosGroup/Vulkan-Headers|Vulkan Headers]] 
 +  * [[https://github.com/KhronosGroup/Vulkan-Loader|Vulkan Loader]] 
 +  * [[https://github.com/KhronosGroup/Vulkan-Tools|Vulkan Tools]]
  
 ---- ----
  
-===== Extract to a temporary directory =====+==== Vulkan Validation Layers ====
  
-Chdir to that temporary directory.+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://github.com/KhronosGroup/Vulkan-ValidationLayers|Vulkan Validation Layers]]
  
-===== Build =====+----     
 + 
 +===== Build the loader =====
  
 <code bash> <code bash>
-sudo apt update && sudo apt install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev cmake +sudo apt-get update && sudo apt-get install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev cmake 
 +git clone https://github.com/KhronosGroup/Vulkan-Loader.git 
 +cd Vulkan-Loader
 mkdir build mkdir build
 cd build cd build
-../scripts/update_deps.py+python ../scripts/update_deps.py 
 +cmake -C helper.cmake .. 
 +cmake --build . 
 +</code>
  
 +or for tests...
  
-  cmake -DCMAKE_BUILD_TYPE=Release -DVULKAN_HEADERS_INSTALL_DIR=$(pwd)/Vulkan-Headers/build/install .. +<code bash> 
-  make -j8+cmake -D UPDATE_DEPS=ON -D BUILD_TESTS=ON .. 
 +cmake --build .
  
-or +ctest 
-  cmake -C helper.cmake .. +</code>
-  cmake --build . +
-   +
-   +
-To use the newly built loader:+
  
-  export LD_LIBRARY_PATH=$(pwd)/loader   +or for install...
  
-or  +<code bash> 
-   +sudo apt-get update && sudo apt-get install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev cmake 
-  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json vulkaninfo --summary +git clone https://github.com/KhronosGroup/Vulkan-Loader.git 
-  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json /home/peter/Downloads/0/a/Vulkan-Tools-main/build/vulkaninfo/vulkaninfo --summary +cd Vulkan-Loader && mkdir build && cd build 
-  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json /home/peter/Downloads/0/a/Vulkan-Tools-main/build/vulkaninfo/vulkaninfo | grep driver+python3 ../scripts/update_deps.py 
 +cmake -DCMAKE_BUILD_TYPE=Release -DVULKAN_HEADERS_INSTALL_DIR=$(pwd)/Vulkan-Headers/build/install .
 +make -j8 
 +</code> 
 + 
 +<WRAP info> 
 +**NOTE:**  Detailed instructions are available in [[https://github.com/KhronosGroup/Vulkan-Loader/blob/master/BUILD.md|Vulkan-Loader/BUILD.md]] 
 + 
 +  * Optionally instead of the 2 last lines use this instead: <code bash> 
 +cmake -C helper.cmake .. 
 +cmake --build . 
 +</code> 
 + 
 +  * **CMAKE_BUILD_TYPE**:  can be **Release** or **Debug**. 
 +  * **VULKAN_HEADERS_INSTALL_DIR**:  the absolute path to a Vulkan-Headers install directory must be provided. 
 +  * **CMAKE_INSTALL_PREFIX**:  to customize the install location also modifies the loader search paths to include searching for layers in the specified install location. 
 +    * 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 /tmp/build/etc/vulkan/explicit_layer.d and /tmp/build/share/vulkan/explicit_layer.d for the layer JSON files. 
 +    * The loader also searches the "standard" system locations of /etc/vulkan/explicit_layer.d and /usr/share/vulkan/explicit_layer.d after searching the two locations under /tmp/build
 +    * Then run make install as before, which will install the files in /tmp/build <code bash>sudo make install</code> 
 + 
 +</WRAP> 
 + 
 + 
 +---- 
 + 
 +====== Use the newly built loader ====== 
 + 
 +To use the newly built loader: 
 + 
 +<code bash> 
 +export LD_LIBRARY_PATH=$(pwd)/loader
 </code> </code>
  
Line 68: Line 107:
  
 ===== Test ===== ===== Test =====
 +
 +<code bash>
 +  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json vulkaninfo --summary
 +  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json /home/peter/Downloads/0/a/Vulkan-Tools-main/build/vulkaninfo/vulkaninfo --summary
 +  VK_ICD_FILENAMES=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/icd/VkICD_mock_icd.json /home/peter/Downloads/0/a/Vulkan-Tools-main/build/vulkaninfo/vulkaninfo | grep driver
 +</code>
  
  
Line 80: Line 125:
 LD_LIBRARY_PATH=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/Vulkan-Loader/build/loader/ vulkaninfo | grep driver LD_LIBRARY_PATH=/home/peter/Downloads/0/a/Vulkan-Tools-main/build/Vulkan-Loader/build/loader/ vulkaninfo | grep driver
 </code> </code>
 +
 +----
 +
 +===== Test =====
 +
 +A test suite for the Vulkan loader.
 +
 +<code bash>
 +ctest
 +</code>
 +
 +returns:
 +
 +<code bash>
 +Test project /home/peter/Downloads/0/a/Vulkan-Loader-main/build
 +        Start   1: Allocation.Instance
 +  1/538 Test   #1: Allocation.Instance .............................................................................   Passed    0.01 sec
 +        Start   2: Allocation.GetInstanceProcAddr
 +  2/538 Test   #2: Allocation.GetInstanceProcAddr ..................................................................   Passed    0.01 sec
 +        Start   3: Allocation.EnumeratePhysicalDevices
 +  3/538 Test   #3: Allocation.EnumeratePhysicalDevices .............................................................   Passed    0.01 sec
 +        Start   4: Allocation.InstanceAndDevice
 +  4/538 Test   #4: Allocation.InstanceAndDevice ....................................................................   Passed    0.01 sec
 +        Start   5: Allocation.InstanceButNotDevice
 +  5/538 Test   #5: Allocation.InstanceButNotDevice .................................................................   Passed    0.01 sec
 +        Start   6: Allocation.DeviceButNotInstance
 +...
 +...
 +100% tests passed, 0 tests failed out of 538
 +
 +Total Test time (real) =  10.89 sec
 +</code>
 +
 +----
 +
 +===== References =====
 +
 +https://developer.nvidia.com/embedded/vulkan
 +
 +https://github.com/KhronosGroup/Vulkan-Headers
 +
 +https://github.com/KhronosGroup/Vulkan-Loader
 +
 +https://github.com/KhronosGroup/Vulkan-Tools
 +
 +https://github.com/KhronosGroup/Vulkan-Loader/blob/main/loader/LoaderAndLayerInterface.md
 +
 +https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderInterfaceArchitecture.md
 +
 +https://github.com/KhronosGroup/Vulkan-Loader/blob/master/BUILD.md
 +
 +https://github.com/KhronosGroup/Vulkan-ValidationLayers
 +
 +https://www.khronos.org/conformance/adopters/conformant-products
 +
 +
ubuntu/gpu/vulkan/vulkan_try_new_version.1691016557.txt.gz · Last modified: 2023/08/02 22:49 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki