Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux and Wayland - build scripts are very broken (list of fixes to make it work) #10

Closed
danilw opened this issue Mar 18, 2025 · 6 comments

Comments

@danilw
Copy link

danilw commented Mar 18, 2025

Manual fixes required to make it work:

Modify:

  1. NRISamples/External/NRIFramework/External/NRI - apply this - Fix detection of wayland-client.h NRI#123
  2. NRISamples/External/NRIFramework/External/NRI - apply this - Fix Linux gcc14 build NRIFramework#11

Now you can build - but it wont work (under Wayland for more info - read #11 ).

Continue:

  1. Turn off Wayland completely - in cmake-gui or in config cmake files (of NRISamples) set these to off:

Image

  1. NRISamples/External/NRIFramework/External/NRI/Source/VK/SwapChainVK.hpp - line 96 edit to:
    // Surface caps
    uint32_t textureNum = 3;

Yes this problem can point on - "something wrong with NRI framework" or detection of number of swapchain images - I have no idea - if you want debug it.

Now it will build and can work under xcb/x11 (in Wayland also work).
But in system with multiple GPU - it will select:

Image

Wrong CPU-emulation or integrated GPU.

To select discrete Nvidia GPU:

This app NRISamples does not have way to select GPU so:

Create file nvidia_icd.json

{
    "file_format_version" : "1.0.0",
    "ICD": {
        "library_path": "/usr/lib64/libGLX_nvidia.so.0",
        "api_version" : "1.3.211"
    }
}

And run:

export VK_ICD_FILENAMES="nvidia_icd.json"
_Bin/Triangle

or for AMD

export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json

Youl see in output:
Image

And it works.

@dzhdanNV
Copy link
Collaborator

Thanks! Very appreciate the structured report!

Fixed. Please, re-clone from scratch and test again:

  1. Fix detection of wayland-client.h NRI#123 - integrated
  2. Fix Linux gcc14 build NRIFramework#11 - partially manually integrated (the problem has been solved in another way on MathLib side)
  3. Turn off Wayland completely - turned off in CMake file
  4. VK swap chain now silently clamps user-provided SwapChainDesc::textureNum to the supported range
  5. Multiple GPUs: modern NRI must put discrete adapters in the beginning of the list

@dzhdanNV
Copy link
Collaborator

Turn off Wayland completely - turned off in CMake file

Added NRIF_USE_WAYLAND which is OFF by default.

@danilw
Copy link
Author

danilw commented Mar 19, 2025

Tested - cloning repo git clone https://github.com/NVIDIA-RTX/NRISamples --recursive
and building - it works and no error messages

Multiple GPUs: modern NRI must put discrete adapters in the beginning of the list

I have 3 GPU listed for Vulkan: (not in order, order is random - Vulkan):

  1. llvmpipe
  2. integrated iGPU (amd)
  3. discrete Nvidia

Every other Vulkan app/demo/sample even vkcube correctly - and works/run obviously:

> vkcube
Selected WSI platform: xcb
Selected GPU 0: NVIDIA GeForce RTX 4060, type: DiscreteGpu

> vkcube --wsi wayland
Selected GPU 0: NVIDIA GeForce RTX 4060, type: DiscreteGpu

This NRISamples for every sample:

> _Bin/Triangle
Creating borderless window (1920, 1080)
Loading...
nri::INFO (DeviceVK.hpp:151) - VK::llvmpipe (LLVM 19.1.7, 256 bits) - Supported instance extensions:

Without set of VK_ICD_FILENAMES - it wont select anything else.

llvmpipe is CPU type https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceType.html VK_PHYSICAL_DEVICE_TYPE_CPU

> vkcube --gpu_number 2
Selected WSI platform: xcb
Selected GPU 2: llvmpipe (LLVM 19.1.7, 256 bits), type: Cpu

@dzhdanNV
Copy link
Collaborator

Thanks for verifications! Yes, I have realized that it's not DISCRETE and not INTEGRATED. I will improve NRI code tomorrow (sorry, it's too late for me today).

P.S. Thanks a ton for valuable posts!

@dzhdanNV
Copy link
Collaborator

If you have a minute (but I don't insist) could you, please, close this issue and create another one in NRI repo for wrong classification of llvmpipe?

@danilw
Copy link
Author

danilw commented Mar 19, 2025

NVIDIA-RTX/NRI#124

@danilw danilw closed this as completed Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants