EmbarkStudios / kajiya

πŸ’‘ Experimental real-time global illumination renderer πŸ¦€
Apache License 2.0
4.85k stars 179 forks source link

run kajiya in OSX #37

Closed tlightsky closed 1 year ago

tlightsky commented 2 years ago

Describe the bug can't run kajiya in OSX

To Reproduce Steps to reproduce the behavior:

  1. run build_and_run.sh
  2. See error
    = note: ld: library not found for -luuid
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior the error is expected, but not sure how to get it work in OSX try to figure out how to run it in OSX

Device:

hrydgard commented 2 years ago

the -luuid thing is this issue with the HLSL compiler: https://github.com/Traverse-Research/hassle-rs/issues/23

However there's no hope of getting it to run on MacOSX anyway, due to the lack of Vulkan raytracing support in MoltenVK (which itself is probably not really doable due to differences between Metal raytracing and Vulkan raytracing).

virtualritz commented 2 years ago

Would it be possible to run it w/o raytracing in some form at all? I.e. getting a shitty image but being able to see β€˜enough’ to contribute to the codebase?

E.g. for adding subdivision surface support with something like opensubdiv-petite I do not need to see the geometry with nice shading. It's enough to see it at all. πŸ€“

h3r2tic commented 2 years ago

@virtualritz: It would be possible to engineer it in a way that ray-tracing is optional. There's a ray-tracing Cargo.toml feature toggle, but kajiya doesn't currently compile with it off πŸ˜… If you're interested in fixing that, PRs would welcome!

It can be a trap though -- said subdiv support would need to work with ray-tracing, and that needs a path to get the geo into acceleration structures πŸ™ˆ

@tlightsky OSX per se is not a supported target. I don't run OSX, and there's no other maintainer right now. Sorry!

expenses commented 2 years ago

I've been looking into porting the code to macOS. I've got a fork here with my progress: https://github.com/EmbarkStudios/kajiya/compare/main...expenses:rtx-off. At the moment I'm just getting a timeout:

[mvk-error] VK_ERROR_DEVICE_LOST: Command buffer 0x7fc47b8e8fe0 "vkQueueSubmit CommandBuffer on Queue 0-0" execution failed (code 2): Caused GPU Timeout Error (00000002:kIOAccelCommandBufferCallbackErrorTimeout)
thread 'main' panicked at 'Wait for fence failed.: ERROR_DEVICE_LOST', crates/lib/kajiya-backend/src/vulkan/device.rs:483:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

but perhaps it would work with a better GPU.

To run it you'll need ossp-uuid installed (brew install ossp-uuid) to avoid a note: ld: library not found for -luuid error. This might not work on the M1 macs though (https://github.com/Traverse-Research/hassle-rs/issues/23#issuecomment-1003597930).

Then run ./bake.sh and ./build_and_run.sh battle as per normal.

The first commit (https://github.com/EmbarkStudios/kajiya/commit/60f78a6c5ee83864d6fcafe8d6f88619f0567d81) also seemed to work okay on Windows on a non-RTX GPU.

tlightsky commented 2 years ago

I've been looking into porting the code to macOS. I've got a fork here with my progress: main...expenses:rtx-off. At the moment I'm just getting a timeout:

[mvk-error] VK_ERROR_DEVICE_LOST: Command buffer 0x7fc47b8e8fe0 "vkQueueSubmit CommandBuffer on Queue 0-0" execution failed (code 2): Caused GPU Timeout Error (00000002:kIOAccelCommandBufferCallbackErrorTimeout)
thread 'main' panicked at 'Wait for fence failed.: ERROR_DEVICE_LOST', crates/lib/kajiya-backend/src/vulkan/device.rs:483:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

but perhaps it would work with a better GPU.

To run it you'll need ossp-uuid installed (brew install ossp-uuid) to avoid a note: ld: library not found for -luuid error. This might not work on the M1 macs though (Traverse-Research/hassle-rs#23 (comment)).

Then run ./bake.sh and ./build_and_run.sh battle as per normal.

The first commit (60f78a6) also seemed to work okay on Windows on a non-RTX GPU.

Great work, it's very nice to see the hope to run it on OSX, I'm trying to run bake.sh in rtx-off branch, after install ossp-uuid, I still got this error:

  = note: ld: library not found for -luuid
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

try to fix it

tlightsky commented 2 years ago

I found the lib manually:

brew list ossp-uuid   
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/bin/uuid
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/bin/uuid-config
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/include/ossp/uuid.h
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/lib/libuuid.16.dylib
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/lib/pkgconfig/uuid.pc
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/lib/ (2 other files)
/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/share/man/ (3 files)

and this helped me fix it,

export export LIBRARY_PATH=/opt/homebrew/Cellar/ossp-uuid/1.6.2_2/lib

not sure is it a good idea to put it to my ~/.zshrc

tlightsky commented 2 years ago

got another issue:

[2022-01-03 11:21:25][kajiya_simple::main_loop][INFO] Internal rendering extent: 1280x720
[2022-01-03 11:21:25][kajiya_backend::vulkan::instance][INFO] Created a Vulkan instance
[2022-01-03 11:21:25][kajiya_backend::vulkan][INFO] Available physical devices: [
    "Apple M1 Max",
]
[2022-01-03 11:21:25][kajiya_backend::vulkan][INFO] Selected physical device: PhysicalDevice { PhysicalDeviceProperties {
    api_version: 4198598,
    driver_version: 10106,
    vendor_id: 4203,
    device_id: 41280,
    device_type: INTEGRATED_GPU,
    device_name: "Apple M1 Max",
    pipeline_cache_uuid: [
        179,
        239,
        22,
        12,
        4,
        0,
        3,
        239,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
    ],
    limits: PhysicalDeviceLimits {
        max_image_dimension1_d: 16384,
        max_image_dimension2_d: 16384,
        max_image_dimension3_d: 2048,
        max_image_dimension_cube: 16384,
        max_image_array_layers: 2048,
        max_texel_buffer_elements: 67108864,
        max_uniform_buffer_range: 4294967295,
        max_storage_buffer_range: 4294967295,
        max_push_constants_size: 4096,
        max_memory_allocation_count: 1073741824,
        max_sampler_allocation_count: 1024,
        buffer_image_granularity: 16,
        sparse_address_space_size: 0,
        max_bound_descriptor_sets: 8,
        max_per_stage_descriptor_samplers: 16,
        max_per_stage_descriptor_uniform_buffers: 31,
        max_per_stage_descriptor_storage_buffers: 31,
        max_per_stage_descriptor_sampled_images: 128,
        max_per_stage_descriptor_storage_images: 8,
        max_per_stage_descriptor_input_attachments: 128,
        max_per_stage_resources: 159,
        max_descriptor_set_samplers: 80,
        max_descriptor_set_uniform_buffers: 155,
        max_descriptor_set_uniform_buffers_dynamic: 155,
        max_descriptor_set_storage_buffers: 155,
        max_descriptor_set_storage_buffers_dynamic: 155,
        max_descriptor_set_sampled_images: 640,
        max_descriptor_set_storage_images: 40,
        max_descriptor_set_input_attachments: 640,
        max_vertex_input_attributes: 31,
        max_vertex_input_bindings: 31,
        max_vertex_input_attribute_offset: 2047,
        max_vertex_input_binding_stride: 2048,
        max_vertex_output_components: 124,
        max_tessellation_generation_level: 64,
        max_tessellation_patch_size: 32,
        max_tessellation_control_per_vertex_input_components: 124,
        max_tessellation_control_per_vertex_output_components: 124,
        max_tessellation_control_per_patch_output_components: 120,
        max_tessellation_control_total_output_components: 4088,
        max_tessellation_evaluation_input_components: 124,
        max_tessellation_evaluation_output_components: 124,
        max_geometry_shader_invocations: 0,
        max_geometry_input_components: 0,
        max_geometry_output_components: 0,
        max_geometry_output_vertices: 0,
        max_geometry_total_output_components: 0,
        max_fragment_input_components: 124,
        max_fragment_output_attachments: 8,
        max_fragment_dual_src_attachments: 1,
        max_fragment_combined_output_resources: 159,
        max_compute_shared_memory_size: 32768,
        max_compute_work_group_count: [
            1073741824,
            1073741824,
            1073741824,
        ],
        max_compute_work_group_invocations: 1024,
        max_compute_work_group_size: [
            1024,
            1024,
            1024,
        ],
        sub_pixel_precision_bits: 4,
        sub_texel_precision_bits: 4,
        mipmap_precision_bits: 4,
        max_draw_indexed_index_value: 4294967295,
        max_draw_indirect_count: 1073741824,
        max_sampler_lod_bias: 4.0,
        max_sampler_anisotropy: 16.0,
        max_viewports: 16,
        max_viewport_dimensions: [
            16384,
            16384,
        ],
        viewport_bounds_range: [
            -32768.0,
            32767.0,
        ],
        viewport_sub_pixel_bits: 0,
        min_memory_map_alignment: 64,
        min_texel_buffer_offset_alignment: 16,
        min_uniform_buffer_offset_alignment: 16,
        min_storage_buffer_offset_alignment: 16,
        min_texel_offset: -8,
        max_texel_offset: 7,
        min_texel_gather_offset: -8,
        max_texel_gather_offset: 7,
        min_interpolation_offset: -0.5,
        max_interpolation_offset: 0.5,
        sub_pixel_interpolation_offset_bits: 4,
        max_framebuffer_width: 16384,
        max_framebuffer_height: 16384,
        max_framebuffer_layers: 2048,
        framebuffer_color_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_depth_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_stencil_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_no_attachments_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        max_color_attachments: 8,
        sampled_image_color_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_integer_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_depth_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_stencil_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        storage_image_sample_counts: TYPE_1,
        max_sample_mask_words: 1,
        timestamp_compute_and_graphics: 1,
        timestamp_period: 41.666668,
        max_clip_distances: 1073741824,
        max_cull_distances: 0,
        max_combined_clip_and_cull_distances: 1073741824,
        discrete_queue_priorities: 2,
        point_size_range: [
            1.0,
            511.0,
        ],
        line_width_range: [
            1.0,
            1.0,
        ],
        point_size_granularity: 1.0,
        line_width_granularity: 0.0,
        strict_lines: 0,
        standard_sample_locations: 1,
        optimal_buffer_copy_offset_alignment: 16,
        optimal_buffer_copy_row_pitch_alignment: 1,
        non_coherent_atom_size: 16,
    },
    sparse_properties: PhysicalDeviceSparseProperties {
        residency_standard2_d_block_shape: 0,
        residency_standard2_d_multisample_block_shape: 0,
        residency_standard3_d_block_shape: 0,
        residency_aligned_mip_size: 0,
        residency_non_resident_strict: 0,
    },
} }
[crates/lib/kajiya-backend/src/vulkan/device.rs:175] cfg!(feature = "ray-tracing") = false
[2022-01-03 11:21:25][kajiya_backend::vulkan::device][INFO] Created a Vulkan device
[2022-01-03 11:21:25][gpu_allocator][WARN] There is a memory type that is host visible, but not host coherent. It's time to upgrade our memory allocator to take advantage of this type of memory :)
[2022-01-03 11:21:25][kajiya_backend::vulkan][INFO] Available surface formats: [
    SurfaceFormatKHR {
        format: B8G8R8A8_UNORM,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: B8G8R8A8_SRGB,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: R16G16B16A16_SFLOAT,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: A2B10G10R10_UNORM_PACK32,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: A2R10G10B10_UNORM_PACK32,
        color_space: SRGB_NONLINEAR,
    },
]
[2022-01-03 11:21:25][kajiya_backend::vulkan::swapchain][INFO] Swapchain image count: 3
[2022-01-03 11:21:25][kajiya_backend::vulkan::swapchain][INFO] Presentation mode: FIFO
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [64, 64, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_asset::image][INFO] Loaded image: (256, 256) Rgba8
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [256, 256, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | COLOR_ATTACHMENT, flags: , format: R8G8B8A8_UNORM, extent: [2560, 1440, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: TRANSFER_DST | SAMPLED | STORAGE, flags: , format: R32G32B32A32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [384, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [3456, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [896, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-03 11:21:25][kajiya_backend::rust_shader_compiler][INFO] Building Rust-GPU shaders in the background...
A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed

Caused by:
    Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::pipeline_cache::CompilePipelineShaders" failed

Caused by:
    0: A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed
    1: Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed

Caused by:
    Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::pipeline_cache::CompilePipelineShaders" failed

Caused by:
    0: A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed
    1: Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed

Caused by:
    Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::pipeline_cache::CompilePipelineShaders" failed

Caused by:
    0: A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed
    1: Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
A turbosloth LazyWorker "kajiya_backend::shader_compiler::CompileShader" failed

Caused by:
    Failed to load library "./libdxcompiler.dynlib": DlOpen { desc: "dlopen(./libdxcompiler.dynlib, 0x0005): tried: \'./libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file), \'/Users/me/source/rust/kajiya/libdxcompiler.dynlib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64e\')), \'/usr/local/lib/libdxcompiler.dynlib\' (no such file), \'/usr/lib/libdxcompiler.dynlib\' (no such file)" }
tlightsky commented 2 years ago

but I can find it in my folder:

kajiya git:(rtx-off) βœ— find . | grep libdxcompiler      
./libdxcompiler.so
./libdxcompiler.dynlib
expenses commented 2 years ago

Ah, you're trying to load the x86 dynamic library but you're on a M1 Mac. I'll try and build a universal library when I get home. Alternatively you could build it yourself.

expenses commented 2 years ago

Ah, you're trying to load the x86 dynamic library but you're on a M1 Mac. I'll try and build a universal library when I get home. Alternatively you could build it yourself.

@tlightsky okay, I've pushed a new commit (https://github.com/EmbarkStudios/kajiya/commit/6599d2ed70e5ae2925cd44f7e546e1c0aa57f3ac) and it should be using a universal binary now. Try running it again.

file lib/libdxcompiler.3.7.dylib:

libdxcompiler.dynlib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
libdxcompiler.dynlib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
libdxcompiler.dynlib (for architecture arm64):  Mach-O 64-bit dynamically linked shared library arm64

For the record, this can be build like so:

git clone https://github.com/Microsoft/DirectXShaderCompiler --recursive
cd DirectXShaderCompiler
mkdir build
cd build
cmake ..  -GNinja -DCMAKE_BUILD_TYPE=Release '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' -C ../cmake/caches/PredefinedParams.cmake
ninja
file lib/libdxcompiler.3.7.dylib
tlightsky commented 2 years ago

try to run it on my mac, but the system got stuck suddenly, then reboot automatically after a while, will retry it at some time later

tlightsky commented 2 years ago

here is some logs before reboot, not sure is it helps:

    Finished release [optimized + debuginfo] target(s) in 0.10s
     Running `target/release/view --scene battle --width 1280 --height 720 --no-debug`
[2022-01-05 02:33:08][kajiya_simple::main_loop][INFO] Internal rendering extent: 1280x720
[2022-01-05 02:33:08][kajiya_backend::vulkan::instance][INFO] Created a Vulkan instance
[2022-01-05 02:33:08][kajiya_backend::vulkan][INFO] Available physical devices: [
    "Apple M1 Max",
]
[2022-01-05 02:33:08][kajiya_backend::vulkan][INFO] Selected physical device: PhysicalDevice { PhysicalDeviceProperties {
    api_version: 4198598,
    driver_version: 10106,
    vendor_id: 4203,
    device_id: 41280,
    device_type: INTEGRATED_GPU,
    device_name: "Apple M1 Max",
    pipeline_cache_uuid: [
        179,
        239,
        22,
        12,
        4,
        0,
        3,
        239,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
    ],
    limits: PhysicalDeviceLimits {
        max_image_dimension1_d: 16384,
        max_image_dimension2_d: 16384,
        max_image_dimension3_d: 2048,
        max_image_dimension_cube: 16384,
        max_image_array_layers: 2048,
        max_texel_buffer_elements: 67108864,
        max_uniform_buffer_range: 4294967295,
        max_storage_buffer_range: 4294967295,
        max_push_constants_size: 4096,
        max_memory_allocation_count: 1073741824,
        max_sampler_allocation_count: 1024,
        buffer_image_granularity: 16,
        sparse_address_space_size: 0,
        max_bound_descriptor_sets: 8,
        max_per_stage_descriptor_samplers: 16,
        max_per_stage_descriptor_uniform_buffers: 31,
        max_per_stage_descriptor_storage_buffers: 31,
        max_per_stage_descriptor_sampled_images: 128,
        max_per_stage_descriptor_storage_images: 8,
        max_per_stage_descriptor_input_attachments: 128,
        max_per_stage_resources: 159,
        max_descriptor_set_samplers: 80,
        max_descriptor_set_uniform_buffers: 155,
        max_descriptor_set_uniform_buffers_dynamic: 155,
        max_descriptor_set_storage_buffers: 155,
        max_descriptor_set_storage_buffers_dynamic: 155,
        max_descriptor_set_sampled_images: 640,
        max_descriptor_set_storage_images: 40,
        max_descriptor_set_input_attachments: 640,
        max_vertex_input_attributes: 31,
        max_vertex_input_bindings: 31,
        max_vertex_input_attribute_offset: 2047,
        max_vertex_input_binding_stride: 2048,
        max_vertex_output_components: 124,
        max_tessellation_generation_level: 64,
        max_tessellation_patch_size: 32,
        max_tessellation_control_per_vertex_input_components: 124,
        max_tessellation_control_per_vertex_output_components: 124,
        max_tessellation_control_per_patch_output_components: 120,
        max_tessellation_control_total_output_components: 4088,
        max_tessellation_evaluation_input_components: 124,
        max_tessellation_evaluation_output_components: 124,
        max_geometry_shader_invocations: 0,
        max_geometry_input_components: 0,
        max_geometry_output_components: 0,
        max_geometry_output_vertices: 0,
        max_geometry_total_output_components: 0,
        max_fragment_input_components: 124,
        max_fragment_output_attachments: 8,
        max_fragment_dual_src_attachments: 1,
        max_fragment_combined_output_resources: 159,
        max_compute_shared_memory_size: 32768,
        max_compute_work_group_count: [
            1073741824,
            1073741824,
            1073741824,
        ],
        max_compute_work_group_invocations: 1024,
        max_compute_work_group_size: [
            1024,
            1024,
            1024,
        ],
        sub_pixel_precision_bits: 4,
        sub_texel_precision_bits: 4,
        mipmap_precision_bits: 4,
        max_draw_indexed_index_value: 4294967295,
        max_draw_indirect_count: 1073741824,
        max_sampler_lod_bias: 4.0,
        max_sampler_anisotropy: 16.0,
        max_viewports: 16,
        max_viewport_dimensions: [
            16384,
            16384,
        ],
        viewport_bounds_range: [
            -32768.0,
            32767.0,
        ],
        viewport_sub_pixel_bits: 0,
        min_memory_map_alignment: 64,
        min_texel_buffer_offset_alignment: 16,
        min_uniform_buffer_offset_alignment: 16,
        min_storage_buffer_offset_alignment: 16,
        min_texel_offset: -8,
        max_texel_offset: 7,
        min_texel_gather_offset: -8,
        max_texel_gather_offset: 7,
        min_interpolation_offset: -0.5,
        max_interpolation_offset: 0.5,
        sub_pixel_interpolation_offset_bits: 4,
        max_framebuffer_width: 16384,
        max_framebuffer_height: 16384,
        max_framebuffer_layers: 2048,
        framebuffer_color_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_depth_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_stencil_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        framebuffer_no_attachments_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        max_color_attachments: 8,
        sampled_image_color_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_integer_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_depth_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        sampled_image_stencil_sample_counts: TYPE_1 | TYPE_2 | TYPE_4,
        storage_image_sample_counts: TYPE_1,
        max_sample_mask_words: 1,
        timestamp_compute_and_graphics: 1,
        timestamp_period: 41.666668,
        max_clip_distances: 1073741824,
        max_cull_distances: 0,
        max_combined_clip_and_cull_distances: 1073741824,
        discrete_queue_priorities: 2,
        point_size_range: [
            1.0,
            511.0,
        ],
        line_width_range: [
            1.0,
            1.0,
        ],
        point_size_granularity: 1.0,
        line_width_granularity: 0.0,
        strict_lines: 0,
        standard_sample_locations: 1,
        optimal_buffer_copy_offset_alignment: 16,
        optimal_buffer_copy_row_pitch_alignment: 1,
        non_coherent_atom_size: 16,
    },
    sparse_properties: PhysicalDeviceSparseProperties {
        residency_standard2_d_block_shape: 0,
        residency_standard2_d_multisample_block_shape: 0,
        residency_standard3_d_block_shape: 0,
        residency_aligned_mip_size: 0,
        residency_non_resident_strict: 0,
    },
} }
[crates/lib/kajiya-backend/src/vulkan/device.rs:175] cfg!(feature = "ray-tracing") = false
[2022-01-05 02:33:08][kajiya_backend::vulkan::device][INFO] Created a Vulkan device
[2022-01-05 02:33:08][gpu_allocator][WARN] There is a memory type that is host visible, but not host coherent. It's time to upgrade our memory allocator to take advantage of this type of memory :)
[2022-01-05 02:33:08][kajiya_backend::vulkan][INFO] Available surface formats: [
    SurfaceFormatKHR {
        format: B8G8R8A8_UNORM,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: B8G8R8A8_SRGB,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: R16G16B16A16_SFLOAT,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: A2B10G10R10_UNORM_PACK32,
        color_space: SRGB_NONLINEAR,
    },
    SurfaceFormatKHR {
        format: A2R10G10B10_UNORM_PACK32,
        color_space: SRGB_NONLINEAR,
    },
]
[2022-01-05 02:33:08][kajiya_backend::vulkan::swapchain][INFO] Swapchain image count: 3
[2022-01-05 02:33:08][kajiya_backend::vulkan::swapchain][INFO] Presentation mode: FIFO
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [64, 64, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_asset::image][INFO] Loaded image: (256, 256) Rgba8
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [256, 256, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | COLOR_ATTACHMENT, flags: , format: R8G8B8A8_UNORM, extent: [2560, 1440, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: TRANSFER_DST | SAMPLED | STORAGE, flags: , format: R32G32B32A32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [384, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [3456, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [896, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:08][kajiya_backend::rust_shader_compiler][INFO] Building Rust-GPU shaders in the background...
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Cube, usage: SAMPLED | STORAGE, flags: CUBE_COMPATIBLE, format: R16G16B16A16_SFLOAT, extent: [32, 32, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 6 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Cube, usage: SAMPLED | STORAGE, flags: CUBE_COMPATIBLE, format: R16G16B16A16_SFLOAT, extent: [16, 16, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 6 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED | STORAGE, flags: , format: R8_UNORM, extent: [64, 64, 64], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex3d, usage: SAMPLED, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | COLOR_ATTACHMENT, flags: , format: A2R10G10B10_UNORM_PACK32, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | COLOR_ATTACHMENT, flags: , format: R32G32B32A32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: TRANSFER_DST | SAMPLED | DEPTH_STENCIL_ATTACHMENT, flags: , format: D32_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | COLOR_ATTACHMENT, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SNORM, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R8G8B8A8_SNORM, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R32_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8_UNORM, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R32_UINT, extent: [160, 180, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R32_UINT, extent: [160, 180, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R16G16B16A16_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R32G32B32A32_SFLOAT, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED, flags: , format: R8G8B8A8_SNORM, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [80, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [80, 45, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16_SFLOAT, extent: [80, 45, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: R16G16B16A16_SFLOAT, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 9, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [640, 360, 1], tiling: OPTIMAL, mip_levels: 9, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: SAMPLED | STORAGE, flags: , format: B10G11R11_UFLOAT_PACK32, extent: [1280, 720, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
[2022-01-05 02:33:10][kajiya_backend::vulkan::image][INFO] Creating an image: ImageDesc { image_type: Tex2d, usage: TRANSFER_DST | SAMPLED, flags: , format: R8G8B8A8_UNORM, extent: [1, 1, 1], tiling: OPTIMAL, mip_levels: 1, array_elements: 1 }
tlightsky commented 2 years ago

system sadly got stuck again in OSX

h3r2tic commented 2 years ago

I've added GPU crash tracking in #44; not sure if it will work in OSX, but might help track down whatever is causing the system crash (the output goes to output.log and the console).

expenses commented 2 years ago

@h3r2tic nice, I've merged those changes into my branch (latest commit: https://github.com/EmbarkStudios/kajiya/commit/b63ad2bc5119b2ff52d3ceba686244e5f40c68da). It's crashing at the post combine stage:

[2022-02-02 13:36:59][kajiya_backend::vulkan::error][ERROR] The GPU device has been lost. This is usually due to an infinite loop in a shader.
The last crash marker was: 118 => begin render pass "post combine". The problem most likely exists directly after.
h3r2tic commented 2 years ago

Oh that's strange, but maybe good news! That stage doesn't do much interesting stuff at all. Should be easy to replace with a pass-through even πŸ™‚

expenses commented 2 years ago

I switched to the hlsl post combine shader in https://github.com/EmbarkStudios/kajiya/commit/e02ce93cf70d31e0e841cb68cbff8c0e3a67a623 and it works now!

Screen Shot 2022-02-02 at 13 58 19

Pretty slowly (check out that cpu frame time lmao) but still!

h3r2tic commented 2 years ago

w00t! nice work! πŸ˜€

... what the heck is the CPU doing there though πŸ˜‚ are you sure it's not using software rasterization? πŸ˜‰

virtualritz commented 2 years ago

w00t! nice work! πŸ˜€

... what the heck is the CPU doing there though πŸ˜‚ are you sure it's not using software rasterization? πŸ˜‰

Who cares? I have an Intel Iris GPU in my "on the road" 2014 MBP. As long as I get an image and I can test shit I don't mind. :)