How to initialize struct obj

error[E0381]: assign to part of possibly-uninitialized variable: `compress_buffer`
  --> src/cudalib.rs:81:17
   |
81 |                 compress_buffer.batch_nonces = nonces;
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly-uninitialized `compress_buffer`
let compress_buffer: CompressBuffer;
            unsafe {
                compress_buffer.batch_nonces = nonces;
                compress_buffer.final_buffer = Vec::from_raw_parts(
                    pointer_final as *mut u8,
                    final_buffer_size,
                    final_buffer_size,
                );
                compress_buffer.compute_buffer =
                    Vec::from_raw_parts(pointer_compute as *mut u8, buffer_size, buffer_size);
                compress_buffer.know_buffer =
                    Vec::from_raw_parts(pointer_known as *mut u8, buffer_size, buffer_size);
            }

is that we can't initial object with uninitalized ?

You must initialize the entire variable to a value before you can modify its fields.