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

Failing to run examples #7

Closed
tyoc213 opened this issue Mar 12, 2016 · 18 comments
Closed

Failing to run examples #7

tyoc213 opened this issue Mar 12, 2016 · 18 comments

Comments

@tyoc213
Copy link
Contributor

tyoc213 commented Mar 12, 2016

Hi there, I have Windows Insider with 364.51 NVIDIA Drivers. and Im using rust 1.7 mscv from https://static.rust-lang.org/dist/rust-1.7.0-x86_64-pc-windows-msvc.msi and with VS2015 community.

Do I need nightly or something? I dont think because cargo build ends with a lot of warnings but 0 errors.

And I get

cargo run --example buffers_copy
   Compiling vulkano v0.1.0 (file:///Z:/tyoc/Documentos/GitHub/vulkano/vulkano)
examples\buffers_copy.rs:8:20: 8:70 error: this function takes 3 parameters but 2 parameters were supplied [E0061]
examples\buffers_copy.rs:8     let instance = vulkano::instance::Instance::new(Some(&app), None).expect("failed to create instance");
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples\buffers_copy.rs:8:20: 8:70 help: run `rustc --explain E0061` to see a detailed explanation
examples\buffers_copy.rs:18:28: 19:93 error: this function takes 5 parameters but 4 parameters were supplied [E0061]
examples\buffers_copy.rs:18     let (device, queues) = vulkano::device::Device::new(&physical, physical.supported_features(),
examples\buffers_copy.rs:19                                                         [(queue, 0.5)].iter().cloned(), &[])
examples\buffers_copy.rs:18:28: 19:93 help: run `rustc --explain E0061` to see a detailed explanation
examples\buffers_copy.rs:40:83: 40:89 error: no method named `lock` found for type `alloc::arc::Arc<vulkano::device::Queue>` in the current scope
examples\buffers_copy.rs:40     let cb_pool = vulkano::command_buffer::CommandBufferPool::new(&device, &queue.lock().unwrap().family())
                                                                                                              ^~~~~~
examples\buffers_copy.rs:48:31: 48:37 error: no method named `lock` found for type `alloc::arc::Arc<vulkano::device::Queue>` in the current scope
examples\buffers_copy.rs:48         let mut queue = queue.lock().unwrap();
                                                          ^~~~~~
examples\buffers_copy.rs:49:24: 49:42 error: no method named `submit` found for type `alloc::arc::Arc<vulkano::command_buffer::outer::PrimaryCommandBuffer>` in the current scope
examples\buffers_copy.rs:49         command_buffer.submit(&mut queue).unwrap();
                                                   ^~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors

And

cargo run --example image
   Compiling vulkano v0.1.0 (file:///Z:/tyoc/Documentos/GitHub/vulkano/vulkano)
examples\image.rs:28:65: 28:68 error: mismatched types:
 expected `&vulkano::instance::extensions::InstanceExtensions`,
    found `&[_; 0]`
(expected struct `vulkano::instance::extensions::InstanceExtensions`,
    found array of 0 elements) [E0308]
examples\image.rs:28     let instance = vulkano::instance::Instance::new(Some(&app), &[], &extensions).expect("failed to create instance");
                                                                                     ^~~
examples\image.rs:28:65: 28:68 help: run `rustc --explain E0308` to see a detailed explanation
examples\image.rs:28:20: 28:52 error: the trait `core::iter::Iterator` is not implemented for the type `&vulkano::instance::extensions::InstanceExtensions` [E0277]
examples\image.rs:28     let instance = vulkano::instance::Instance::new(Some(&app), &[], &extensions).expect("failed to create instance");
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples\image.rs:28:20: 28:52 help: run `rustc --explain E0277` to see a detailed explanation
examples\image.rs:28:20: 28:52 note: `&vulkano::instance::extensions::InstanceExtensions` is not an iterator; maybe try calling `.iter()` or a similar method
examples\image.rs:28:20: 28:52 note: required by `vulkano::instance::instance::Instance::new`
examples\image.rs:41:28: 42:93 error: this function takes 5 parameters but 4 parameters were supplied [E0061]
examples\image.rs:41     let (device, queues) = vulkano::device::Device::new(&physical, physical.supported_features(),
examples\image.rs:42                                                         [(queue, 0.5)].iter().cloned(), &[])
examples\image.rs:41:28: 42:93 help: run `rustc --explain E0061` to see a detailed explanation
examples\image.rs:203:9: 205:99 error: this function takes 11 parameters but 10 parameters were supplied [E0061]
examples\image.rs:203         vulkano::pipeline::GraphicsPipeline::new(&device, &vs.main_entry_point(), &ia, &viewports,
examples\image.rs:204                                                  &raster, &ms, &blend, &fs.main_entry_point(),
examples\image.rs:205                                                  &pipeline_layout, renderpass.subpass(0).unwrap())
examples\image.rs:203:9: 205:99 help: run `rustc --explain E0061` to see a detailed explanation
examples\image.rs:205:79: 205:89 error: no method named `subpass` found for type `alloc::arc::Arc<vulkano::framebuffer::RenderPass<main::renderpass::Layout>>` in the current scope
examples\image.rs:205                                                  &pipeline_layout, renderpass.subpass(0).unwrap())
                                                                                                    ^~~~~~~~~~
examples\image.rs:226:36: 226:50 error: no method named `submit` found for type `alloc::arc::Arc<vulkano::command_buffer::outer::PrimaryCommandBuffer>` in the current scope
examples\image.rs:226         command_buffers[image_num].submit(&queue).unwrap();
                                                         ^~~~~~~~~~~~~~
error: aborting due to 6 previous errorsZ

And here is a different one

cargo run --example teapot
   Compiling vulkano v0.1.0 (file:///Z:/tyoc/Documentos/GitHub/vulkano/vulkano)
examples\teapot.rs:13:5: 13:20 warning: unused import, #[warn(unused_imports)] on by default
examples\teapot.rs:13 use std::ffi::OsStr;
                          ^~~~~~~~~~~~~~~
examples\teapot.rs:14:5: 14:36 warning: unused import, #[warn(unused_imports)] on by default
examples\teapot.rs:14 use std::os::windows::ffi::OsStrExt;
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples\teapot.rs:15:5: 15:13 warning: unused import, #[warn(unused_imports)] on by default
examples\teapot.rs:15 use std::mem;
                          ^~~~~~~~
Z:\tyoc\Documentos\GitHub\vulkano\vulkano\target\debug\build\vulkano-fcfdb4e00fb9d264\out/shaders/examples/teapot_fs.glsl:50:45: 50:52 warning: unused variable: `layouts`, #[warn(unused_variables)] on by default
Z:\tyoc\Documentos\GitHub\vulkano\vulkano\target\debug\build\vulkano-fcfdb4e00fb9d264\out/shaders/examples/teapot_fs.glsl:50     fn decode_descriptor_set_layouts(&self, layouts: Self::DescriptorSetLayouts)
                                                                                                                                                                         ^~~~~~~
examples\teapot.rs:19:10: 19:80 note: in this expansion of include!
Z:\tyoc\Documentos\GitHub\vulkano\vulkano\target\debug\build\vulkano-fcfdb4e00fb9d264\out/shaders/examples/teapot_fs.glsl:58:38: 58:42 warning: unused variable: `sets`, #[warn(unused_variables)] on by default
Z:\tyoc\Documentos\GitHub\vulkano\vulkano\target\debug\build\vulkano-fcfdb4e00fb9d264\out/shaders/examples/teapot_fs.glsl:58     fn decode_descriptor_sets(&self, sets: Self::DescriptorSets)
                                                                                                                                                                  ^~~~
examples\teapot.rs:19:10: 19:80 note: in this expansion of include!
     Running `target\debug\examples\teapot.exe`
thread '<main>' panicked at 'failed to create instance: LayerNotPresent', ../src/libcore\result.rs:709
Process didn't exit successfully: `target\debug\examples\teapot.exe` (exit code: 101)

And

cargo run --example triangle
   Compiling vulkano v0.1.0 (file:///Z:/tyoc/Documentos/GitHub/vulkano/vulkano)
examples\triangle.rs:24:65: 24:96 error: mismatched types:
 expected `&vulkano::instance::extensions::InstanceExtensions`,
    found `&[&str; 1]`
(expected struct `vulkano::instance::extensions::InstanceExtensions`,
    found array of 1 elements) [E0308]
examples\triangle.rs:24     let instance = vulkano::instance::Instance::new(Some(&app), &["VK_LAYER_LUNARG_draw_state"], &extensions).expect("failed to create instance");
                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples\triangle.rs:24:65: 24:96 help: run `rustc --explain E0308` to see a detailed explanation
examples\triangle.rs:24:20: 24:52 error: the trait `core::iter::Iterator` is not implemented for the type `&vulkano::instance::extensions::InstanceExtensions` [E0277]
examples\triangle.rs:24     let instance = vulkano::instance::Instance::new(Some(&app), &["VK_LAYER_LUNARG_draw_state"], &extensions).expect("failed to create instance");
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
examples\triangle.rs:24:20: 24:52 help: run `rustc --explain E0277` to see a detailed explanation
examples\triangle.rs:24:20: 24:52 note: `&vulkano::instance::extensions::InstanceExtensions` is not an iterator; maybe try calling `.iter()` or a similar method                                                                                examples\triangle.rs:24:20: 24:52 note: required by `vulkano::instance::instance::Instance::new`
examples\triangle.rs:68:28: 70:89 error: this function takes 5 parameters but 4 parameters were supplied [E0061]        examples\triangle.rs:68     let (device, queues) = vulkano::device::Device::new(&physical, physical.supported_features(),
examples\triangle.rs:69                                                         [(queue, 0.5)].iter().cloned(),
examples\triangle.rs:70                                                         &["VK_LAYER_LUNARG_draw_state"])
examples\triangle.rs:68:28: 70:89 help: run `rustc --explain E0061` to see a detailed explanation
examples\triangle.rs:204:9: 207:81 error: this function takes 11 parameters but 10 parameters were supplied [E0061]
examples\triangle.rs:204         vulkano::pipeline::GraphicsPipeline::new(&device, &vs.main_entry_point(), &ia, &viewports,
examples\triangle.rs:205                                                  &raster, &ms, &blend, &fs.main_entry_point(),
examples\triangle.rs:206                                                  &vulkano::descriptor_set::PipelineLayout::new(&device, vulkano::descriptor_set::EmptyPipelineDesc, ()).unwrap(),
examples\triangle.rs:207                                                  renderpass.subpass(0).unwrap()).unwrap()
examples\triangle.rs:204:9: 207:81 help: run `rustc --explain E0061` to see a detailed explanation
examples\triangle.rs:207:61: 207:71 error: no method named `subpass` found for type `alloc::arc::Arc<vulkano::framebuffer::RenderPass<main::renderpass::Layout>>` in the current scope
examples\triangle.rs:207                                                  renderpass.subpass(0).unwrap()).unwrap()
                                                                                     ^~~~~~~~~~
error: aborting due to 5 previous errors
@tomaka
Copy link
Member

tomaka commented Mar 12, 2016

Hi. The reason why you get compilation error is simply because I made lots of breaking changes in the API and only kept the teapot example up-to-date!

Also you get an error in the teapot example because it expects the SDK to be installed on the machine. I just pushed a change (69d6b90) that should fix that.

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 12, 2016

because drivers are drivers and SDKs are SDKs why would I need the lunar SDK to run/compile vulkano? anyway I downloaded and installed latest https://vulkan.lunarg.com

Updated master to 69d6b90 and get this error (after second run to dismiss extra compiler warnings)

cargo run --example teapot
     Running `target\debug\examples\teapot.exe`
thread '<main>' panicked at 'failed to create instance: ExtensionNotPresent', ../src/libcore\result.rs:709
Process didn't exit successfully: `target\debug\examples\teapot.exe` (exit code: 101)

Here is vulkaninfo if of any help

vulcaninfo.txt

@tomaka
Copy link
Member

tomaka commented Mar 12, 2016

You shouldn't need to install the SDK. The change I pushed fixed the example so that it no longer requires it.

For your other problem, that's interesting. The instance doesn't support VK_KHR_swapchain.

@tomaka
Copy link
Member

tomaka commented Mar 12, 2016

This should be fixed by 3e15fd3. My AMD driver is probably faulty.

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 12, 2016

Nice, but does that part need to be static and not dynamic?

Anyway, now I see a creation of a window... but still

cargo run --example teapot
     Running `target\debug\examples\teapot.exe`
Using device: GTX TITAN (type: DiscreteGpu)
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:330
Process didn't exit successfully: `target\debug\examples\teapot.exe` (exit code: 101)

And thanks for your fast answers :).

@tomaka
Copy link
Member

tomaka commented Mar 12, 2016

Nice, but does that part need to be static and not dynamic?

VK_KHR_surface is required to draw on windows, and VK_KHR_surface_win32 is require to draw on windows on Windows.

Anyway, now I see a creation of a window... but still

Please provide a backtrace with RUST_BACKTRACE=1

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 12, 2016

Here it is

cargo run --example teapot
     Running `target\debug\examples\teapot.exe`
Using device: GTX TITAN (type: DiscreteGpu)
thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:330
stack backtrace:
   0:     0x7ff6917a2ca5 - sys::ext::ffi::OsString.OsStringExt::from_wide::h7c8f6f825e0cb7e7JAv
   1:     0x7ff6917a7ce7 - rt::lang_start::h98aefce18d0542a30Ky
   2:     0x7ff691798808 - sys_common::unwind::begin_unwind_inner::h485629376f8607efSat
   3:     0x7ff691798c6b - sys_common::unwind::begin_unwind_fmt::ha23b0b11dd517285Y9s
   4:     0x7ff6917a0512 - rust_begin_unwind
   5:     0x7ff6917a96d8 - panicking::panic_fmt::h3dc40a8b303af4f9zYL
   6:     0x7ff6917a99d0 - panicking::panic::hf4e33ac4547ee3e16WL
   7:     0x7ff691409a7e - unwrap
                        at Z:\tyoc\Documentos\GitHub\vulkano\src\libcore\macros.rs:21
   8:     0x7ff69140786e - try_write
                        at Z:\tyoc\Documentos\GitHub\vulkano\vulkano\src\memory\single.rs:254
   9:     0x7ff69140777d - try_write
                        at Z:\tyoc\Documentos\GitHub\vulkano\vulkano\src\buffer.rs:335
  10:     0x7ff6913d218d - main
                        at Z:\tyoc\Documentos\GitHub\vulkano\vulkano\examples\teapot.rs:86
  11:     0x7ff6917a7628 - rt::lang_start::h98aefce18d0542a30Ky
  12:     0x7ff69179e72f - sys_common::unwind::try::inner_try::hf61c3446f7caab3aq7s
  13:     0x7ff6917a7529 - rt::lang_start::h98aefce18d0542a30Ky
  14:     0x7ff69144c879 - main
  15:     0x7ff6917b32e7 - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264
  16:     0x7ffc7f428101 - BaseThreadInitThunk
Process didn't exit successfully: `target\debug\examples\teapot.exe` (exit code: 101)

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 12, 2016

By the way, I try the same with image example (set RUST_BACKTRACE=1), but stack trace doesnt show

cargo run --example image
     Running `target\debug\examples\image.exe`
Using device: GTX TITAN (type: DiscreteGpu)
Process didn't exit successfully: `target\debug\examples\image.exe` (exit code: 3221226505)

The example uses swap chain so, the VS debugger catch this

1

2

And finally

3

@tomaka
Copy link
Member

tomaka commented Mar 12, 2016

Commit 7ab8067 should fix the teapot issue.

As for the swapchain, could you tell what error Visual Studio reported for the crash?

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 12, 2016

I updated to latest 31415af and the teapot example now launch on exit the VS debugger instead of show the backtrace... This is what I get in the output log... from VS...

The thread 0x38fc has exited with code 0 (0x0).
Unhandled exception at 0x0000000056FAE3CC (nvoglv64.dll) in teapot.exe: Fatal program exit requested.

The command promt only show

cargo run --example teapot
     Running `target\debug\examples\teapot.exe`
Using device: GTX TITAN (type: DiscreteGpu)
Process didn't exit successfully: `target\debug\examples\teapot.exe` (exit code: 3221226505)

Sorry I cant help more, but this are the windows I get

4

Later it prompts to choose a debugger

5

On the left on the bkreaced at exception if I click go to source I get

6

But if I go to thread 1 and click on the only call of teapot I go to

7

@reneeichhorn
Copy link

Teapot sample is broken for me again,

`<vulkano macros>:57:1: 57:23 error: the trait `core::clone::Clone` is not implemented for the type `collections::vec::IntoIter<vulkano::framebuffer::LayoutAttachmentDescription>` [E0277]
<vulkano macros>:57 UnsafeRenderPass:: new (
                    ^~~~~~~~~~~~~~~~~~~~~~
<vulkano macros>:55:42: 59:41 note: in this expansion of try! (defined in <std macros>)
<vulkano macros>:5:1: 9:21 note: in this expansion of ordered_passes_renderpass! (defined in <vulkano macros>)
examples\teapot.rs:140:9: 157:10 note: in this expansion of single_pass_renderpass! (defined in <vulkano macros>)
<vulkano macros>:57:1: 57:23 help: run `rustc --explain E0277` to see a detailed explanation
<vulkano macros>:57:1: 57:23 note: required by `vulkano::framebuffer::UnsafeRenderPass::new`
<vulkano macros>:57:1: 57:23 error: the trait `core::clone::Clone` is not implemented for the type `collections::vec::IntoIter<vulkano::framebuffer::LayoutPassDescription>` [E0277]
<vulkano macros>:57 UnsafeRenderPass:: new (
                    ^~~~~~~~~~~~~~~~~~~~~~
<vulkano macros>:55:42: 59:41 note: in this expansion of try! (defined in <std macros>)
<vulkano macros>:5:1: 9:21 note: in this expansion of ordered_passes_renderpass! (defined in <vulkano macros>)
examples\teapot.rs:140:9: 157:10 note: in this expansion of single_pass_renderpass! (defined in <vulkano macros>)
<vulkano macros>:57:1: 57:23 help: run `rustc --explain E0277` to see a detailed explanation
<vulkano macros>:57:1: 57:23 note: required by `vulkano::framebuffer::UnsafeRenderPass::new`
error: aborting due to 2 previous errors
Could not compile `vulkano`.`

I'm currently trying to write my first vulkano program, but that unfortunately breaks it

@tomaka
Copy link
Member

tomaka commented Mar 27, 2016

@auruss It compiles fine for me, plus the framebuffer code is a code that I haven't touched in the last few days. Make sure you have a recent version of Rust.

Other than that, I strongly encourage you not to use vulkano right now. Like the readme says, its API breaks every 5 minutes.

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 28, 2016

@tomaka I wonder what your configuration is (OS, rust version, Hardware and maybe drivers probably could be shared on the read me in the mean time vulkano become usable on any config).

@tomaka
Copy link
Member

tomaka commented Mar 28, 2016

@tyoc213 Windows and AMD drivers should work.

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 28, 2016

I see, guess I will need to build a little computer with and R9 fury or something.

By the way, I can confirm the compile error above.. Thought dont know why it compiles in your end and not on us, Im using rustc 1.7.0 (a5d1e7a59 2016-02-29) gcc version and cargo 0.8.0-nightly (28a0cbb 2016-01-17).

The problem did come from the merge of tomaka/vulkano/pull/9 specially 556adf8 (Render pass is now a trait) parent commit did compile teapot.

@tomaka
Copy link
Member

tomaka commented Mar 28, 2016

I investigated a bit, and apparently the Clone trait is only available on IntoIter starting from Rust 1.8.
Since I'm using the nightly version, I didn't realize that it wasn't available on stable. I also wasn't aware of the fact that code could compile on nightly but not stable even if you didn't activate any nightly-only feature.

@tyoc213
Copy link
Contributor Author

tyoc213 commented Mar 28, 2016

Well, 1.8 comes in April, so I uninstalled 1.7, installed https://www.rust-lang.org/downloads.html 1.8 (which is beta now, 1.9 is nightly) and under 364.7 drivers I see....

nice

A red teapot!


Well I jus tracked that the teapot example did start running in this commit b7fb160

tomaka added a commit that referenced this issue Apr 11, 2016
@tomaka
Copy link
Member

tomaka commented Apr 28, 2016

Since Rust 1.8 is now stable and a warning has been put in the README, I'm going to close this.

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

3 participants