#nvidia #vulkan #gpu #ffi #aftermath

nightly aftermath-rs

Rust 对 NVIDIA Aftermath 的绑定,针对 Vulkan 应用程序

3 个版本

0.1.3 2024 年 4 月 29 日
0.1.2 2023 年 6 月 30 日
0.1.1 2023 年 6 月 30 日
0.1.0 2023 年 6 月 23 日

##327 in 图形 API

每月 36 次下载

MIT 许可证

12KB
253

Aftermath-rs

NVIDIA Aftermath SDK 的 Rust 绑定,针对 Vulkan 应用程序。

此包可以帮助您在设备丢失事件后获取 NVIDIA Aftermath GPU 转储文件。

支持 Windows 和 Linux。自动下载并静态链接闭源二进制文件。

用法

extern crate aftermath_rs as aftermath;
use ash::vk;

struct Delegate;
impl aftermath::AftermathDelegate for Delegate {
    fn dumped(&mut self, dump_data: &[u8]) {
        // Write `dump_data` to file, or send to telemetry server
    }
    fn shader_debug_info(&mut self, data: &[u8]) {
    }

    fn description(&mut self, describe: &mut aftermath::DescriptionBuilder) {
    }
}

let _guard = aftermath::Aftermath::new(Delegate);

fn handle_error(error: vk::Result) -> vk::Result {
    let status = aftermath::Status::wait_for_status(Some(std::time::Duration::from_secs(5)));
    if status != aftermath::Status::Finished {
        panic!("Unexpected crash dump status: {:?}", status);
    }
    std::process::exit(1);
}

// Make Vulkan API Calls
device.queue_submit(..)
    .map_err(handle_error)
    .unwrap();

无运行时依赖

~130KB