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

wait_semaphores function loading error #289

Closed
KyleNBurke opened this issue Apr 18, 2020 · 10 comments
Closed

wait_semaphores function loading error #289

KyleNBurke opened this issue Apr 18, 2020 · 10 comments

Comments

@KyleNBurke
Copy link

KyleNBurke commented Apr 18, 2020

I can't seem to use the wait_semaphores() function, I'm getting a run time error.

thread 'main' panicked at 'Unable to load wait_semaphores', C:\Users\kylen\.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\ash-0.30.0\src\vk.rs:7592:21
stack backtrace:
   0: core::fmt::write
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libcore\fmt\mod.rs:1052
   1: std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\io\mod.rs:1426
   2: std::sys_common::backtrace::_print
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\sys_common\backtrace.rs:62
   3: std::sys_common::backtrace::print
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\sys_common\backtrace.rs:49
   4: std::panicking::default_hook::{{closure}}
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\panicking.rs:204
   5: std::panicking::default_hook
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\panicking.rs:224
   6: std::panicking::rust_panic_with_hook
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\panicking.rs:472
   7: std::panicking::begin_panic<str*>
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\src\libstd\panicking.rs:399
   8: ash::vk::{{impl}}::load::wait_semaphores
             at C:\Users\kylen\.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\ash-0.30.0\src\vk.rs:7592
   9: ash::vk::DeviceFnV1_2::wait_semaphores
             at C:\Users\kylen\.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\ash-0.30.0\src\vk.rs:7782
  10: ash::device::DeviceV1_2::wait_semaphores<ash::device::Device>
             at C:\Users\kylen\.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\ash-0.30.0\src\device.rs:146
  11: minimal_example::main
             at .\src\main.rs:12
  12: std::rt::lang_start::{{closure}}<()>
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\src\libstd\rt.rs:67
  13: std::rt::lang_start_internal::{{closure}}::{{closure}}
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\/src\libstd\rt.rs:52
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\minimal_example.exe` (exit code: 101)

Here is a minimal code example.

use ash::{vk, version::EntryV1_0, version::InstanceV1_0, version::DeviceV1_2};

fn main() {
    let entry = ash::Entry::new().unwrap();
    let app_info = vk::ApplicationInfo::builder().api_version(vk::make_version(1, 2, 0));
    let create_info = vk::InstanceCreateInfo::builder().application_info(&app_info);
    let instance = unsafe { entry.create_instance(&create_info, None).unwrap() };
    let physical_device = unsafe { instance.enumerate_physical_devices().unwrap()[0] };
    let logical_device_create_info = vk::DeviceCreateInfo::builder();
    let logical_device = unsafe { instance.create_device(physical_device, &logical_device_create_info, None).unwrap() };
    let wait_info = vk::SemaphoreWaitInfo::builder();
    unsafe { logical_device.wait_semaphores(logical_device.handle(), &wait_info, std::u64::MAX).unwrap() };
}

I'm using Ash v0.30.0 and according to this comment on the PR for the wait_semaphores method implementation I should just be able to do device.wait_semaphores(device.handle(), &semaphore_wait_info, timeout)?; with vulkan 1.2 but for some reason I cannot.

Have I done something wrong here or is this a bug?

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

Are you sure that your drivers support Vulkan 1.2? Mine do (RADV 20.0.4 with RX 580 on Linux) and your minimal code example runs fine. Maybe make sure that you are choosing the correct PhysicalDevice.

@Ralith
Copy link
Collaborator

Ralith commented Apr 18, 2020

Does seem odd that they aren't reporting an error on creating the instance, though.

e: ah, right, that'd be because the loader supports 1.2 but the driver doesn't. I guess you need to check the features for the device.

@KyleNBurke
Copy link
Author

KyleNBurke commented Apr 18, 2020

I just updated my drivers and I still get the error. They should support Vulkan 1.2, I have a Nvidia GeForce RTX 2070 Super. How can I determine that for certain?

e: oh I just found this: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html

I'll see if 1.2 is there.

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

A really useful tool i use a lot is vulkaninfo, it is included in the LunarG Vulkan SDK. Here's documentation on how to use it: https://vulkan.lunarg.com/doc/sdk/1.2.135.0/windows/vulkaninfo.html

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

e: oh I just found this: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html

I'll see if 1.2 is there.

As far as i know, this is just your Vulkan Instance Version, which is probably different from the supported Vulkan Version reported from the driver. You should be looking at this.
image

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

If you prefer to display that information using ash, i wrote up this quick program.

use ash::{version::EntryV1_0, version::InstanceV1_0, vk};

fn main() {
    let entry = ash::Entry::new().unwrap();
    let app_info = vk::ApplicationInfo::builder().api_version(vk::make_version(1, 0, 0));
    let create_info = vk::InstanceCreateInfo::builder().application_info(&app_info);
    let instance = unsafe { entry.create_instance(&create_info, None).unwrap() };
    for physical_device in unsafe { instance.enumerate_physical_devices().unwrap() } {
        let properties = unsafe { instance.get_physical_device_properties(physical_device) };
        println!(
            "Physical Device {:?} supports Vulkan version {}.{}.{}",
            unsafe { std::ffi::CStr::from_ptr(properties.device_name.as_ptr()) },
            vk::version_major(properties.api_version),
            vk::version_minor(properties.api_version),
            vk::version_patch(properties.api_version)
        );
    }
}

@KyleNBurke
Copy link
Author

@Friz64 vulkaninfo gives me 1.1.126 where your arrow is pointing. vkEnumerateInstanceVersion of course shows the same.

I bet it's because I didn't download the beta drivers found here:
https://developer.nvidia.com/vulkan-driver

I just downloaded from here:
https://www.nvidia.com/Download/index.aspx

I didn't realize Vulkan 1.2 is in beta, I will get the beta drivers and report back!

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

vkEnumerateInstanceVersion of course shows the same.

I don't know how Vulkan is handled on Windows, but don't assume they will always be the same. On my system (Arch Linux) Vulkan Instance Version reports 1.2.135, but the PhysicalDevice's apiVersion shows 1.2.128. It's the version you should be interested in if you plan on using that version's features with that PhysicalDevice.

@KyleNBurke
Copy link
Author

@Friz64 I see, thanks for the clarification. Installing the Nvidia beta drivers for Vulkan 1.2 fixed this issue, I appreciate all the help!

@Friz64
Copy link
Contributor

Friz64 commented Apr 18, 2020

Glad i could help :)

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