Rust-GPU / Rust-CUDA

Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.
Apache License 2.0
2.97k stars 112 forks source link

Can't build `denoiser` example #41

Open hatoo opened 2 years ago

hatoo commented 2 years ago

I couldn't build denoiser example.

I had succeeded to build it in fd87b735ff8ff6168737f16e4facca but failed to current master branch

I used CUDA SDK 11.2.

PS C:\Users\hato2\Desktop\Rust-CUDA\examples\optix\denoiser> cargo build
    Updating crates.io index
   Compiling cust_derive v0.1.0 (C:\Users\hato2\Desktop\Rust-CUDA\crates\cust_derive)
   Compiling optix v0.1.0 (C:\Users\hato2\Desktop\Rust-CUDA\crates\optix)
   Compiling cust_core v0.1.0 (C:\Users\hato2\Desktop\Rust-CUDA\crates\cust_core)
   Compiling cust v0.2.2 (C:\Users\hato2\Desktop\Rust-CUDA\crates\cust)
error[E0425]: cannot find value `OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM` in module `sys`
    --> crates\optix\src\acceleration.rs:1569:40
     |
1569 |         const DISABLE_TRANSFORM = sys::OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_ANYHIT`
     |
    ::: C:\Users\hato2\Desktop\Rust-CUDA\target\debug\build\optix-715ab9f0db917c6b\out/optix_wrapper.rs:417:1
     |
417  | pub const OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_ANYHIT: OptixInstanceFlags = 4;
     | ---------------------------------------------------------------------------------------- similarly named constant `OptixInstanceFlags_OPTIX_INSTANCE_FLAG_DISABLE_ANYHIT` defined here

error[E0425]: cannot find value `OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO` in module `sys::OptixCompileDebugLevel`
   --> crates\optix\src\pipeline.rs:162:45
    |
162 |     LineInfo = sys::OptixCompileDebugLevel::OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO,
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `OPTIX_COMPILE_DEBUG_LEVEL_MINIMAL`
    |
   ::: C:\Users\hato2\Desktop\Rust-CUDA\target\debug\build\optix-715ab9f0db917c6b\out/optix_wrapper.rs:696:5
    |
696 |     pub const OPTIX_COMPILE_DEBUG_LEVEL_MINIMAL: Type = 9041;
    |     --------------------------------------------------------- similarly named constant `OPTIX_COMPILE_DEBUG_LEVEL_MINIMAL` defined here

error[E0063]: missing field `endcapFlags` in initializer of `OptixBuildInputCurveArray`
    --> crates\optix\src\acceleration.rs:1094:58
     |
1094 |                 curve_array: std::mem::ManuallyDrop::new(sys::OptixBuildInputCurveArray {
     |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `endcapFlags`

error[E0560]: struct `OptixPipelineCompileOptions` has no field named `reserved`
   --> crates\optix\src\pipeline.rs:296:21
    |
296 |                     reserved: 0,
    |                     ^^^^^^^^ `OptixPipelineCompileOptions` does not have this field
    |
    = note: available fields are: `usesMotionBlur`, `traversableGraphFlags`, `numPayloadValues`, `numAttributeValues`, `exceptionFlags` ... and 2 others

error[E0560]: struct `OptixPipelineCompileOptions` has no field named `reserved2`
   --> crates\optix\src\pipeline.rs:297:21
    |
297 |                     reserved2: 0,
    |                     ^^^^^^^^^ `OptixPipelineCompileOptions` does not have this field
    |
    = note: available fields are: `usesMotionBlur`, `traversableGraphFlags`, `numPayloadValues`, `numAttributeValues`, `exceptionFlags` ... and 2 others

error[E0063]: missing fields `buildFlags` and `curveEndcapFlags` in initializer of `OptixBuiltinISOptions`
   --> crates\optix\src\pipeline.rs:402:26
    |
402 |         let is_options = sys::OptixBuiltinISOptions {
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `buildFlags` and `curveEndcapFlags`

error[E0560]: struct `OptixProgramGroupOptions` has no field named `reserved`
   --> crates\optix\src\pipeline.rs:566:62
    |
566 |             let pg_options = sys::OptixProgramGroupOptions { reserved: 0 };
    |                                                              ^^^^^^^^ `OptixProgramGroupOptions` does not have this field
    |
    = note: available fields are: `payloadType`

error[E0560]: struct `OptixProgramGroupOptions` has no field named `reserved`
   --> crates\optix\src\pipeline.rs:612:62
    |
612 |             let pg_options = sys::OptixProgramGroupOptions { reserved: 0 };
    |                                                              ^^^^^^^^ `OptixProgramGroupOptions` does not have this field
    |
    = note: available fields are: `payloadType`

error[E0063]: missing fields `numPayloadTypes` and `payloadTypes` in initializer of `OptixModuleCompileOptions`
   --> crates\optix\src\pipeline.rs:184:17
    |
184 |                 sys::OptixModuleCompileOptions {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `numPayloadTypes` and `payloadTypes`

Some errors have detailed explanations: E0063, E0425, E0560.
For more information about an error, try `rustc --explain E0063`.
error: could not compile `optix` due to 9 previous errors
RDambrosio016 commented 2 years ago

What OptiX SDK version are you using?

hatoo commented 2 years ago

OptiX™ SDK 7.4.0

RDambrosio016 commented 2 years ago

I see, we did not try 7.4 yet because it changed a lot of things. We regenerate the bindings at compile time based on the user's sdk so the crate works on any 7.x. Im currently busy trying to finish up stuff for 0.3 but after that i will probably work a bit more on OptiX

hatoo commented 2 years ago

Thanks, I've succeeded to build with OptiX SDK 7.3.0