wivrn: 0.19 -> 0.22

Re-take of https://github.com/NixOS/nixpkgs/pull/349910
@Titaniumtown
Things done
Package:
Update WiVRn version/hash.
Add dependencies (and optionals) for WiVRn, Monado, and the Qt dashboard.
Added a desktop item for the dashboard.
Added cmake flags.
Added patch for Monado and change to use upstream patch script.
Module:
Add options for server flags.
Refactor (it's a little easier to understand now).

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:x: 1 package failed to build:

wivrn

Unfortunately, there's a build issue that literally just popped up even there were no changes upstream: https://github.com/WiVRn/WiVRn/issues/154
I am currently using v0.20 on my desktop and it works fine, so I believe some package change in nixpkgs results in this error.

I'm getting this build error:
AutoRcc subprocess error
------------------------
The rcc process failed to compile
  "SRC:/build/.qt/rcc/wivrn-dashboard_translations.qrc"
into
  "SRC:/build/dashboard/wivrn-dashboard_autogen/GGJYZH3U72/qrc_wivrn-dashboard_translations.cpp"

Command
-------
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/libexec/rcc -name wivrn_dashboard_translations -o /build/source/build/dashboard/wivrn-dashboard_autogen/GGJYZH3U72/qrc_wivrn-dashboard_translations.cpp /build/source/build/.qt/rcc/wivrn-dashboard_translations.qrc

Output
------
RCC: Error in '/build/source/build/.qt/rcc/wivrn-dashboard_translations.qrc': Cannot find file '/build/source/build/dashboard/wivrn_en.qm'

Unfortunately, there's a build issue that literally just popped up even there were no changes upstream: WiVRn/WiVRn#154
I am currently using v0.20 on my desktop and it works fine, so I believe some package change in nixpkgs results in this error.

Looks like it is related to: https://github.com/WiVRn/WiVRn/commit/be95ec84b56794ca8d97bb8b21dec6443ba57bc4

Since its been like a week and there's been no response, I added the patch

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:white_check_mark: 1 package built:

wivrn

0.21 released!

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:white_check_mark: 2 packages built:

envision
wivrn

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:white_check_mark: 2 packages built:

envision
wivrn

Made some changes to the module:
Add options for server flags.
Refactor (it's a little easier to understand now).
I already tested it to confirm that it still functions the same:

Application attribute is not set -> application not set in config and not added to path
Application attribute is empty list -> application not set in config and not added to path
Application is a package -> application set in config and added to service path
Application is not a package -> asserts and notifies user
Application list first element is package (no extra strings) -> application set in config and added to service path
Application list first element is package (extra strings) -> application set in config with extra strings and added to service path
Application list first element is not package -> asserts and notifies user
Application is an attribute set -> asserts and notifies user

Rebased

'systemctl --user status wivrn'?

I can't seem to get wivrn to work. I can see the avahii daemon running, but I cannot find or see any of wivrn running. Games don't launch with it either, opencomposite says the openxr runtime isn't running.

I can reproduce, it's something to do with the avahi daemon. Running the daemon manually makes it work :p

Do you have wivrn.openFirewall set to true?

Rebased to resolve conflict

I can reproduce, it's something to do with the avahi daemon. Running the daemon manually makes it work :p

So I did give this a try but OpenComposite is still not picking up the runtime. I have also tried to use the dashboard to see if that help, but from the look of things, its just broken in this implementation. The connection wizard does not work and the dashboard seems to think there's an update

even skipping that the headset will connect then instantly disconnect on the server, but the client says its connected. I'm overall very confused with wivrn.

Do you have wivrn.openFirewall set to true?
And yes I do have this turned on

{ pkgs, ... }: {
    services.wivrn = {
        enable = true;
        package = pkgs.wivrnupdate-nixpkgs.wivrn;
        openFirewall = true;
        defaultRuntime = true;
        autoStart = true;
        config = {
            enable = true;
            json = {
                # 1.0x foveation scaling
                scale = 1.0;
                # 100 Mb/s
                bitrate = 100000000;
                encoders = [
                    {
                    encoder = "nvenc";
                    codec = "h265";
                    # 1.0 x 1.0 scaling
                    width = 1.0;
                    height = 1.0;
                    offset_x = 0.0;
                    offset_y = 0.0;
                    }
                ];
            };
        };
    };
}

I also have monado and envision both enabled in my configs

so egg on my face, turns out if I had actually properly read the log I would have been able to figure this out. NVENC doesn't work. like at all, its disabled according to the logs

NVENC doesn't work. like at all, its disabled according to the logs.

Do you have config.nixpkgs.cudaSupport set to true? This will enable build support for Nvenc. I should probably document that somewhere anyways
You can't really use the dashboard with the WiVRn module since the module configures the server using your nixified json. The false update discrepancy with the client shouldn't be caused by the WiVRn package or module, since we don't configure that, not sure that happened
As for the OpenComposite issues, that also shouldn't be an issue with this package/module, it is most likely a configuration issue and these can be hard to track. Just make sure that the openvrpaths.vrpaths file is correct (does not reference the SteamVR runtime), it should point to libopenxr_wivrn.so somewhere in the Nix store. The WiVRn does temporarily switch the active_runtime.json file at run time so you shouldn't need to worry about that.
If you still can't get OC to work, I have a home-manager module in another repository (https://github.com/PassiveLemon/lemonake/blob/master/modules/home-manager/steamvr/README.md) that can manage this file, might be worth checking out

Rebased to resolve conflict again

Do you have config.nixpkgs.cudaSupport set to true? This will enable build support for Nvenc. I should probably document that somewhere anyways
You can't really use the dashboard with the WiVRn module since the module configures the server using your nixified json. The false update discrepancy with the client shouldn't be caused by the WiVRn package or module, since we don't configure that, not sure that happened
As for the OpenComposite issues, that also shouldn't be an issue with this package/module, it is most likely a configuration issue and these can be hard to track. Just make sure that the openvrpaths.vrpaths file is correct (does not reference the SteamVR runtime), it should point to libopenxr_wivrn.so somewhere in the Nix store. The WiVRn does temporarily switch the active_runtime.json file at run time so you shouldn't need to worry about that.
If you still can't get OC to work, I have a home-manager module in another repository (https://github.com/PassiveLemon/lemonake/blob/master/modules/home-manager/steamvr/README.md) that can manage this file, might be worth checking out

Thank you for the help. I managed to get it working under software rendering. For some reason WiVRn just isn't building with cuda support enabled, I've probably messed up a config somewhere, but I happy to be finally understanding how this is mostly working together :)

I ended up getting cudaSupport enabled. Wivrn builds with it, but it never finishes building onnxruntime or opencv. Everytime I rebuild they almost finish building but then the build fails saying it was cancelled by the user. I don't know whether or not this is an issue with this package or not.

Not sure, cancelled usually means that you pressed ctrl-c on the terminal while it was building. Onnxruntime and opencv take sooooo long to build, I recommend setting up substituters if you don't have some already, I get a lot of cache hits in nix-community.cachix.org

Not sure, cancelled usually means that you pressed ctrl-c on the terminal while it was building.

unfortunately every time its happened I've either been lying on my bed, or eating some food with no inputs going to the terminal. it also happens at exactly the same time. so I know its not me. Maybe its just because it takes too long to build.

Onnxruntime and opencv take sooooo long to build, I recommend setting up substituters if you don't have some already, I get a lot of cache hits in nix-community.cachix.org

Would you be able to point me in the direction for that? I've not heard of subsitiuters before and I'm not sure where to start looking for that

I ended up getting cudaSupport enabled. Wivrn builds with it, but it never finishes building onnxruntime or opencv. Everytime I rebuild they almost finish building but then the build fails saying it was cancelled by the user. I don't know whether or not this is an issue with this package or not. I've tried to build both this PR and the current version in nixpkgs, both fail the same way

🤔 .. Really odd, I just tested it on my system and it didn't fail. But I am seeing in the logs while watching the systemd serivce it is saying NVENC support isn't enabled, even though I do indeed have NVENC enabled via cudaSupport. Will update when I get Beat Saber up and going to see if I get anything else crazy

Quick edit: Also really odd too in the GUI, when I restart it, it actually has NVENC greyed out as an option

Logs of the service running
Nov 27 21:28:27 ryzennova systemd[2310]: Started WiVRn XR runtime service.
Nov 27 21:28:27 ryzennova wivrn-server[1036702]: WiVRn 0.21.1 starting
Nov 27 21:28:27 ryzennova wivrn-server[1036702]: For Steam games, set command to PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%
Nov 27 21:28:28 ryzennova wivrn-server[1036702]: Service published: ryzennova
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Client connected
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Server started, PID 1037389
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_JSON_LOG=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: IPC_LOG=info (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [ipc_server_main]  '0.21.1' starting up...
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_LOG=warn (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: IPC_EXIT_ON_DISCONNECT=FALSE (off)
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Failed to issue method call: Unit wivrn-application.service not loaded.
Nov 27 21:28:57 ryzennova .wivrn-server-w[1036702]: ../glib/gmain.c:5892: waitid(pid:1037393, pidfd=12) failed: No child processes (10). See documentation of g_child_watch_source_new() for possible causes.
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Application exited, exit status 255
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [comp_main_create_system_compositor] Doing init 0x5633284df950
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_DEFAULT_FRAMERATE=60 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_COMPUTE=TRUE (1)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_DISTORTION_MIP_LEVELS=0 (0)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_XCB_DISPLAY=-1 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_XCB_FULLSCREEN=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_LOG=debug (debug)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_PRINT_MODES=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_GPU_INDEX=-1 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_CLIENT_GPU_INDEX=-1 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_DESIRED_MODE=-1 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_SCALE_PERCENTAGE=100 (100)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_NVIDIA_DISPLAY=(null) (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_NVIDIA=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_VK_DISPLAY=-1 (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_RANDR=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_WAYLAND_DIRECT=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_XCB=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_FORCE_WAYLAND=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  WARN [compositor_check_and_prepare_xdev] Had to fill in meshuv on xdev 'WiVRn HMD', this should be done in the driver.
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: XRT_COMPOSITOR_DISABLE_DEFERRED=FALSE (nil)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [compositor_try_window] Target backend (null) initialized!
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Inhibiting sleep
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Received variant type (h)
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: File descriptor 17
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_build_instance_extensions] Using optional instance ext VK_EXT_swapchain_colorspace
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [should_skip_optional_instance_ext] Skipping optional instance extension VK_EXT_display_surface_counter because VK_KHR_display is not enabled
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Choosing Vulkan device index
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Available GPUs
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: llvmpipe (LLVM 18.1.8, 256 bits)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10005
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x0000
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_CPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x00000001
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] Selected GPU: 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_swapchain
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_dedicated_allocation
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_fence
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_get_memory_requirements2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] NOT using optional device ext VK_GOOGLE_display_timing
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_semaphore_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_fence_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_format_feature_flags2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_image_format_list
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_timeline_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_calibrated_timestamps
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_robustness2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [should_skip_optional_device_ext] Skipping optional instance extension VK_EXT_display_control because VK_EXT_display_surface_counter instance ext is not enabled
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_synchronization2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_external_memory_dma_buf
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_image_drm_format_modifier
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h264
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h265
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [filter_device_features] Features:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         null_descriptor: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_image_gather_extended: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_storage_image_write_without_format: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timeline_semaphore: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         synchronization_2: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] Creating video encode queue, family index 4
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] vkCreateDevice: VK_ERROR_NOT_PERMITTED_KHR (-1000174001)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] Is CAP_SYS_NICE set? Try: sudo setcap cap_sys_nice+ep monado-service
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Choosing Vulkan device index
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Available GPUs
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: llvmpipe (LLVM 18.1.8, 256 bits)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10005
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x0000
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_CPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x00000001
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] Selected GPU: 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_swapchain
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_dedicated_allocation
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_fence
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_get_memory_requirements2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] NOT using optional device ext VK_GOOGLE_display_timing
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_semaphore_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_fence_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_format_feature_flags2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_image_format_list
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_timeline_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_calibrated_timestamps
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_robustness2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [should_skip_optional_device_ext] Skipping optional instance extension VK_EXT_display_control because VK_EXT_display_surface_counter instance ext is not enabled
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_synchronization2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_external_memory_dma_buf
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_image_drm_format_modifier
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h264
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h265
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [filter_device_features] Features:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         null_descriptor: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_image_gather_extended: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_storage_image_write_without_format: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timeline_semaphore: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         synchronization_2: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] Creating video encode queue, family index 4
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] vkCreateDevice: VK_ERROR_NOT_PERMITTED_KHR (-1000174001)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] Is CAP_SYS_NICE set? Try: sudo setcap cap_sys_nice+ep monado-service
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Choosing Vulkan device index
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [select_physical_device] Available GPUs
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] GPU index 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: llvmpipe (LLVM 18.1.8, 256 bits)
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10005
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x0000
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_CPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x00000001
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_print_device_info] Selected GPU: 0
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_swapchain
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_dedicated_allocation
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_fence
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_get_memory_requirements2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using required device ext VK_KHR_external_memory_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] NOT using optional device ext VK_GOOGLE_display_timing
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_semaphore_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_external_fence_fd
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_format_feature_flags2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_global_priority
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_image_format_list
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_maintenance2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_timeline_semaphore
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_calibrated_timestamps
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_robustness2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [should_skip_optional_device_ext] Skipping optional instance extension VK_EXT_display_control because VK_EXT_display_surface_counter instance ext is not enabled
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_synchronization2
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_external_memory_dma_buf
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_EXT_image_drm_format_modifier
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_queue
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h264
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [build_device_extensions] Using optional device ext VK_KHR_video_encode_h265
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [filter_device_features] Features:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         null_descriptor: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_image_gather_extended: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         shader_storage_image_write_without_format: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timeline_semaphore: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         synchronization_2: 1
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [vk_create_device] Creating video encode queue, family index 4
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [create_device] Created device and COMPUTE queue with QUEUE_GLOBAL_PRIORITY_MEDIUM.
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [vk_print_device_info] Device info:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         name: NVIDIA GeForce RTX 2060
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         vendor: 0x10de
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         product: 0x1f08
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         apiVersion: 1.3.289
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         driverVersion: 0x8d4e4040
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [vk_print_features_info] Features:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timestamp_compute_and_graphics: true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timestamp_period: 1.000000
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timestamp_valid_bits: 64
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         timeline_semaphore: true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [vk_print_external_handles_info] Supported images:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:                 color import=true export=true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:                 depth import=true export=true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [vk_print_external_handles_info] Supported fences:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT: true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT: true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:  INFO [vk_print_external_handles_info] Supported semaphores:
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(binary): true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(binary): true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(timeline): false
Nov 27 21:28:57 ryzennova wivrn-server[1037389]:         VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(timeline): true
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [fill_in_results] Selected 0 with uuid: 83 12 95 7f 6b e4 d6 19 78 91 37 4f 78 dc c2 75
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [fill_in_results] Suggest 0 with uuid: 83 12 95 7f 6b e4 d6 19 78 91 37 4f 78 dc c2 75 to clients
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [render_shaders_load] Shaders loaded!
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [renderer_ensure_images_and_renderings] Creating images and renderings (force_recreate: false).
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: DEBUG [create_images] Creating 3 images.
Nov 27 21:28:57 ryzennova wivrn-server[1037389]: nvenc support not enabled
Nov 27 21:28:57 ryzennova wivrn-server[1036702]: Server exited, exit status 1
Nov 27 21:28:58 ryzennova wivrn-server[1036702]: Service published: ryzennova

Module file for WiVRN (added it as an input overlay to my flake)
{
  config,
  lib,
  pkgs,
  inputs,
  ...
}: let
  hm-config = config.hm;
in
  {
    disabledModules = lib.singleton "services/video/wivrn.nix";
    imports = ["${inputs.nixpkgs-wivrn}/nixos/modules/services/video/wivrn.nix"];
  }
  // lib.utilMods.mkModule config "wivrn" {
    # Make sure to enable the needed gaming and vr modules
    modules.gaming = {
      enable = true;
      vr.enable = true;
    };

    services.wivrn = {
      enable = true;
      package = pkgs.inputs.nixpkgs-wivrn.packages.${pkgs.system}.wivrn;
      openFirewall = true;
      config.enable = true;

      # Write information to /etc/xdg/openxr/1/active_runtime.json, VR applications
      # will automatically read this and work with WiVRn (Note: This does not currently
      # apply for games run in Valve's Proton)
      defaultRuntime = true;

      # Run WiVRn as a systemd service on startup
      autoStart = true;

      extraPackages = with pkgs; [
        (config.hardware.nvidia.package)
      ];
    };

    hardware.graphics.extraPackages = with pkgs; [monado-vulkan-layers];

    # From https://wiki.nixos.org/wiki/VR#Monado and https://wiki.nixos.org/wiki/VR#WiVRn
    hm.xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.wivrn}/share/openxr/1/openxr_wivrn.json";
    hm.xdg.configFile."openvr/openvrpaths.vrpath".text = ''
      {
        "config" :
        [
          "${hm-config.xdg.dataHome}/Steam/config"
        ],
        "external_drivers" : null,
        "jsonid" : "vrpathreg",
        "log" :
        [
          "${hm-config.xdg.dataHome}/Steam/logs"
        ],
        "runtime" :
        [
          "${pkgs.opencomposite}/lib/opencomposite"
        ],
        "version" : 1
      }
    '';
  }

🤔 .. Really odd, I just tested it on my system and it didn't fail. But I am seeing in the logs while watching the systemd serivce it is saying NVENC support isn't enabled, even though I do indeed have NVENC enabled via cudaSupport. Will update when I get Beat Saber up and going to see if I get anything else crazy
Quick edit: Also really odd too in the GUI, when I restart it, it actually has NVENC greyed out as an option

yeah, that means it didn't build with cuda :/
also restarting in the GUI completely overwrites any and all configs you add. I haven't figured out how to start and stop the server without it though :')

Okay so substituters was indeed the way to go, however, my issues have changed. Now wivrn itself doesn't build. It never got to this stage cause of openvc and onnxruntime. All the cuda packages and those other two I pulled from nix-community.cachix.org
building '/nix/store/p0jzrklca3rq697dsj1l5vlbnpqjaqmr-wivrn-0.21.1.drv'...
error: builder for '/nix/store/p0jzrklca3rq697dsj1l5vlbnpqjaqmr-wivrn-0.21.1.drv' failed with exit code 1;
       last 25 log lines:
       > -- Found XKB: /nix/store/i0d0ws5xwix1dvmwp8w1fr4kz61k11x4-libxkbcommon-1.7.0/lib/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
       > -- Found WrapVulkanHeaders: /nix/store/1580k6qby7r99aywz4yad0in1yr33c9i-vulkan-headers-1.3.296.0/include
       > -- Found Python3: /nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/bin/python3.12 (found version "3.12.7") found components: Interpreter
       > -- Found HIDAPI: /nix/store/qaq252qnpfbrv6cg29qlk9sk9sndd18z-hidapi-0.14.0/include/hidapi  found components: any
       > -- Found bluetooth: /nix/store/yza90ijr6jdkpsj67619018ngdykh62l-bluez-5.78/lib/libbluetooth.so
       > -- Found OpenHMD: /nix/store/5m63h7jdx62f2hs0aii3qgg6wx4yz1wc-openhmd-0.3.0/include
       > CMake Warning (dev) at /nix/store/id0x1b6g9rk58896kaamdpriivs3c5x4-opencv-4.9.0/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package):
       >   Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
       >   --help-policy CMP0146" for policy details.  Use the cmake_policy command to
       >   set the policy and suppress this warning.
       >
       > Call Stack (most recent call first):
       >   /nix/store/id0x1b6g9rk58896kaamdpriivs3c5x4-opencv-4.9.0/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package)
       >   /nix/store/69jwnrnqrrjdbgxk4cw8359gnjqimmpg-source-patched/CMakeLists.txt:93 (find_package)
       > This warning is for project developers.  Use -Wno-dev to suppress it.
       >
       > CMake Error at /nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/share/cmake-3.30/Modules/FindCUDA.cmake:883 (message):
       >   Specify CUDA_TOOLKIT_ROOT_DIR
       > Call Stack (most recent call first):
       >   /nix/store/id0x1b6g9rk58896kaamdpriivs3c5x4-opencv-4.9.0/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package)
       >   /nix/store/id0x1b6g9rk58896kaamdpriivs3c5x4-opencv-4.9.0/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package)
       >   /nix/store/69jwnrnqrrjdbgxk4cw8359gnjqimmpg-source-patched/CMakeLists.txt:93 (find_package)
       >
       >
       > -- Configuring incomplete, errors occurred!
       For full logs, run 'nix log /nix/store/p0jzrklca3rq697dsj1l5vlbnpqjaqmr-wivrn-0.21.1.drv'.
error: 1 dependencies of derivation '/nix/store/kbxjjrbhm380mcxbs24z334zmndm55b4-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/7i9k8mzi6zf52d7jvg3dnj3vc31svn6f-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ha2mmcagara19pkq9zfqz82sfzyp3r3k-nixos-system-puppypc-25.05.20241119.23e89b7.drv' failed to build

Is that log complete? It feels like its missing error messages or something, I can't really get anything from it.
I wonder if something changed in Nixpkgs for enabling Cuda stuff? I don't see anything mentioned in the 24.11 release notes but maybe it's some under-the-hood change? Using the typical config.nixpkgs.cudaSupport to enable cuda stuff in packages definitely worked in the past but I wonder why both of you are having issues with it

Is that log complete? It feels like its missing error messages or something, I can't really get anything from it. I wonder if something changed in Nixpkgs for enabling Cuda stuff? I don't see anything mentioned in the 24.11 release notes but maybe it's some under-the-hood change? Using the typical config.nixpkgs.cudaSupport to enable cuda stuff in packages definitely worked in the past but I wonder why both of you are having issues with it

That's the log I could find on my system at least. 🤔 Im gonna see if I run into the same issue if I go back to wivrn 0.19

Is that log complete? It feels like its missing error messages or something, I can't really get anything from it. I wonder if something changed in Nixpkgs for enabling Cuda stuff? I don't see anything mentioned in the 24.11 release notes but maybe it's some under-the-hood change? Using the typical config.nixpkgs.cudaSupport to enable cuda stuff in packages definitely worked in the past but I wonder why both of you are having issues with it

That's the log I could find on my system at least. 🤔 Im gonna see if I run into the same issue if I go back to wivrn 0.19

Sorry for the delay! I just tested it and it's not giving me that same error in 0.19.0

Deleted previous reply but in fact. it's not working correctly now, can't get Beat Saber to launch 😬

Deleted previous reply but in fact. it's not working correctly now, can't get Beat Saber to launch 😬

Ah, I had the launch command set wrong for Beat Saber! 😅

That's the log I could find on my system at least. 🤔 Im gonna see if I run into the same issue if I go back to wivrn 0.19

Now confirming that NVENC works still on 0.19; so nothing in nixpkgs changed to break that. @PassiveLemon

I can now confirm that 0.19 is working for me with nvenc. I must have fixed whatever the issue was that I was having with it. I still can't build 0.20.1 tho

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:white_check_mark: 2 packages built:

envision
wivrn

Hey with 0.21.1, I noticed with the dashboard it's actually saying the nvenc support is not even compiled! 🤔 I wonder why that is
❯ wivrn-dashboard
Adding translator for  QLocale(English, Latin, United States)
Server stopped
Starting server
Headset disconnected
WiVRn 0.21.1 starting
For Steam games, set command to PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%
Server started
Headset disconnected
Service published: ryzennova
Tagged version 0.21.1
Downloading metadata from https://api.github.com/repos/WiVRn/WiVRn/releases/tags/0.21.1
Client connected
Server started, PID 3538001
 INFO [ipc_server_main]  '0.21.1' starting up...
Launching /home/novaviper/Desktop/Beat Saber.desktop
With args:
    "/home/novaviper/Desktop/Beat Saber.desktop"
/home/novaviper/Desktop/Beat Saber.desktop: line 1: [Desktop: command not found
/home/novaviper/Desktop/Beat Saber.desktop: line 2: Saber: command not found
/home/novaviper/Desktop/Beat Saber.desktop: line 3: this: command not found
/home/novaviper/Desktop/Beat Saber.desktop: line 4: steam://rungameid/620980: No such file or directory
Application exited, exit status 0
DEBUG [comp_main_create_system_compositor] Doing init 0x55c010693b90
 WARN [compositor_check_and_prepare_xdev] Had to fill in meshuv on xdev 'WiVRn HMD', this should be done in the driver.
Inhibiting sleep
Received variant type (h)
File descriptor 17
Headset connected
 INFO [create_device] Created device and COMPUTE queue with QUEUE_GLOBAL_PRIORITY_MEDIUM.
 INFO [vk_print_device_info] Device info:
        name: NVIDIA GeForce RTX 2060
        vendor: 0x10de
        product: 0x1f08
        deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        apiVersion: 1.3.289
        driverVersion: 0x8d4e4040
 INFO [vk_print_features_info] Features:
        timestamp_compute_and_graphics: true
        timestamp_period: 1.000000
        timestamp_valid_bits: 64
        timeline_semaphore: true
 INFO [vk_print_external_handles_info] Supported images:
        VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
                color import=true export=true
                depth import=true export=true
 INFO [vk_print_external_handles_info] Supported fences:
        VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT: true
        VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT: true
 INFO [vk_print_external_handles_info] Supported semaphores:
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(binary): true
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(binary): true
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT(timeline): false
        VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT(timeline): true
 WARN [fill_defaults] nvidia GPU detected, but nvenc support not compiled
 INFO [comp_vulkan_formats_log] Supported formats:
        VK_FORMAT_R16G16B16A16_UNORM: true
        VK_FORMAT_R16G16B16A16_SFLOAT: true
        VK_FORMAT_R16G16B16_UNORM: false
        VK_FORMAT_R16G16B16_SFLOAT: false
        VK_FORMAT_R8G8B8A8_SRGB: true
        VK_FORMAT_B8G8R8A8_SRGB: true
        VK_FORMAT_R8G8B8_SRGB: false
        VK_FORMAT_R8G8B8A8_UNORM: true
        VK_FORMAT_B8G8R8A8_UNORM: true
        VK_FORMAT_R8G8B8_UNORM: false
        VK_FORMAT_B8G8R8_UNORM: false
        VK_FORMAT_R5G6B5_UNORM_PACK16: true
        VK_FORMAT_R32_SFLOAT: true
        VK_FORMAT_D32_SFLOAT: true
        VK_FORMAT_D16_UNORM: true
        VK_FORMAT_X8_D24_UNORM_PACK32: true
        VK_FORMAT_D24_UNORM_S8_UINT: true
        VK_FORMAT_D32_SFLOAT_S8_UINT: true
        VK_FORMAT_S8_UINT: true
 WARN [u_linux_try_to_set_realtime_priority_on_thread] Could not raise priority for thread 'Multi Client Module'
 INFO [print_linux_end_user_started_information]
################################################################################
#                                                                              #
#                        The Monado service has started.                       #
#                                                                              #
################################################################################

Just to confirm, do you have config.nixpkgs.cudaSupport = true?

Just to confirm, do you have config.nixpkgs.cudaSupport = true?

Yea, I have it here: https://github.com/NovaViper/NixConfig/blob/c5b54121a90d367324fe758d9755e3a9e6d333a3/hosts/ryzennova/configuration.nix#L62

Though oddly... I can't find exactly config.nixpkgs.cudaSupport as an option in nix-inspect

Though oddly... I can't find exactly config.nixpkgs.cudaSupport as an option in nix-inspect

it should be under config > nixpkgs > config, no?

it should be under config > nixpkgs > config, no?

Yeah it does

I have this imported in my flake as an overlay so I have to seperately turn on cudaSupport for PassiveLemon's fork of nixpkgs. I don't know what you do, but maybe you also have to manually turn it on somewhere? Cause wivrn only shows nvenc greyed out when it isnt built with cudaSupport

AH that would do it.. I'm importing the PR in the same way. How did you turn it on for the PR version of nixpkgs?
Also on another note.. I notice when I directly add the package files into my flake and add the package itself as an overlay, it tells me it's missing CUDA_TOOLKIT_ROOT_DIR for CMake 👀
How im overlaying the package itself

If it's the package from Nixpkgs itself, then the cudaSupport config setting should be inherited (It doesn't if it's from a different repo)

I have this imported in my flake as an overlay so I have to seperately turn on cudaSupport for PassiveLemon's fork of nixpkgs. I don't know what you do, but maybe you also have to manually turn it on somewhere? Cause wivrn only shows nvenc greyed out when it isnt built with cudaSupport

AH that would do it.. I'm importing the PR in the same way. How did you turn it on for the PR version of nixpkgs?

Here's my flake. Line 51 contains all the config for the wivrn overlay

Also on another note.. I notice when I directly add the package files into my flake and add the package itself as an overlay, it tells me it's missing CUDA_TOOLKIT_ROOT_DIR for CMake 👀
That is the exact same error as me, that makes me so happy to know I'm not alone :sob:

Adding (lib.optionals cudaSupport "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}") into the package lets me finally get nvenc working! Though I did have to not use the server (I think some options changed and it oddly was giving me trouble with getting the apps to stream. Setting the codec to auto in the app made it finally start streaming my apps to the headset!
Will need to play with the config option to figure out why it wasn't working 🤔

Hey I did get it working with the NixOS version of the server, I had to remove the scale option and just let it run on auto. Im not sure if what was going on there but in any case, NVENC's working!

Hey I did get it working with the NixOS version of the server, I had to remove the scale option and just let it run on auto. Im not sure if what was going on there but in any case, NVENC's working!

That's fantastic news ! Guess we'll need to update the wiki after this is merged to add the cudaSupport requirement and the fact that scale fucks it up :D

@Mistyttm 🤔 There's also an odd thing I noticed earlier too while using the GUI's version of the config. If I set the scaling it actually doesn't cause the issues so unsure why with the nix version it was causing issues before... I have a feeling it's probably because I hadn't restarted the computer (lost power for a sec so it forced my desktop to restart). Will test it again sometime tomorrow to confirm my hunch

@NovaViper Yeah there are a bunch of weird things with the GUI. It just does not utilise any of the nix stuff properly. I unfortunately have to use it cause I still cannot solve why the server doesn't let me connect without restarting it from the GUI. I think somehow the config file also isn't being made read only or something, which is very frustrating cause it gets over written

I think somehow the config file also isn't being made read only or something, which is very frustrating cause it gets over written

If you are talking about this PR for 0.21.1, then I should probably mention that you can't configure the server service through the dashboard. The configuration you put into the services.wivrn.json field is serialized into json and passed as a file flag to the server so whatever changes you might make when it's running won't persist through restarts. The dashboard itself is mostly useless when using the service

I still cannot solve why the server doesn't let me connect without restarting it from the GUI

Could you elaborate more on this issue? It sounds rather interesting. Maybe some logs when attempting to connect?
As far as the CUDA_TOOLKIT_ROOT_DIR issue goes, I can't actually tell if it's related to this package or not. I was actually able to recreate this, but it seems to only pop up when you are importing the package with a callPackage.
The whole point of the module is to control as much of the environment as possible to keep the server as stable as possible but there's still some weird issues to figure out :sweat_smile:

Could you elaborate more on this issue? It sounds rather interesting. Maybe some logs when attempting to connect?

Here is the log of me booting up, connecting in my headset, launching beat saber, closing beat saber, disconnecting from the headset, restarting wivrn (with systemctl restart --user wivrn) and doing it again. Beat Saber didn't launch either of those times, steam said it was running and that's it
wivrn.log

As far as the CUDA_TOOLKIT_ROOT_DIR issue goes, I can't actually tell if it's related to this package or not. I was actually able to recreate this, but it seems to only pop up when you are importing the package with a callPackage.

I'm not using callPackage anywhere within my configs. This is my entire wivrn config (minus the xdg stuff which is elsewhere). I currently have no other VR software installed, so there should be nothing conflicting with it.
{ pkgs, ... }: {
    services.wivrn = {
        enable = true;
        package = pkgs.wivrnupdate-nixpkgs.wivrn;   # Use the PR
        openFirewall = true;
        defaultRuntime = true;
        autoStart = true;
        config = {
            enable = true;
            json = {
                # 50 Mb/s
                bitrate = 50000000;
                encoders = [
                    {
                    encoder = "auto";   # Only use nvenc when wivrn builds with cuda
                    codec = "auto";
                    # 1.0 x 1.0 scaling
                    width = 1.0;
                    height = 1.0;
                    offset_x = 0.0;
                    offset_y = 0.0;
                    }
                ];
                application = [ pkgs.wlx-overlay-s ];
            };
        };
    };
}

I'm not using callPackage anywhere within my configs.

How are you accessing the package? I'm just simply adding the package.nix to my configuration and using callPackage on it
From your log file:
Dec 02 17:38:10 puppypc wivrn-server[6262]: ERROR [read_user_configuration] Invalid configuration file: invalid codec value auto
Dec 02 17:38:10 puppypc wivrn-server[6262]:  WARN [fill_defaults] nvidia GPU detected, but nvenc support not compiled

I don't think "auto" is a supported value for the encoder and codec. Just remove those lines to use auto.
It also says you don't have nvenc support compiled (You probably are aware already) but that shouldn't stop it from working if the config is set to auto. Try removing the encoder and codec lines and see if that works at all

How are you accessing the package? I'm just simply adding the package.nix to my configuration and using callPackage on it

I'm calling your fork of nixpkgs in an overlay in my flake then using the overlayed package. I mentioned it earlier in the thread here

I don't think "auto" is a supported value for the encoder and codec. Just remove those lines to use auto. It also says you don't have nvenc support compiled (You probably are aware already) but that shouldn't stop it from working if the config is set to auto. Try removing the encoder and codec lines and see if that works at all

Ah, that would make sense, that was me knowing that wivrn can auto select and interpreting it in the wrong way lmao. I still can't compile nvenc since I'm using your fork, I can't edit the package and I just haven't gotten round to figuring out a way to get the missing flag that @NovaViper added into my own configs. I will at some point.
Just tested and yeah removing the encoder and codec settings finally lets it work, it does just set the option to auto by default. all I need now is to just get nvenc working and all the issues will be solved

Little update, managed to get NVENC working myself, although tracking seems to be very delayed by like a full second or two. I had to update my overlay to retroactively include the "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}" flag in the wivrn package and then it would build it took a lot of testing. It also doesn't require restarting the service or anything, it just works now.

@PassiveLemon 👀 New update for WiVRn (including some big bugfixes for the Quest 2) https://github.com/WiVRn/WiVRn/releases/tag/v0.22

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review

x86_64-linux

:fast_forward: 1 package blacklisted:

nixos-install-tools

:white_check_mark: 2 packages built:

envision
wivrn

Huh.. new issue now after the update. Now the gui is saying "The Monado Nvidia layer is not installed"

Huh.. new issue now after the update. Now the gui is saying "The Monado Nvidia layer is not installed"

Ah I had to add monado-vulkan-layers into the extra packages for services.wivrn.extraPackages

Ah I had to add monado-vulkan-layers into the extra packages for services.wivrn.extraPackages

That's not the intended location but I guess it works? Ideally it should be placed under hardware.graphics.extraPackages. wivrn.extraPackages is to add packages to the environment for the startup application

Ah I had to add monado-vulkan-layers into the extra packages for services.wivrn.extraPackages

That's not the intended location but I guess it works? Ideally it should be placed under hardware.graphics.extraPackages. wivrn.extraPackages is to add packages to the environment for the startup application

Odd.. I have it under hardware.graphics.extraPackages too when it threw that warning.

The LVRA VRChat is tomorrow, I'll give it a good test then as I don't have the time tonight

Along with the changes requested, I added sourceProvenance

Odd.. I have it under hardware.graphics.extraPackages too when it threw that warning.

Alright this is really weird again.. that error about the missing Monado Nvidia layers still appears in the GUI, but the server doesn't say anything about it at all; in fact the server's running fine! My config's below
{
  config,
  lib,
  pkgs,
  ...
}: let
  hm-config = config.hm;
in
{
    # Make sure to enable the needed gaming and vr modules
    modules.gaming = {
      enable = true;
      vr.enable = true;
    };

    services.wivrn = {
      enable = true;
      openFirewall = true;
      config.enable = true;

      # Write information to /etc/xdg/openxr/1/active_runtime.json, VR applications
      # will automatically read this and work with WiVRn (Note: This does not currently
      # apply for games run in Valve's Proton)
      defaultRuntime = true;

      # Run WiVRn as a systemd service on startup
      autoStart = true;

      extraPackages = with pkgs; [
        monado-vulkan-layers
        (config.hardware.nvidia.package)
      ];
    };

    hardware.graphics = let
      extraPackages = with pkgs; [monado-vulkan-layers];
    in {
      inherit extraPackages;
      extraPackages32 = extraPackages;
    };
    environment.systemPackages = with pkgs; [monado-vulkan-layers];

    # From https://wiki.nixos.org/wiki/VR#Monado and https://wiki.nixos.org/wiki/VR#WiVRn
    create.configFile."openxr/1/active_runtime.json".source = "${pkgs.wivrn}/share/openxr/1/openxr_wivrn.json";
    create.configFile."openvr/openvrpaths.vrpath".text = ''
      {
        "config" :
        [
          "${hm-config.xdg.dataHome}/Steam/config"
        ],
        "external_drivers" : null,
        "jsonid" : "vrpathreg",
        "log" :
        [
          "${hm-config.xdg.dataHome}/Steam/logs"
        ],
        "runtime" :
        [
          "${pkgs.opencomposite}/lib/opencomposite"
        ],
        "version" : 1
      }
    '';
  }

overlay file:
# This file defines overlays
{self, ...}: let
  addPatches = pkg: patches:
    pkg.overrideAttrs
    (oldAttrs: {patches = (oldAttrs.patches or []) ++ patches;});
in {
  # Third party overlays
  # Import wivrnupdate-nixpkgs and force cuda support for it
  overlay-wivrn = final: prev: {
    wivrn =
      (import self.inputs.nixpkgs-wivrn {
        inherit (final) system;
        config.allowUnfree = true;
        config.cudaSupport = true;
      })
      .wivrn;
  };

  # For every flake input, aliases 'pkgs.inputs.${flake}' to
  # 'inputs.${flake}.packages.${pkgs.system}' or
  # 'inputs.${flake}.legacyPackages.${pkgs.system}'
  flake-inputs = final: _: {
    inputs = builtins.mapAttrs (_: flake: let
      legacyPackages = (flake.legacyPackages or {}).${final.system} or {};
      packages = (flake.packages or {}).${final.system} or {};
    in
      if legacyPackages != {}
      then legacyPackages
      else packages)
    self.inputs;
  };

  # Adds pkgs.stable == inputs.nixpkgs-stable.legacyPackages.${pkgs.system}
  stable = final: _: {
    stable = import self.inputs.nixpkgs-stable {
      inherit (final) system;
      config.allowUnfree = true;
    };
    #stable = self.inputs.nixpkgs-stable.legacyPackages.${final.system};
  };
}

Ah I finally figured it out. I had to actually install the package via environment.systemPackages and that the error go away in the gui. 🤔 Still odd though but anyway, everything looks good to me to merge 👍🏾  Probably should put a note down in the wiki about having to make sure the monado vulkan layers is actually installed and not just in the extraPackages.

Very nice! I'll add some more to the VR section in the wiki

I plan to give one more test in Beat Saber sometime tomorrow to be sure (I only tested with the wlx-overlay app). Shouldn't make a difference since that overlay connects up to WiVRn just fine but I want to make sure in case there's a crazy bug I hadn't noticed before (hopefully not! 😅)

Gonna give these new changes a test myself later tonight and hopefully my end doesn't mess up again @~@

I plan to give one more test in Beat Saber sometime tomorrow to be sure (I only tested with the wlx-overlay app). Shouldn't make a difference since that overlay connects up to WiVRn just fine but I want to make sure in case there's a crazy bug I hadn't noticed before (hopefully not! 😅)

Meant to comment earlier but I did test it in Beat Saber and found the service and UI are working good! Even the recentering the room finally works thanks to upstream fixing it 🎉  One note is that I couldn't test the passthrough streaming since I don't have a streaming set up. Other than that, the PR looks good to me to merge!


chore: bdd-spring-1574996397 to 0.0.1

chore: Promote bdd-spring-1574996397 to version 0.0.1

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:
If they are not already assigned, you can assign the PR to them by writing /assign  in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


Support macvlan network

I am using a macvlan network on Docker, and I'm getting an error message:
[SERVICE_STARTUP_FAILED] [no bindings available for 4444/tcp]

On a Macvlan network all ports are exposed, but it seems that Selenoid is not able to understand that somehow.
This is the line that seems to be doing it:
https://github.com/aerokube/selenoid/blob/db901aa6cf9a67912a9df777a4c1ddf81ca3019f/service/docker.go#L187

@giggio we have never used macvlan mode with Docker, so yes - currently Selenoid does not support macvlan I think.

I was able to get it to work with a workaround. I added solenoid to both networks. This is my docker-compose.yaml (lan_net is a macvlan network, solenoidnet is a regular bridge network):
version: '3.7'
services:
  selenoid:
    build:
      context: .
      dockerfile: Dockerfile.selenoid
    image: lambda3/selenoid
    container_name: selenoid
    environment:
      - TZ=America/Sao_Paulo
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./config/:/etc/selenoid/:ro
    restart: always
    command: [ "-listen", ":4444", "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video/", "-container-network", "selenoidnet" ]
    ports:
     - "4444:4444" # unnecessary, but needed because of selenoid
    networks:
      lan_net:
        ipv4_address: <IP_ADDRESS>
      selenoidnet: {}
  selenoidui:
    build:
      context: .
      dockerfile: Dockerfile.selenoidui
    image: lambda3/selenoidui
    container_name: selenoidui
    environment:
      - TZ=America/Sao_Paulo
    restart: always
    depends_on:
      - selenoid
    command: --selenoid-uri=http://selenoid:4444 --listen :80
    networks:
      lan_net:
        ipv4_address: <IP_ADDRESS>
      selenoidnet: {}
networks:
  lan_net:
    external:
      name: lan_net
  selenoidnet:
    external:
      name: selenoidnet

This works, and maybe there is nothing else you need to do, just maybe document it. The containers get created on a bridge network, which is fine, as we only need access to Solenoid and the UI, not the browser containers. I still need to test VNC etc, but this seems fine.

@giggio ok, will document it. Thank you for clarification!

Ok, I evolved it to a simpler design, adding a reverse nginx proxy. It could be a good alternative to the one I posted above. I leave all the selenoid machinery on one network, not a macvlan, and then I add an nginx proxy to both the selenoid network and the macvlan network. It worked perfectly.
version: '3.7'
services:
  selenoid:
    build:
      context: .
      dockerfile: Dockerfile.selenoid
    image: lambda3/selenoid
    container_name: selenoid
    environment:
      - TZ=America/Sao_Paulo
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./config/:/etc/selenoid/:ro
    restart: always
    command: [ "-listen", ":4444", "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video/", "-container-network", "selenoidnet" ]
    networks:
      selenoidnet: null
  selenoidui:
    build:
      context: .
      dockerfile: Dockerfile.selenoidui
    image: lambda3/selenoidui
    container_name: selenoidui
    environment:
      - TZ=America/Sao_Paulo
    restart: always
    depends_on:
      - selenoid
    command: --selenoid-uri=http://selenoid:4444 --listen :80 -allowed-origin *
    networks:
      lan_net:
        ipv4_address: <IP_ADDRESS>
      selenoidnet: null
  selenoidproxy:
    image: nginx:1.17-alpine
    container_name: selenoidproxy
    networks:
      lan_net:
        ipv4_address: <IP_ADDRESS>
      selenoidnet: null
    environment:
      - TZ=America/Sao_Paulo
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./certs/lambda3.com.br.crt:/etc/ssl/lambda3.com.br.crt
      - ./certs/lambda3.com.br.key:/etc/ssl/lambda3.com.br.key
    restart: always
networks:
  lan_net:
    external:
      name: lan_net
  selenoidnet:
    external:
      name: selenoidnet

@giggio before I add this to docs - could you please clarify what's the reason of using Macvlan networks in your case?


mvp-cockpit: cockpit.install_all_in_one() fails

On a fresh Ubuntu: https://uk-g8-1.demo.greenitglobe.com/CBGrid/Virtual Machine?id=42
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/usr/local/bin/js in <module>()
----> 1 j.tools.cuisine.local.solutions.cockpit.install_all_in_one(start=True, branch='8.1.0')

/opt/jumpscale8/lib/JumpScale/tools/cuisine/solutions/CuisineCockpit.py in install_all_in_one(self, start, branch, reset)
     71                                                        append=True)
     72
---> 73         txt = self._cuisine.core.file_read("$cfgDir/portals/main/config.hrd")
     74         hrd = j.data.hrd.get(content=txt)
     75         hrd.prefixWithName = False  # bug in hrd

/opt/jumpscale8/lib/JumpScale/tools/cuisine/CuisineCore.py in file_read(self, location, default)
    449         location = self.args_replace(location)
    450         if default is None:
--> 451             assert self.file_exists(location), "cuisine.file_read: file does not exists {0}".format(location)
    452         elif not self.file_exists(location):
    453             return default

AssertionError: cuisine.file_read: file does not exists /optvar/cfg/portals/main/config.hrd

In [2]:

not an AYS problem, problem was that the visity/webdav image doesn't expose port 22, thanks @muhamadazmy


add code comment style guide for TiKV

Signed-off-by: Calvin Weng<EMAIL_ADDRESS>
What have you changed?

Add code comment style guide for TiKV repo

What are the type of the changes?

Improvement

Please give your advice. @nrc

Looks nice. I think we should also link to this file in the contribution documentation?

Sure thing. Will update when this one is approved.

May be you can just update them together in this PR because adding a single line referring to the doc is not a matter.

I'll read this tomorrow.

@dcalvin This commit: https://github.com/tikv/tikv/pull/4204/commits/7e0f60125e44c0093496f9d77a9903f72d2067b3 isn't signoff'd. So we can't merge. :(

@siddontang Is there a way to manually set DCO passing for this PR? Obviously, there are one or two commits somehow missing DCO that block the merging.

Superceded by https://github.com/tikv/tikv/pull/4259


Virtual scrolling helpers / utilities.

Similar to the md-virtual-repeat in Angular Material 1.

Would be good to implement dynamic height (https://github.com/angular/material/issues/4314)

https://developers.google.com/web/updates/2016/07/infinite-scroller

@istiti Polymer has <iron-list> Here and Demos Here
Please recognize that you are asking about a feature that most projects don't need/use and is a technical challenge to  put into a library in a fully formed, universal way... You could probably write your own version, but it might not be what I would need...
Tooltip is a super easy use case for portals and overlay's which are core to everything from menu's to dialogs so is rather simple to release and common enough that most use cases fit.
The link you gave has a link to his source code and it's only 400ish lines. I bet you could make a ng2 version and contributing it back to the community for free would be awesome!

@DennisSmolek "Infinite scrollers pop up all over the internet. Google Music’s artist list is one, Facebook’s timeline is one and Twitter’s live feed is one as well"
IMHO infinite scroll is technik people need to have to discharge their DOM! Still more today we have big data.
But thank you a lot I just learn by your reaction that we can use polymer element in my ng2 app? does it stable, does people merge them ? what's difference between polymer element and why people wait material2 element, it's very cool approach thanks

@istiti Have you tried this https://vaadin.com/blog/-/blogs/using-polymer-components-in-angular-2

yes but this add more complexities to my app ... really a bad choice but I find  angular2-data-table which do work very awesome thanks

ETA?

I've ported the old one and wonder if I there's some form of spec available so I can align my implementation with it. The mdVirtualRepeat is almost (as in line-to-line) the same, but structural repeater had to be made by scratch based on ngFor and mdVirtualRepeat.

@Klaster1 , any chance you could fork material2 and add your work to the library? If there was at least an initial PR we could get some momentum going behind this.

ngx-datatable has an implementation of virtual scroll.
I wonder if that couldn't be easily brought in?

@jelbourn
I've made a naive implementation of a templatizable-virtual-repeat that work great for basic use-cases.
However, the item repeated must have a fixed height.
For now the virtual-repeat only supports:
itemNumber * itemHeight / maxHeight of HTMLElement of the browser which is 33554400px in Chrome.
So the number of items to be virtualized is still limited and relative to their heights.
If this sounds good to you, I can make a PR with the initial version and if the components pleases most I can work on the maxHeight issue.
Let me know if you're interested.

@thibaultsavary we want to explore solutions for non fix-sized items in material2.

@jelbourn is that the sort of thing that can be implemented in a version bump down the road? Variable height is a tricky issue to solve with md-virtual-repeat, I'm not even sure if it's a realistic goal to pursue.
Seems to me that it might be beneficial to at least feature parity with Angular Material 1.0, and then think about improving the functionality after it lands. Our company is pretty dependent on md-virtual-repeat, and its lack of support in Angular Material 2.0 is a bit of a blocker for us to upgrade to Angular ^2.

@jelbourn I fully agree with @bryanrideshark for virtual scroll to be exact in height is not top priority. Exact position affects scrollbar position on the right, but normally it is only a visual effect.

@bryanrideshark & @laserus I don't agree with you guys... if the team implements the v1 (from material 1), a better version will probably never be explored! The team's time is limited and they should focus on innovation rather than existing technologies

+1 for inovation
ps:wait this feature since 5 months

+1 for the flexible height.

@natcohen all of what will / will not happen is speculation unless we're actually decision makers in the matter, IE, core members of the team.
As this is a blocking issue for other things (autocomplete, md-select), would someone on the team be able to provide some sort of feedback as to where this issue stands?

+1 for the flexible height

+1 need this badly!

I have an implementation for virtual grids: https://github.com/Hacklone/angular2-cool-infinite-grid
Maybe grids could be part of virtual scrolling too :)

there aren't virtual scroll component In milestones. Are you planning to implement it?

https://github.com/dinony/od-virtualscroll is working great in my project, and so far is the only one I've tested that I could get working (the others might not have liked @angular/flex-layout, not sure).
It doesn't yet support dynamic item height, so for now we're just using it in a feature branch, but otherwise seems like a really good implementation.

@buu700 do you know if it supports flexLayout?

@mackelito, yep, they seem to be working well together; I just had to include a small CSS workaround. This is what my implementation looks like:
od-virtualscroll, od-virtualrow {
	width: 100%;
}

...

	<od-virtualscroll fxFlexFill>
		<ng-template let-item let-row='row'>
			...
		</ng-template>
	</od-virtualscroll>

Also potentially helpful (not material/flex-layout-specific): https://github.com/dinony/od-virtualscroll/issues/2#issuecomment-301191176

+1 for the flexible height.

What do you mean by flexible height,
Do you expect the repeater to calculate the height by itself and assume that all items has the same height
or you wish for every item to have it's own different height?
I am asking because I already implemented this component and the former wish is crazy.
The first is simple though, before creating the components loop, just build the first component and then calculate it's height...

@MadUser customizable height calculation function might be good enough. Default implementation will measure first item or use number value from binding/config object. If you can calculate each item dimensions reliably, variable size will work. For example, if each virtual list item is another list of items of predefined size, just multiply item height and items amount (in simpliest case).

I'm currently using this one: https://github.com/rintoj/angular2-virtual-scroll
Works great

Any updates on this?

@elineopsommer they have updated the feature status in the info page to "planned Q3 2017"... Q3 has just started so just be patient :)

@elineopsommer where is the info page?

Huh after reading through the comments i am surprised how complicated you guys want to make it. Isn't enough just to set the scroll distance for triggering an event to load more data. I see no point of being unable to be innovative with this. A working version that works simply should be enough and covers the most use cases. You can then be innovative and add more features?

Some people disagree, @azarus. Why would you be on a team that is commited to create something with the best design principles and will just ignore this fact to create something that is already there? If your use case is simple, just work with some third-party library (or make a component) that fulfill your needs. The team cannot just start with something simple now, before designing with complex cenarios in mind, as this may lead to a wrong spec to other more complex cenarios.
Following your example, there is already other projects that can do what your want. For instance: https://github.com/rintoj/angular2-virtual-scroll. This is a nice implementation, but doesn't follow Angular Material principles. I think that's why the team is taking "so long" to implement the entire library with the best UI components in mind: design everything really well.
In a project that I am participating now, an use case for the virtual repeat component is a grid of images, that I load records from a service. My intent with this is to show it to the user like I would do using a RecyclerView (the Android component). And, in my opinion, this is where virtual scroll could be taken: a "mimic" of a RecyclerView that allows us to display an interesting UI without loading all the records upfront, but with the items "size" already defined (as we can run a simple count in database to check this quickly). This will help us to deliver better UI/UX to the user: a nice component to interact with and with great performance too.

The scrolling is already implemented in material but there are no such events yet as far as i see :/

I think we aren't talking about the same thing here, @azarus. This issue is about tracking the Virtual Scroll/Repeat implementation for Material UI of Angular 2. It's not implemented yet. Not even designed.
The only news from it is an update regarding the plan to start designing this component, that was postponed to Q4 this year (a couple of days ago).
Anyway... I have a lot of expectations about this component and hope to see it covering complex use cases too, not only what we already can do with any UI library today. This is what I think the team behind Material wants too and the work to polish everything is something big, but the results tend to be very promising.

i use this as well for a pretty complex list... , works great..!

One year later...

Just wait for them as they said they gona reinvent the wheel in an innovative way. :) such a joke.

@azarus as one that is inspired by the Material team and their work I take comments like this as hurtful to this community.  I understand you're frustrated with the lack of progress on this particular issue, but the team has been working their ass off on bringing core functionality with i18n, a11y, and the cdk.  Your comments have added zero benefit to this thread.
I ask that you please resign from commenting.

I found brilliant solution from slickgrid. This basically handle unlimited records of any size (I don't think variable height can be handled in this case) and I have implemented the solution preview comments added. This solution performance is too good compare to any solutions exist today. May be material team can consider to adopt it?

@cgatian then stop mentioning me in your fan comments? I do like material but this is slightly anoing how no progress is shown regarding this feature. If a complaint is hurtful because the team puts resources into reinvention rather than delivering it then it better be damn good?

@azarus +1
It's like google is very cool but dominate the market and have no profit to make all developer use angular or other. All is open source open source open source open source lol

Yep, need to be blocked until it will be done or in progress.

Also take a look at https://github.com/tbranyen/hyperlist , non angular pure js version.

@jelbourn I know this isn't planned for post GA but was wondering if there was any API proposals floating around for this?
I've been looking at a few different ways this could be implemented but wanted to check to see if what I've come up matches anything that the team might already have in mind.

Here is my own implementation of the virtual-scroll, inspired from one of AngularJs but coded by me, it does not support dynamic height but has really great performances (works perfectly well on CPU 6x slowdown with a fade-in animation for items).
component.html
A "fake-scroller" is an empty box in which the user can scroll, it has the total height of the list, the content is not in this "fake-scroller" but on top and will be translated using the css translateY function.

  <ng-content></ng-content>

Nothing special about the css:
:host{
  display: block;
  position: relative;
  overflow: hidden;
  overflow-y: scroll;
  will-change: transform;
}
#fake-scroller{
  height: 100%;
}
#content-wrapper{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

import { Component, OnInit, OnChanges, SimpleChanges, Input, Output, EventEmitter, Renderer, ElementRef, HostListener } from '@angular/core';

@Component({
  selector: 'optimized-list',
  templateUrl: './optimized-list.component.html',
  styleUrls: ['./optimized-list.component.css']
})
export class OptimizedListComponent implements OnChanges {

  /*
  My own implementation of a virtual-scroll component
  ~Robin
  */

  @Input() items: any[]; //the items to display
  @Input() itemHeight: number = 20;
  @Input() offset: number = 0; //number of elements rendered out of the container to prevent "pop-in" effect
  @Output() update: EventEmitter<any[]> = new EventEmitter<any[]>();

  @HostListener('scroll') onScroll = function () {
    this.refresh();
  }

  public scrollHeight: number;
  public translateY: number;
  private visibleItems: any[] = [];

  constructor(
    private renderer: Renderer,
    private elementRef: ElementRef,
  ) { }

  ngOnChanges(changes: SimpleChanges) {
    for (let propName in changes) {
      if (propName == 'items') {
        this.scrollHeight = this.items.length * this.itemHeight + 88; //  + 88 // offset bottom
        this.refresh();
      }
    }
  }

  private refresh() {
    let height: number = this.elementRef.nativeElement.clientHeight;
    let scrollTop: number = this.elementRef.nativeElement.scrollTop;
    let visual_start: number = Math.floor(scrollTop / this.itemHeight);
    let offset_start: number = Math.max(Math.floor(scrollTop / this.itemHeight) - this.offset, 0);
    let offset_end: number = Math.min(Math.ceil((height + scrollTop) / this.itemHeight) + this.offset, this.items.length);
    this.translateY = Math.min(scrollTop - (visual_start - offset_start) * this.itemHeight - (scrollTop % this.itemHeight), this.items.length * this.itemHeight);
    this.visibleItems = this.items.slice(offset_start, offset_end);
    this.update.next(this.visibleItems);
  }

}

Usage:
<optimized-list *ngIf="products" [items]="products | filter:searchQuery" [itemHeight]="73" [offset]="2" (update)="optimizedList = $event">

{{product.name}}

</optimized-list>

Feature request for this component:

ability to break up a virtual scroll list into sections, with a header element / title beginning the section, and ability to add anchor links to sections and "jump" to a particular section.

e.g. If the virtual scroll list contained a list of people ordered alphabetically, ability for the user to "jump" to the "G" section, and have that section begin with a title element saying "this is the 'G' section"

@jelbourn, any news on the progress of this? It's Q4 now isn't it? 😃

@mmalerba is working on it- it's a large project, so it was started in Q4 and is planned to wrap up in 2018.

@jelbourn will it support dynamic height of elements? It is a really important feature in my opinion.

Yes, that is something we aim to support (and one of the reasons it's a larger undertaking)

My 2 cents, virtual list should handle the following:

Dynamic height.
No limit on number of elements in the list:
Every browser have max pixel limit, so if list element height say 50px the max elements can be rendered would be approximately 214749 elements (considering the lowest max pixels). Read the article here

        const div = document.createElement('div');
        const style = div.style;
        style.position = 'absolute';
        style.left = '99999999999999px';
        style.top = '9999999999999999px';
        document.body.appendChild(div);

        const size = div.getBoundingClientRect()[left ? 'left' : 'top'];
        document.body.removeChild(div);
        return size;
    }
     /* Example outputs
         Firefox: 33554400px
         Chrome:  33554428px
         Opera:   33554428px
         IE Edge:10737418.23px / IE 9: 21474836.47px
     */

Support both vertical and horizontal scrolling.
Should allow filtering.
Dynamic list size (number of elements).
Scroll to element if user input the element index.

I potentially see the two solutions angular material team can consider or refer to the one mentioned in the above article (this solution can't handle dynamic height) and another here which can handle dynamic height too).

If it helps here are two different implementations of Virtual scrollers I made a little while ago just to see how the different methods might be implemented.
Intersection Observer
https://stackblitz.com/edit/angular-virtual-scroll-passive
Scroll watcher + manual height calcs
https://stackblitz.com/edit/angular-virtual-scroll
Reload the preview window when you open them up
Just note these are very buggy and have issues, I made these to experiment not as a final product.

Ionic and Iron-List both have Grouping / Divider.
Grid support would be also great.
The most advanced virtual scroll implementation i saw up to date is Google Photos

Grid support - images
Variable width !
Grouping

The best available one is iron-list.

@jelbourn  Any updates on this?
I implemented an infinite scroll behavior, where every time the scroll comes to the end of the list I make a request for my server and load more information and give an append in my list, however when passing 400 records my list gets very slow .
Any idea what I can do?
the implementation was done natively, without using external libraries!
Sorry for my english, it's not my first language.

@Jonas-Ceolin-Alberton you can check out the virtual scrolling project in this repo for the WIP on this issue. It's being actively worked on.

thank you @thefliik !

@Component({
  selector: 'my-table',
  templateUrl: './my-table.component.html',
  styleUrls: ['./my-table.component.css'],
  providers: [],
  changeDetection: ChangeDetectionStrategy.OnPush
})

For anyone stumbling upon this thread via Google because your mat-table freezes, you can update changeDetection to OnPush. In my case, I have a lot of *ngIfs in my rows, and profiling in Chrome shows that Angular is trying to check for changes for a minute or so (I have about 900 rows). Using OnPush fixes this problem.
Of course, it's not a silver bullet to all mat-table performance issues, but it might be worth a try in your project. With this option enabled, you might be required to inject ChangeDetectorRef and call markForCheck()/detectChanges() yourself. See @PascalPrecht's helpful article for more details: https://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.html

Here is a demo of the virtual scroll with autosize for those interested - https://stackblitz.com/edit/autosize-gap-scroller-ftwx3x

@amcdnl Thanks for sharing this, I think all the elements are already added in DOM. I believe in virtual scroll the elements should be added dynamically depending on available space.

Yes, Please take a look:

Weird; when I first load it it has all the elements as reported by @naveedahmed1 . But if I change the stackblitz to have a loop to 1000 instead of 10 then it behaves the way @amcdni says it should. And if I then click Fork and reload the stackblitz, it gets lots of errors in the console (altho it doesn't have the extra elements anymore).

@takamori ah, ok. I'm able to replicate that. If I increase the loop to 1000 it starts behaving as expected.

weird problems when i increase

Yes, it is very very experimental so bugs are expected. cc @mmalerba

In the final release it will be possible to specify the total size of the data set, like in the AngularJs virtual repeater (getLength())? This way the scroll bar can be initially sized to allow an easy access to any part of the data set.

@byronsanchez - You can use it today in cdk-experimental

@kylecordes - The next phase is to integrate this with the other components such as table and tree. Stay tuned for updates on that.

@kylecordes Take a look here https://virtual-grid-mat.stackblitz.io/

Anyone tried it with Angular Universal?

Can anyone please confirm if the following features are supported in current implementation:

scrollTo(position) - scroll to the given scroll position

scrollToIndex(index) - scroll to the given index in the list

Secondly, is it necessary to set height of the cdk-virtual-scroll-viewport? In my case if I dont set the height it doesnt work properly.

No idea for scrollTo/scrollToIndex.
I can answer for height. I set my virtual scroll viewport using flex layout and it work with no fixed size.
See this https://stackblitz.com/edit/angular-virtual-scroll-and-flex-layout-working

Thanks for sharing this @bsthilaire it seems that this solution doesn't work with autosize, I mean for dynamic heights.

I modified my stackblitz for autosize and it's still working with flex-layout.
https://stackblitz.com/edit/angular-virtual-scroll-and-flex-layout-randomsize

IE11 is glitchy. Do you prefer to have a dedicated Issue for all issue about IE? i am going to try to fix this one next weekend.

@amcdnl it seems that the scrolling through arrow keys (up/down) doesn't work properly. It does scroll for few items and after that stops working.
To replicate the issue, open https://stackblitz.com/edit/angular-virtual-scroll-and-flex-layout-randomsize click on any element of the list and then use arrow keys to scroll.
cc @mmalerba

@nasreddineskandrani The gap at the end is alread tracked by https://github.com/angular/material2/pull/11195

@bsthilaire i referenced in the ticket you mention. SInce like that we can see the status here :).
If their is others open not referenced here please tag this ticket the other side to be able to have a clear view on how mature this feature is.

I've been tracking all of the virtual scroll issues in this project: https://github.com/angular/material2/projects/20
Sorry for the lack of responsiveness, I just got back from a long vacation, will resume working on this now that I'm back

I think this issue is growing too much. Dev are reporting here all bugs/questions.
@mmalerba is it fine? or can we use a better strategy?
Like closing this issue and let a message at the end to encourage devs open specific issues/questions...

I'm planning to leave this issue open until the virtual scroll is available in cdk (rather than cdk-experimental). If people have specific bugs they've encountered they should open a new issue. Discussion and troubleshooting should happen on Gitter, Stack Overflow, etc

I wrote a library for it in angualr 6. it uses cdk virtual component and supports end triggers.
check out: https://github.com/aprola/ngx-infinite-virtual-scroll
demo: https://aprola.github.io/ngx-infinite-virtual-scroll/

@gshireesh Your demo is not working

@manju-reddys thanks for pointing it out. I busted npm cache. now it works fine.

Do you think that this features could be used for virtualization of horizontal scrolling?

@mmalerba Is there ongoing work being done on this AutosizeVirtualScrollStrategy?  It looks like the code has been stagnant for 3 months.

Any news on autosize?


Easier to use motor/endcoder direction handling

Currently the drive just errors if the ecoder direction doesn't match the motor direction.
Better would be if we can simply let the encoder be the master of the direction, and adapt how we apply torque to the motor to match.

Implemented.


SW-4713 Implement export modal with mock data for participant project

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

#2402  👈
#2401
#2400
#2399
#2398
#2397
#2395
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @nickgraz and the rest of your teammates on  Graphite

Merge activity

Mar 26, 10:40 AM EDT: @nickgraz started a stack merge that includes this pull request via Graphite.