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

Couple of issues and questions #1

Open
whackashoe opened this issue Sep 14, 2018 · 4 comments
Open

Couple of issues and questions #1

whackashoe opened this issue Sep 14, 2018 · 4 comments

Comments

@whackashoe
Copy link

First off, very exciting project!

I am not sure if this is premature to write as I'm sure this is still in heavy dev but I really wanted to try this out.

When I start this I get just a black screen, and a few errors:

SDL_Init failed: wayland not available
Trying default SDL driver.
starting using Vulkan
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
ParameterValidation(ERROR): object: 0x0 type: 0 location: 1497 msgCode: 8: vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.
0 triangles

nvidia-smi

NVIDIA-SMI 396.44                 Driver Version: 396.44
GeForce GTX 1080

lsb_release -a

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

uname -a

4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

rustc --version

rustc 1.29.0 (aa3ca1994 2018-09-11)

Also, when I close the window the program doesn't stop. Sending SIGHUP will close the window but not the program, I have to kill -9 it.

I also am getting segfaults.

(gdb) run run
Starting program: /home/whackashoe/.cargo/bin/cargo run
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 5141 is executing new program: /home/whackashoe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee3ff700 (LWP 5145)]
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s                                           

Thread 2 "cargo" received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x7fffee3ff700 (LWP 5145)]
0x0000555555a344df in std::sys_common::backtrace::__rust_begin_short_backtrace::hc8c39f7a40b731f2 ()
(gdb) bt
#0  0x0000555555a344df in std::sys_common::backtrace::__rust_begin_short_backtrace::hc8c39f7a40b731f2
    ()
#1  0x0000555555a34cfe in std::panicking::try::do_call::hf856cd50efc68809 ()
#2  0x0000555555d9b02a in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:105
#3  0x0000555555a352da in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h8c8c4e47c1ff2489 ()
#4  0x0000555555d7380b in _$LT$alloc..boxed..Box$LT$$LP$dyn$u20$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$RP$$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h940efee7335c8f36 () at /checkout/src/liballoc/boxed.rs:652
#5  std::sys_common::thread::start_thread::hac18b9ed82bd359d () at libstd/sys_common/thread.rs:24
#6  0x0000555555d71816 in std::sys::unix::thread::Thread::new::thread_start::ha15fdd35f58285a3 ()
    at libstd/sys/unix/thread.rs:90
#7  0x00007ffff77b56ba in start_thread (arg=0x7fffee3ff700) at pthread_create.c:333
#8  0x00007ffff72d341d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) run run
Starting program: /home/whackashoe/.cargo/bin/cargo run
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 5275 is executing new program: /home/whackashoe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee3ff700 (LWP 5281)]
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s                                           

Thread 2 "cargo" received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x7fffee3ff700 (LWP 5281)]
0x0000555555a3911e in _$LT$std..sync..mpsc..oneshot..Packet$LT$T$GT$$GT$::send::h3e90ece1d94112c8 ()
(gdb) bt
#0  0x0000555555a3911e in _$LT$std..sync..mpsc..oneshot..Packet$LT$T$GT$$GT$::send::h3e90ece1d94112c8
    ()
#1  0x0000555555a37431 in _$LT$std..sync..mpsc..Sender$LT$T$GT$$GT$::send::hdc2581588fa67d83 ()
#2  0x0000555555a3445c in std::sys_common::backtrace::__rust_begin_short_backtrace::hc8c39f7a40b731f2
    ()
#3  0x0000555555a34cfe in std::panicking::try::do_call::hf856cd50efc68809 ()
#4  0x0000555555d9b02a in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:105
#5  0x0000555555a352da in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h8c8c4e47c1ff2489 ()
#6  0x0000555555d7380b in _$LT$alloc..boxed..Box$LT$$LP$dyn$u20$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$RP$$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h940efee7335c8f36 () at /checkout/src/liballoc/boxed.rs:652
#7  std::sys_common::thread::start_thread::hac18b9ed82bd359d () at libstd/sys_common/thread.rs:24
#8  0x0000555555d71816 in std::sys::unix::thread::Thread::new::thread_start::ha15fdd35f58285a3 ()
    at libstd/sys/unix/thread.rs:90
#9  0x00007ffff77b56ba in start_thread (arg=0x7fffee3ff700) at pthread_create.c:333
#10 0x00007ffff72d341d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

I had to apply a minor patch to get this to build so I'm guessing there's some code otherwise I'm missing:

diff --git a/voxels-renderer-vulkan/src/error.rs b/voxels-renderer-vulkan/src/error.rs
index 79ebcb1..1e75b94 100644
--- a/voxels-renderer-vulkan/src/error.rs
+++ b/voxels-renderer-vulkan/src/error.rs
@@ -70,7 +70,7 @@ impl fmt::Display for VulkanError {
                     api::VK_ERROR_INCOMPATIBLE_DISPLAY_KHR => "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR",
                     api::VK_ERROR_VALIDATION_FAILED_EXT => "VK_ERROR_VALIDATION_FAILED_EXT",
                     api::VK_ERROR_INVALID_SHADER_NV => "VK_ERROR_INVALID_SHADER_NV",
-                    api::VK_ERROR_NOT_PERMITTED_EXT => "VK_ERROR_NOT_PERMITTED_EXT",
+                    // api::VK_ERROR_NOT_PERMITTED_EXT => "VK_ERROR_NOT_PERMITTED_EXT",
                     api::VK_ERROR_OUT_OF_POOL_MEMORY_KHR => "VK_ERROR_OUT_OF_POOL_MEMORY_KHR",
                     api::VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR => {
                         "VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR"

Anyways, best of luck - hope some of this is useful.

@programmerjake
Copy link
Owner

Thanks for trying out my code! You're right, this repo is nowhere near ready for production yet.

The warnings about anisotropy not being enabled come from

anisotropyEnable: api::VK_FALSE,
maxAnisotropy: 0.0,
which disables anisotropy. The warnings aren't actually correct as the docs for VkSamplerCreateInfo state that maxAnisotropy is ignored when anisotropyEnable is false.

I'm not sure what the SIGUSR1 is about, you're debugging cargo rather than hashlife3d. You need to debug the program built by cargo that's in target, so use something like gdb target/debug/hashlife3d

The missing VK_ERROR_NOT_PERMITTED_EXT is caused by not having new enough Vulkan headers, so you can use your patch or update the vulkan headers and run cargo clean. Other than for unexpected error reporting, VK_ERROR_NOT_PERMITTED_EXT is not used and Vulkan should not report that particular error as I'm not using the extensions that that is part of.

@programmerjake
Copy link
Owner

The black screen is caused by the world generation code needing time to start up, it should change about 15s after launch (assuming your computer is about as fast as mine and you are in release mode). I'm working on speeding that part up as it's currently really inefficient.

@whackashoe
Copy link
Author

Appreciate you taking a look and for all the info! I've got graphics now 👍

Found that the crash is due to resizing.

#0  0x00007ffff1ec855a in ?? () from /usr/lib/nvidia-396/libnvidia-glcore.so.396.44
#1  0x00007ffff1eca444 in ?? () from /usr/lib/nvidia-396/libnvidia-glcore.so.396.44
#2  0x00007ffff1ec29bd in ?? () from /usr/lib/nvidia-396/libnvidia-glcore.so.396.44
#3  0x00007ffff1e76251 in ?? () from /usr/lib/nvidia-396/libnvidia-glcore.so.396.44
#4  0x00007ffff2d7217e in ?? () from /usr/lib/nvidia-396/libGL.so.1
#5  0x00007ffff0022cba in ?? () from /usr/lib/x86_64-linux-gnu/libVkLayer_unique_objects.so
#6  0x00007fffef608247 in ?? () from /usr/lib/x86_64-linux-gnu/libVkLayer_core_validation.so
#7  0x00007fffeee5bfc4 in ?? () from /usr/lib/x86_64-linux-gnu/libVkLayer_parameter_validation.so
#8  0x00005555556be16f in voxels_renderer_vulkan::command_buffer::render_frame::hfc60c36d34bf4062 (
    vulkan_device=0x7fffffff9570, clear_color=..., loader_command_buffers=0x7fffffff9000, 
    render_command_buffer_groups=...) at voxels-renderer-vulkan/src/command_buffer.rs:1363
#9  0x00005555557243de in _$LT$voxels_renderer_vulkan..VulkanDevice$u20$as$u20$voxels_renderer_base..Device$GT$::render_frame::h8faf58668841d2fe (self=0x7fffffff9570, clear_color=..., 
    loader_command_buffers=0x7fffffff9000, render_command_buffer_groups=...)
    at voxels-renderer-vulkan/src/lib.rs:1372
#10 0x0000555555593a7f in _$LT$hashlife3d..game_state..RenderState$LT$$u27$a$C$$u20$D$GT$$GT$::render_frame::h434099d5db465b11 (self=0x7fffffff9570) at src/game_state.rs:379
#11 0x0000555555632249 in hashlife3d::render_main_loop::h4a72dd8736e5b03d (paused_device=..., 
    event_source=0x7fffffffdbf8) at src/main.rs:97
#12 0x0000555555633782 in _$LT$hashlife3d..rust_main..MainLoop$u20$as$u20$voxels_renderer..MainLoop$GT$::main_loop::hdf6b2b229534bc24 (self=..., paused_device=..., event_source=0x7fffffffdbf8)
    at src/main.rs:123
#13 0x000055555556c30d in _$LT$voxels_renderer..for_each_backend..BackendStruct$u20$as$u20$voxels_renderer..Backend$GT$::run_main_loop::h9064d4ea59f0ce50 (self=0x7fffffffda28, main_loop=..., 
    event_source=0x7fffffffdbf8) at /home/pizzapi/code/hashlife3d/voxels-renderer/src/lib.rs:81
#14 0x00005555556339d2 in _$LT$hashlife3d..rust_main..BackendVisitor$LT$$u27$a$C$$u20$$u27$b$GT$$u20$as$u20$voxels_renderer..BackendVisitor$GT$::visit::ha99e9cd62f3a3b1a (self=0x7fffffffdc28, backend=...)
    at src/main.rs:140
#15 0x000055555556bfb3 in voxels_renderer::for_each_backend::h232af3a19b8afce0 (
    backend_visitor=0x7fffffffdc28) at /home/pizzapi/code/hashlife3d/voxels-renderer/src/lib.rs:91
#16 0x00005555555e78d2 in rust_main (event_source=...) at src/main.rs:155
#17 0x00005555557927bc in voxels_sdl::sdl_main::run_main::hc7ff442ca1e5c391 ()
    at voxels-sdl/src/sdl_main/mod.rs:61
#18 0x0000555555792366 in voxels_sdl::sdl_main::SDL_main::_$u7b$$u7b$closure$u7d$$u7d$::he1c02eda13ce5456 () at voxels-sdl/src/sdl_main/mod.rs:69
#19 0x000055555578656b in std::panicking::try::do_call::h9b79ceedacd2f576 (data=0x7fffffffdf10 "\002")
    at /checkout/src/libstd/panicking.rs:310
#20 0x00005555557f504a in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:105
#21 0x00005555557864b4 in std::panicking::try::h44eebc5aab0ca2d5 (f=...)
    at /checkout/src/libstd/panicking.rs:289
#22 0x0000555555798269 in std::panic::catch_unwind::h62ed3b04696f74d8 (f=...)
    at /checkout/src/libstd/panic.rs:392
#23 0x0000555555792862 in SDL_main (_argc=1, _argv=0x7fffffffe0a8) at voxels-sdl/src/sdl_main/mod.rs:69
#24 0x00005555555e7b0b in main (argc=1, argv=0x7fffffffe0a8) at src/main.rs:181

@programmerjake
Copy link
Owner

possibly related: https://bugs.freedesktop.org/show_bug.cgi?id=107986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants