Closed danielfullmer closed 4 years ago
I don't have NixOS installed, but did you clone with --recursive
or fetch the submodules manually? Sounds like godot_headers is missing (which is a submodule of a submodule)
That was it. I only fetched the first level of submodules. After fetching them recursively I can use the pre-built products from cachix. Thanks!
@danielfullmer Just confirming you were able to use Simula on NixOS? Were you able to launch apps? If so, do you have any feedback/feature requests for how we can make the experience better?
Also noticed from your GitHub profile you're in New Haven, CT, which I assume is Yale University. If so, I was undergraduate class of 2010. :mortar_board:
@georgewsinger Small world! Yes, I'm a graduate student at Yale, hopefully soon to finish my PhD.
Well, I had it working very briefly, but I made some changes to my system, including disabling some i3
keybindings to not conflict with SimulaVR
, and now it fails with:
OpenVR: initialising OpenVR context
Application in scene (normal) mode.
Main OpenVR interface has been initialized
Main render models interface has been initialized.
Found base station 1 (lh_basestation_valve_gen2)
Initialized VR interface.
Running Wayland server on display simula-0
New DISPLAY=:1
ERROR: connect: Condition ' !signal_is_valid ' is true. returned: ERR_INVALID_PARAMETER
At: core/object.cpp:1454.
xwayland glamor: GBM backend (default) is not available
No protocol specified
Cannot open display.
movement: No cursor focused surface!
/nix/store/jvbs8y2vrd1qilbfpm204rszmyq5hhkz-nixVulkanNvidia/bin/nixVulkanNvidia: line 3: 10705 Segmentation fault (core dumped) "$@"
(This might be related to also upgrading my nvidia drivers at the time. IIRC I was using a version that was built before I upgraded my nvidia drivers to 440.82
, and apparently that version worked, but this more recently built version now doesn't?)
My issues appear to be intermittent--because I just tried again and it worked....
If you have a core dump or backtrace for that (or any) segfault, it'd help a bunch. Usually godot prints a backtrace but sometimes it decides not to.
Sure, here's a coredump: https://keybase.pub/danielfullmer/simulavr-coredump.gz
And here's the output from coredumpctl debug
:
[nix-shell:~]$ coredumpctl debug /nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64
PID: 54028 (godot.x11.opt.6)
UID: 1000 (danielrf)
GID: 499 (danielrf)
Signal: 11 (SEGV)
Timestamp: Sat 2020-04-11 20:23:33 EDT (5min ago)
Command Line: /nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64 -m
Executable: /nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (danielrf)
Boot ID: 25692e16c04c435e989fc817403d4eae
Machine ID: 6b5fbbda812344eea9b41d70367bcab0
Hostname: bellman
Storage: /var/lib/systemd/coredump/core.godot\x2ex11\x2eopt\x2e6.1000.25692e16c04c435e989fc817403d4eae.54028.1586651013000000000000.lz4
Message: Process 54028 (godot.x11.opt.6) of user 1000 dumped core.
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64...
(No debugging symbols found in /nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64)
warning: core file may not match specified executable file.
[New LWP 54028]
[New LWP 54030]
[New LWP 54035]
[New LWP 54041]
[New LWP 54034]
[New LWP 54029]
warning: File "/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/5zzgkw8f7p4514bbmr018fyyyvpd46kp-gcc-9.2.0-lib".
To enable execution of this file add
add-auto-load-safe-path /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libthread_db-1.0.so
line to your configuration file "/home/danielrf/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/danielrf/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
warning: File "/nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/5zzgkw8f7p4514bbmr018fyyyvpd46kp-gcc-9.2.0-lib".
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `/nix/store/2qsyp71n9m5hkfhqnzm9i50n28dfk5lj-godot-3.2/bin/godot.x11.opt.64 -m'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f27a7d1a7ef in memcpy@GLIBC_2.2.5 () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6
[Current thread is 1 (LWP 54028)]
warning: File "/nix/store/lzyjivyzrp6agilxhgh0h40pwwg18agy-gcc-9.2.0-lib/lib/libstdc++.so.6.0.27-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/5zzgkw8f7p4514bbmr018fyyyvpd46kp-gcc-9.2.0-lib".
(gdb) bt
#0 0x00007f27a7d1a7ef in memcpy@GLIBC_2.2.5 () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6
#1 0x00007f279346c709 in ?? () from /nix/store/cimfr094rs3swsjwf15h1mji0bb6m3x0-nvidia-440.82/lib/libnvidia-glcore.so.440.82
#2 0x00007f279346c86d in ?? () from /nix/store/cimfr094rs3swsjwf15h1mji0bb6m3x0-nvidia-440.82/lib/libnvidia-glcore.so.440.82
#3 0x00007f279314f798 in ?? () from /nix/store/cimfr094rs3swsjwf15h1mji0bb6m3x0-nvidia-440.82/lib/libnvidia-glcore.so.440.82
#4 0x00007f273dc32601 in ?? () from /nix/store/xrvv8kjk0nq5ckqi31jrh4cyjjl6iz6s-nvidia-x11-440.82-5.4.31/lib/libGLX_nvidia.so.0
#5 0x00007f273dbfe518 in ?? () from /nix/store/xrvv8kjk0nq5ckqi31jrh4cyjjl6iz6s-nvidia-x11-440.82-5.4.31/lib/libGLX_nvidia.so.0
#6 0x00007f27a8775fda in call_init.part () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2
#7 0x00007f27a8776116 in _dl_init () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2
#8 0x00007f27a8779f23 in dl_open_worker () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2
#9 0x00007f27a7da6dac in _dl_catch_exception () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6
#10 0x00007f27a87797fa in _dl_open () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/ld-linux-x86-64.so.2
#11 0x00007f27a8319246 in dlopen_doit () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libdl.so.2
#12 0x00007f27a7da6dac in _dl_catch_exception () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6
#13 0x00007f27a7da6e1f in _dl_catch_error () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libc.so.6
#14 0x00007f27a83198f5 in _dlerror_run () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libdl.so.2
#15 0x00007f27a83192c6 in dlopen@@GLIBC_2.2.5 () from /nix/store/9rabxvqbv0vgjmydiv59wkz768b5fmbc-glibc-2.30/lib/libdl.so.2
#16 0x00007f273df00dde in loader_icd_scan () from /nix/store/2p1mn2sqdivrmk3b0gykklsyac0dlwil-vulkan-loader-1.2.131.2/lib/libvulkan.so.1
#17 0x00007f273df058e8 in terminator_EnumerateInstanceExtensionProperties ()
from /nix/store/2p1mn2sqdivrmk3b0gykklsyac0dlwil-vulkan-loader-1.2.131.2/lib/libvulkan.so.1
#18 0x00007f273df096c6 in vkEnumerateInstanceExtensionProperties ()
from /nix/store/2p1mn2sqdivrmk3b0gykklsyac0dlwil-vulkan-loader-1.2.131.2/lib/libvulkan.so.1
#19 0x00007f273c7133e9 in CVRCompositorSharedTextures::GetVulkanInstanceExtensionsRequired(char*, unsigned int) ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#20 0x00007f273c713a59 in CVRCompositorSharedTextures::InitVulkanInteropDevice() ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#21 0x00007f273c713c0f in CVRCompositorSharedTextures::GetDevice(vr::Texture_t const*, vr::EVRSubmitFlags, void**) ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#22 0x00007f273c7151b1 in CVRCompositorSharedTextures::BeginCommandBuffer(vr::Texture_t const*) ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#23 0x00007f273c7151d4 in CVRCompositorSharedTextures::BeginGPUTimingCommandBuffer(vr::Texture_t const*) ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#24 0x00007f273c70a6ac in CVRCompositorClient::Submit(vr::EVREye, vr::Texture_t const*, vr::VRTextureBounds_t const*, vr::EVRSubmitFlags) ()
from /home/danielrf/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so
#25 0x00007f27912b7250 in godot_arvr_commit_for_eye (p_data=<optimized out>, p_eye=1, p_render_target=<optimized out>, p_screen_rect=<optimized out>)
at openvr/headers/openvr.h:4892
#26 0x00000000007c6ee4 in ARVRInterfaceGDNative::commit_for_eye(ARVRInterface::Eyes, RID, Rect2 const&) ()
#27 0x0000000001886da4 in VisualServerViewport::draw_viewports() ()
#28 0x000000000185482c in VisualServerRaster::draw(bool, double) ()
#29 0x00000000005b1f1b in Main::iteration() ()
#30 0x0000000000595fd1 in OS_X11::run() ()
#31 0x0000000000585fb3 in main ()
If it happens again, it's probably a vulkan issue -- maybe related to different libvulkan.so loaded by SteamVR and Simula. Could also just be a random crash in SteamVR.
Let me know if that or a similar backtrace occurs again.
Hmm, it still seems to be occurring, unfortunately. The one time it launched successfully, it wasn't displaying in the headset and there was no head tracking.
Launch SteamVR and check what libvulkan.so it loads via grep 'libvulkan\.so' /proc/*/maps
. If it's loading a local libvulkan, install a system libvulkan and make sure both Simula and SteamVR use the same library.
@danielfullmer I'm about to test Simula on a NixOS machine with an nvidia card. Any NixOS gotchas I should look out for with getting steam
set up, etc? Or was everything straightforward?
(I've tried to get SteamVR working on NixOS about once a year now for 3 years straight, and have failed every time :cry: ).
I think using these options in configuration.nix
should be sufficient:
{
hardware.opengl.driSupport32Bit = true; # Needed for steam
hardware.pulseaudio.support32Bit = true;
hardware.steam-hardware.enable = true; # Provides udev rules for controller, HTC vive, and Valve Index
environment.systemPackages = with pkgs; [ steam ];
}
There is a recent PR https://github.com/NixOS/nixpkgs/pull/86480 which should make this as easy as setting programs.steam.enable = true
, but it's not merged yet.
You should still expect an error when starting SteamVR where it tries to get superuser permissions: Error: setcap of vrcompositor-launcher failed
. However, this can be ignored for now, as I believe it is just used to increase the priority of vrcompositor
. You will unfortunately get stutters, but I've been manually working around that using schedtool
on vrcompositor
.
Not sure if you will encounter it, but Proton+SteamVR currently requires ugly patching: https://github.com/NixOS/nixpkgs/issues/71554#issuecomment-554694209 I believe all these issues will be hopefully be fixed when this (or something similar) is merged: https://github.com/NixOS/nixpkgs/pull/31263
Feel free to reach out if you run into any issues.
@danielfullmer Wow thanks a lot. You likely saved me 2 hrs or more of NixOS fiddling.
@danielfullmer One last question: what driver are you using? Just
services.xserver.videoDrivers = [ "nvidia" ];
?
@georgewsinger Yep, that's what I'm using.
@danielfullmer I'm able to launch SteamVR Home in NixOS, but when I launch ./result/bin/simula
I get a hard freeze (I'm only able to access my computer via SSH). Inspecting dmesg
yields:
[58910.739179] show_signal_msg: 63 callbacks suppressed
[58910.739180] godot.x11.opt.6[11078]: segfault at 0 ip 00007f2ba69d5530 sp 00007ffe1acf3828 error 4 in libvulkan.so.1.2.131[7f2ba69b9000+30000]
[58910.739183] Code: 10 48 8b 40 20 4c 89 c7 ff e0 48 8b 07 4c 8b 47 10 48 8b 40 28 4c 89 c7 ff e0 48 8b 07 4c 8b 57 10 48 8b 40 30 4c 89 d7 ff e0 <48> 8b 07 4c 8b 47 10 48 8b 40 38 4c 89 c7 ff e0 48 8b 07 4c 8b 47
which according to this message means I need a "GPU specific vulkan driver and 32bit version of icd-loader". I'm assuming nvidia
takes care of the former. Do you recall messing with 32-bit icd-loader in NixOS?
I actually have the same issue with the latest commit on gdwlroots-xwayland
. It was working with an earlier commit (at least the one where I sent a PR detecting NixOS using /etc/NIXOS
), but I haven't tried bisecting or debugging further.
@danielfullmer Thanks. This will help me narrow down the issue.
@danielfullmer Ok. The commit from the time of your last PR works for me on NixOS. Now it's just a matter of triangulating down on the thing that we broke over the last month or so. Once we fix it I'll let you know!
@danielfullmer Our latest commit fixes the NixOS issue. However, I'm getting some other issues that I just want to make sure are particular to my machine:
Have you experienced any of this in NixOS?
Thanks for the fix! No, I haven't experienced either of those issues. Just for reference, I'm using a Valve Index with an Nvidia 1080ti.
@danielfullmer I fixed the issue by plugging my Vive Pro into a different port of my nvidia card. Aside from that weirdness, I'm very much enjoying Simula on NixOS right now!
@danielfullmer Last year you helped me get Simula running on NixOS. I recently tried again on a new machine and ran into problems: https://www.reddit.com/r/NixOS/comments/pkppk0/unable_to_get_steamvr_wvalve_index_working_in/
Was curious if you had any recent experience with SteamVR on NixOS.
I justed tested right now and it works OK for me. I haven't had any problems with Steam + SteamVR in NixOS for quite a while, and I"m not aware of any open issues about it in NixOS. Your configuration looks OK to me, and I would expect it to work. I have the same headset and am also not currently using the beta steam or steamVR. The biggest difference is that I'm on nixos-unstable
instead of 21.05
.
Thanks for your help. I'll try nixos-unstable
Same behavior. Hmm. Couple of more observations.
Sometimes I get the "SteamVR Room Setup" window popping up, which claims it can't detect the headset (despite the headset showing it's detected in the STEAMVR status popup): https://i.imgur.com/fCtXAOf.png
If I start NixOS with the Valve Index plugged in, I just get a black screen/can't get NixOS to start. Note that nothing shows up in the Valve Index when I start up either (i.e. the BIOS window isn't moving to the Valve Index as its monitor). So in all of these cases, I am attempting to get the Valve Index to work by plugging it in after NixOS has already booted up.
I'll work through this though : ]
About (2), be sure to try various combinations of the DP/HDMI ports your monitor and Valve index are plugged into. I know on my 1080Ti, I've had issues in the past with certain ports.
Does your setup already work in windows or other linux distros well? I'd want to confirm that this is really a software issue and not a hardware one.
I'll attach my SteamVR logs as well in case it's useful to compare with yours. It looks like your vrcompositor might be freezing when "Looking for direct display through Vulkan WSI". vrclient_vrcompositor.txt vrcompositor.txt vrserver.txt vrclient_vrstartup.txt
About (2), be sure to try various combinations of the DP/HDMI ports your monitor and Valve index are plugged into. I know on my 1080Ti, I've had issues in the past with certain ports.
Good idea. Just tested all the display ports though, and getting the same issue.
Does your setup already work in windows or other linux distros well? I'd want to confirm that this is really a software issue and not a hardware one.
This setup has been confirmed to work on another Ubuntu machine (running against an AMD GPU).
I'll attach my SteamVR logs as well in case it's useful to compare with yours.
Thanks!
@danielfullmer Have you tried an OpenXR backend (as opposed to a steam/openvr backend) with Simula on NixOS before? I've recently been trying to get it to work, and can so far only get things to render in the headset, but without positional tracking working. I'm not sure if it's something weird with my setup or if it generalizes to all NixOS machines.
Steps to test in case you have the time, and your NixOS machine is still going:
git clone --branch dev --recursive https://github.com/SimulaVR/Simula # Clone
source ./utils/Helpers.sh && nsBuildSimulaLocal # Build Simula
./result/bin/monado-service # Launch monado-service in one terminal
./result/bin/simula_local_monado # Then launch Simula in another terminal
:monocle_face:
Hi @georgewsinger . Sure I can try running this.
I have the following error when running ./result/bin/monado-service
:
INFO [disable_drivers_from_conflicts] Disabling vive because we have survive
INFO [add_from_devices] Skipping disabled driver vive
INFO [add_from_devices] Skipping disabled driver vive
INFO [add_from_devices] Skipping disabled driver vive
Info: All enumerated devices attached.
Info: Loaded drivers: HTCVive
Info: Adding tracked object T20 from HTC
Info: Device T20 has watchman FW version 1623823641 and FPGA version 538/9/2; named ' WMBUILD-W64$'. Hardware id 0x22143109
Warning: The detected version for device T20 is 1623823641; the latest that is verified to work is 1597880106. You may have to upgrade libsurvive to support this device.
Parameter 14 to routine cblas_dgemm was incorrect
I have vague memories about getting monado to run on NixOS in the past, but IIRC I could never figure out how to get positional tracking working either, just 3DoF.
Running:
source utils/Helpers.sh && installSimula
Fails with the following output:
(I use NixOS, on the nixos-unstable channel)