Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

wivrn: 0.19 -> 0.22 #350069

Merged
merged 2 commits into from
Dec 8, 2024
Merged

wivrn: 0.19 -> 0.22 #350069

merged 2 commits into from
Dec 8, 2024

Conversation

PassiveLemon
Copy link
Contributor

@PassiveLemon PassiveLemon commented Oct 20, 2024

Re-take of #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)
    • 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:
  • 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
  • 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@PassiveLemon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
❌ 1 package failed to build:
  • wivrn

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 20, 2024
@PassiveLemon
Copy link
Contributor Author

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.

@PassiveLemon PassiveLemon force-pushed the wivrn-update branch 3 times, most recently from c02b821 to 1c41a27 Compare October 20, 2024 17:58
@Titaniumtown
Copy link
Contributor

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'

@Titaniumtown
Copy link
Contributor

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: WiVRn/WiVRn@be95ec8

@tomodachi94 tomodachi94 added the 9.needs: upstream fix This PR needs upstream to change something label Oct 20, 2024
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Oct 20, 2024
@PassiveLemon
Copy link
Contributor Author

PassiveLemon commented Oct 27, 2024

Since its been like a week and there's been no response, I added the patch and a note about the automatic config defaults

@PassiveLemon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 1 package built:
  • wivrn

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 27, 2024
@Titaniumtown
Copy link
Contributor

0.21 released!

@PassiveLemon PassiveLemon changed the title wivrn: 0.19 -> 0.20 wivrn: 0.19 -> 0.21.1 Nov 3, 2024
@PassiveLemon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 2 packages built:
  • envision
  • wivrn

@PassiveLemon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 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

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 5, 2024
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one reputable person 2.status: merge conflict This PR has merge conflicts with the target branch labels Nov 5, 2024
NovaViper added a commit to NovaViper/NixConfig that referenced this pull request Dec 6, 2024
- Apply WiVRn v0.21.1 overlay from NixOS/nixpkgs#350069
- Add RUSTUP xdg variable
- Add -u to journal abbreviations
- Add wlx-overlay for WiVRn application
@NovaViper
Copy link
Contributor

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

@PassiveLemon
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 2 packages built:
  • envision
  • wivrn

@PassiveLemon PassiveLemon changed the title wivrn: 0.19 -> 0.21.1 wivrn: 0.19 -> 0.22 Dec 6, 2024
@NovaViper
Copy link
Contributor

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

@NovaViper
Copy link
Contributor

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

@PassiveLemon
Copy link
Contributor Author

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

Copy link
Member

@Scrumplex Scrumplex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Testing it locally now

nixos/modules/services/video/wivrn.nix Outdated Show resolved Hide resolved
@NovaViper
Copy link
Contributor

NovaViper commented Dec 6, 2024

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.

Copy link
Member

@Scrumplex Scrumplex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basics seem to work. I don't have the hardware to do an end-to-end test sadly.

@PassiveLemon
Copy link
Contributor Author

PassiveLemon commented Dec 6, 2024

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

@PassiveLemon
Copy link
Contributor Author

Along with the changes requested, I added sourceProvenance

@NovaViper
Copy link
Contributor

NovaViper commented Dec 7, 2024

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;
    };

    # 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};
  };
}

@NovaViper
Copy link
Contributor

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.

@PassiveLemon
Copy link
Contributor Author

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

@NovaViper
Copy link
Contributor

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! 😅)

@Mistyttm
Copy link

Mistyttm commented Dec 7, 2024

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

@NovaViper
Copy link
Contributor

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!

@Scrumplex Scrumplex added the backport release-24.11 Backport PR automatically label Dec 8, 2024
@Scrumplex Scrumplex merged commit 3d58deb into NixOS:master Dec 8, 2024
38 of 39 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Dec 8, 2024

Successfully created backport PR for release-24.11:

NovaViper added a commit to NovaViper/NixConfig that referenced this pull request Dec 10, 2024
- Moved XDG declarations into xdg module
- Add NPM xdg declaration
- Add 50% foevation strength, for better stability with Beat Saber
- Note that NixOS/nixpkgs#350069 is now merged, waiting for it to move
into unstable hydra
@PassiveLemon PassiveLemon deleted the wivrn-update branch December 18, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 9.needs: upstream fix This PR needs upstream to change something 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants