Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

[Bug]: CUDA_ERROR_INVALID_PTX LuisaRender

Open ph3rro opened this issue 1 year ago • 0 comments

Bug Description

I previously had issues when trying to run cd genesis/ext/LuisaRender cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.9 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON # remember to check python version cmake --build build -j $(nproc)

I installed python3.9 and the issues seemed to be resolved. However, when I try to run the example cd examples/rendering python demo.py, I get the following error:



[2025-01-26 15:49:48.094] [console] [error] CUDA_ERROR_INVALID_PTX: a PTX JIT compilation failed [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader_native.cpp:66]
     0 [0x73b6e03405fc]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDAShaderNative::CUDAShaderNative(luisa::compute::cuda::CUDADevice*, eastl::vector<std::byte, eastl::allocator>, char const*, luisa::compute::cuda::CUDAShaderMetadata const&, eastl::vector<luisa::compute::Argument, eastl::allocator>) + 812
     1 [0x73b6e02ae38a]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDADevice::_create_shader(std::__cxx11::basic_string<char, std::char_traits<char>, luisa::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, luisa::allocator<char> > const&, luisa::compute::ShaderOption const&, eastl::span<char const* const, 18446744073709551615ul>, luisa::compute::cuda::CUDAShaderMetadata const&, eastl::vector<luisa::compute::Argument, eastl::allocator>) + 1546
     2 [0x73b6e02b414b]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDADevice::create_shader(luisa::compute::ShaderOption const&, luisa::compute::Function) + 3323
     3 [0x73b78e6502fe]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/libluisa-render-integrator-wavepath.so :: unknown + 213758
     4 [0x73b6e8302454]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/libluisa-render-util.so :: std::thread::_State_impl<std::thread::_Invoker<std::tuple<luisa::render::ThreadPool::Impl::Impl(unsigned long)::{lambda()#1}> > >::_M_run() + 196
     5 [0x73b81d2dc253]: /lib/x86_64-linux-gnu/libstdc++.so.6 :: unknown + 901715
     6 [0x73b86b294ac3]: /lib/x86_64-linux-gnu/libc.so.6 :: unknown + 608963
     7 [0x73b86b326850]: /lib/x86_64-linux-gnu/libc.so.6 :: unknown + 1206352

It seems like the shaders failed or something because I got the resulting image:

Image

Additionally a window popped up saying that python3.10 stopped unexpectedly, and "python3.10 crashed with SIGBART in luisa::compute::cuda::CUDAShaderNative::CUDAShaderNative()"

I'd also like to mention that I got a lot of warnings when compiling LuisiaRender, saying stuff like warning: unused variable or warning: associated items ... are never used or warning: function ... is never used or warning: use of deprecated function

Steps to Reproduce

Ubuntu 22.04 CUDA Toolkit version 12.8 Python version 3.9 (downgraded it)

Followed installation instructions and ran:

cd examples/rendering
python demo.py

Expected Behavior

Correct rendering and lack of errors.

Screenshots/Videos

Image

Image

Image

Relevant log output

[2025-01-26 15:52:43.471] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:43.471] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:43.488] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:43.488] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:44.013] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:44.013] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:44.029] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:44.029] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:44.133] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:44.133] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:44.193] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:44.193] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:45.095] [console] [warning] The PTX version is not supported by the installed CUDA driver. Trying to patch the PTX to make it compatible with the driver. This might cause unexpected behavior. Please consider upgrading your CUDA driver. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:13]
[2025-01-26 15:52:45.095] [console] [warning] Patch PTX version from 8.7 to 8.0. [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader.cpp:53]
[2025-01-26 15:52:45.109] [console] [error] CUDA_ERROR_INVALID_PTX: a PTX JIT compilation failed [/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/backends/cuda/cuda_shader_native.cpp:66]
     0 [0x75a6b03405fc]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDAShaderNative::CUDAShaderNative(luisa::compute::cuda::CUDADevice*, eastl::vector<std::byte, eastl::allocator>, char const*, luisa::compute::cuda::CUDAShaderMetadata const&, eastl::vector<luisa::compute::Argument, eastl::allocator>) + 812
     1 [0x75a6b02ae38a]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDADevice::_create_shader(std::__cxx11::basic_string<char, std::char_traits<char>, luisa::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, luisa::allocator<char> > const&, luisa::compute::ShaderOption const&, eastl::span<char const* const, 18446744073709551615ul>, luisa::compute::cuda::CUDAShaderMetadata const&, eastl::vector<luisa::compute::Argument, eastl::allocator>) + 1546
     2 [0x75a6b02b414b]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/liblc-backend-cuda.so :: luisa::compute::cuda::CUDADevice::create_shader(luisa::compute::ShaderOption const&, luisa::compute::Function) + 3323
     3 [0x75a75d66f2fe]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/libluisa-render-integrator-wavepath.so :: unknown + 213758
     4 [0x75a6b8302454]: /home/sickopickle/Genesis/genesis/ext/LuisaRender/build/bin/libluisa-render-util.so :: std::thread::_State_impl<std::thread::_Invoker<std::tuple<luisa::render::ThreadPool::Impl::Impl(unsigned long)::{lambda()#1}> > >::_M_run() + 196
     5 [0x75a7ec8dc253]: /lib/x86_64-linux-gnu/libstdc++.so.6 :: unknown + 901715
     6 [0x75a83a694ac3]: /lib/x86_64-linux-gnu/libc.so.6 :: unknown + 608963
     7 [0x75a83a726850]: /lib/x86_64-linux-gnu/libc.so.6 :: unknown + 1206352
Aborted (core dumped)

shell
/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/core/binary_file_stream.cpp: In member function ‘virtual void luisa::BinaryFileStream::read(eastl::span<std::byte>)’:
/home/sickopickle/Genesis/genesis/ext/LuisaRender/src/compute/src/core/binary_file_stream.cpp:68:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |     fread(dst.data(), 1, size, _file);



warning: unused import: `crate::*`
 --> luisa_compute_ir_v2/src/convert.rs:1:5
  |
1 | use crate::*;
  |     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

[ 39%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/AssetLib/X3D/X3DImporter_Group.cpp.o
warning: unused variable: `module`
  --> luisa_compute_ir_v2/src/convert.rs:10:20
   |
10 |     pub fn convert(module:ir_v1::ir::Module) {
   |                    ^^^^^^ help: if this is intentional, prefix it with an underscore: `_module`
   |
   = note: `#[warn(unused_variables)]` on by default

[ 39%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/AssetLib/X3D/X3DImporter_Light.cpp.o
warning: struct `V1ToV2` is never constructed
 --> luisa_compute_ir_v2/src/convert.rs:5:8
  |
5 | struct V1ToV2 {
  |        ^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: associated function `convert` is never used
  --> luisa_compute_ir_v2/src/convert.rs:10:12
   |
9  | impl V1ToV2 {
   | ----------- associated function in this implementation
10 |     pub fn convert(module:ir_v1::ir::Module) {
   |            ^^^^^^^

warning: creating a shared reference to mutable static is discouraged
  --> luisa_compute_ir_v2/src/lib.rs:38:15
   |
38 |     unsafe { &LIB.as_ref().unwrap().binding }
   |               ^^^^^^^^^^^^ shared reference to mutable static
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
   = note: `#[warn(static_mut_refs)]` on by default

warning: `luisa_compute_ir_v2` (lib) generated 5 warnings (run `cargo fix --lib -p luisa_compute_ir_v2` to apply 1 suggestion)






warning: unused import: `std::ptr::null`
 --> luisa_compute_backend_impl/src/cpu/mod.rs:4:5
  |
4 | use std::ptr::null;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `CBoxedSlice`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:3:39
  |
3 | use luisa_compute_ir::{context, CArc, CBoxedSlice};
  |                                       ^^^^^^^^^^^

warning: unused import: `std::ffi::CString`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:6:5
  |
6 | use std::ffi::CString;
  |     ^^^^^^^^^^^^^^^^^

warning: unused import: `luisa_compute_ir::ir`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:9:5
  |
9 | use luisa_compute_ir::ir;
  |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `decode_const_data`
 --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:6:13
  |
6 | use super::{decode_const_data, decode_const_data_v2, sha256_short};
  |             ^^^^^^^^^^^^^^^^^

warning: unused imports: `Deserialize` and `Serialize`
 --> luisa_compute_backend_impl/src/cpu/shader.rs:7:13
  |
7 | use serde::{Deserialize, Serialize};
  |             ^^^^^^^^^^^  ^^^^^^^^^

warning: unused import: `CString`
  --> luisa_compute_backend_impl/src/cpu/shader.rs:10:17
   |
10 |     ffi::{CStr, CString},
   |                 ^^^^^^^

[ 44%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/__/contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp.o
warning: use of deprecated function `std::arch::x86_64::_MM_SET_FLUSH_ZERO_MODE`: see `_mm_setcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:508:33
    |
508 | ...                   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated function `std::arch::x86_64::_mm_setcsr`: see `_mm_setcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:511:33
    |
511 | ...                   _mm_setcsr(
    |                       ^^^^^^^^^^

warning: use of deprecated function `std::arch::x86_64::_mm_getcsr`: see `_mm_getcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:512:38
    |
512 | ...                   (_mm_getcsr() & !_MM_DENORMALS_ZERO_MASK)
    |                        ^^^^^^^^^^

[ 44%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/__/contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp.o
[ 44%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/__/contrib/Open3DGC/o3dgcTools.cpp.o
[ 44%] Building CXX object src/ext/assimp/code/CMakeFiles/assimp.dir/__/contrib/Open3DGC/o3dgcTriangleFans.cpp.o
[ 44%] Linking CXX shared library ../../../../bin/liblc-core.so
warning: unreachable expression
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp.rs:1318:17
     |
1317 | ...   panic!("Use CpuFn/CpuCallable to pass closures to kernel directly instead of ExternalCallable on cpu backend!....
     |       ---------------------------------------------------------------------------------------------------------------- any code following this expression is unreachable
1318 | ...   true
     |       ^^^^ unreachable expression
     |
     = note: `#[warn(unreachable_code)]` on by default

[ 44%] Built target luisa-compute-core ] 167/168: luisa_compute_backend_impl  
[ 44%] Building CXX object src/compute/src/tensor/CMakeFiles/luisa-compute-tensor.dir/tensor.cpp.o
[ 44%] Building CXX object src/compute/src/vstl/CMakeFiles/luisa-compute-vstl.dir/cmake_pch.hxx.gch
[ 44%] Building CXX object src/compute/src/ast/CMakeFiles/luisa-compute-ast.dir/cmake_pch.hxx.gch
warning: unused variable: `buffer_ty`
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp.rs:729:21
    |
729 |                 let buffer_ty = self.type_gen.gen_c_type(args[0].type_());
    |                     ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_buffer_ty`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `var`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1561:9
     |
1561 |         var: &String,
     |         ^^^ help: if this is intentional, prefix it with an underscore: `_var`

warning: unused variable: `node_ty_s`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1562:9
     |
1562 |         node_ty_s: &String,
     |         ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_node_ty_s`

warning: unused variable: `f`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1563:9
     |
1563 |         f: FuncRef,
     |         ^ help: if this is intentional, prefix it with an underscore: `_f`

warning: unused variable: `args_v`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1564:9
     |
1564 |         args_v: &Vec<String>,
     |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_args_v`

warning: unused variable: `e`
   --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:665:17
    |
665 |             let e = ty.element();
    |                 ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: function `decode_const_data_v2` is never used
   --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:445:8
    |
445 | pub fn decode_const_data_v2(data: &[u8], ty: TypeRef) -> String {
    |        ^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: struct `TypeGenInner` is never constructed
  --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:10:19
   |
10 | pub(crate) struct TypeGenInner {
   |                   ^^^^^^^^^^^^

warning: associated items `new`, `to_c_type_`, and `to_c_type` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:16:19
    |
15  | impl TypeGenInner {
    | ----------------- associated items in this implementation
16  |     pub(crate) fn new() -> Self {
    |                   ^^^
...
22  |     fn to_c_type_(&mut self, t: TypeRef) -> String {
    |        ^^^^^^^^^^
...
130 |     pub(crate) fn to_c_type(&mut self, t: TypeRef) -> String {
    |                   ^^^^^^^^^

warning: struct `TypeGen` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:141:8
    |
141 | struct TypeGen {
    |        ^^^^^^^

warning: associated items `new`, `gen_c_type`, and `generated` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:146:8
    |
145 | impl TypeGen {
    | ------------ associated items in this implementation
146 |     fn new() -> Self {
    |        ^^^
...
151 |     fn gen_c_type(&self, t: TypeRef) -> String {
    |        ^^^^^^^^^^
...
154 |     fn generated(&self) -> String {
    |        ^^^^^^^^^

warning: struct `GlobalEmitter` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:159:8
    |
159 | struct GlobalEmitter {
    |        ^^^^^^^^^^^^^

warning: struct `FunctionEmitter` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:170:8
    |
170 | struct FunctionEmitter<'a> {
    |        ^^^^^^^^^^^^^^^

warning: struct `PhiCollector` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:184:12
    |
184 | pub struct PhiCollector {
    |            ^^^^^^^^^^^^

warning: associated items `new` and `visit_block` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:190:12
    |
189 | impl PhiCollector {
    | ----------------- associated items in this implementation
190 |     pub fn new() -> Self {
    |            ^^^
...
196 |     pub unsafe fn visit_block(&mut self, block: BasicBlockRef) {
    |                   ^^^^^^^^^^^

warning: multiple associated items are never used
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:267:8
     |
266  | impl<'a> FunctionEmitter<'a> {
     | ---------------------------- associated items in this implementation
267  |     fn new(globals: &'a mut GlobalEmitter, type_gen: &'a TypeGen) -> S...
     |        ^^^
...
281  |     fn write_ident(&mut self) {
     |        ^^^^^^^^^^^
...
286  |     fn gen_node(&mut self, node: NodeRef) -> String {
     |        ^^^^^^^^
...
316  |     fn access_chain(&mut self, mut var: String, node: NodeRef, indices...
     |        ^^^^^^^^^^^^
...
335  |     fn atomic_chain_op(
     |        ^^^^^^^^^^^^^^^
...
363  |     fn gep_field_name(node: NodeRef, i: i32) -> String {
     |        ^^^^^^^^^^^^^^
...
381  |     fn gen_binop(
     |        ^^^^^^^^^
...
419  |     fn gen_call_op(
     |        ^^^^^^^^^^^
...
531  |     fn gen_buffer_op(
     |        ^^^^^^^^^^^^^
...
827  |     fn gen_misc(
     |        ^^^^^^^^
...
1283 |     fn gen_const(&mut self, var: &String, node_ty_s: &String, cst: Con...
     |        ^^^^^^^^^
...
1295 |     fn gen_instr(&mut self, node: NodeRef) {
     |        ^^^^^^^^^
...
1531 |     fn gen_block_(&mut self, block: BasicBlockRef) {
     |        ^^^^^^^^^^
...
1550 |     fn gen_block(&mut self, block: BasicBlockRef) {
     |        ^^^^^^^^^
...
1559 |     fn gen_callable(
     |        ^^^^^^^^^^^^

warning: method `copy_to_vec_2d` is never used
   --> luisa_compute_backend_impl/src/cpu/texture.rs:243:19
    |
142 | impl TextureView {
    | ---------------- method in this implementation
...
243 |     pub(crate) fn copy_to_vec_2d(&self) -> Vec<u8> {
    |                   ^^^^^^^^^^^^^^

warning: `luisa_compute_backend_impl` (lib) generated 28 warnings (run `cargo fix --lib -p luisa_compute_backend_impl` to apply 7 suggestions)
    Finished `release` profile [optimized] target(s) in 24.33s
warning: unused import: `crate::*`
 --> luisa_compute_ir_v2/src/convert.rs:1:5
  |
1 | use crate::*;
  |     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `module`
  --> luisa_compute_ir_v2/src/convert.rs:10:20
   |
10 |     pub fn convert(module:ir_v1::ir::Module) {
   |                    ^^^^^^ help: if this is intentional, prefix it with an underscore: `_module`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: struct `V1ToV2` is never constructed
 --> luisa_compute_ir_v2/src/convert.rs:5:8
  |
5 | struct V1ToV2 {
  |        ^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: associated function `convert` is never used
  --> luisa_compute_ir_v2/src/convert.rs:10:12
   |
9  | impl V1ToV2 {
   | ----------- associated function in this implementation
10 |     pub fn convert(module:ir_v1::ir::Module) {
   |            ^^^^^^^

warning: creating a shared reference to mutable static is discouraged
  --> luisa_compute_ir_v2/src/lib.rs:38:15
   |
38 |     unsafe { &LIB.as_ref().unwrap().binding }
   |               ^^^^^^^^^^^^ shared reference to mutable static
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
   = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
   = note: `#[warn(static_mut_refs)]` on by default

warning: `luisa_compute_ir_v2` (lib) generated 5 warnings (run `cargo fix --lib -p luisa_compute_ir_v2` to apply 1 suggestion)
warning: unused import: `std::ptr::null`
 --> luisa_compute_backend_impl/src/cpu/mod.rs:4:5
  |
4 | use std::ptr::null;
  |     ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `CBoxedSlice`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:3:39
  |
3 | use luisa_compute_ir::{context, CArc, CBoxedSlice};
  |                                       ^^^^^^^^^^^

warning: unused import: `std::ffi::CString`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:6:5
  |
6 | use std::ffi::CString;
  |     ^^^^^^^^^^^^^^^^^

warning: unused import: `luisa_compute_ir::ir`
 --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:9:5
  |
9 | use luisa_compute_ir::ir;
  |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `decode_const_data`
 --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:6:13
  |
6 | use super::{decode_const_data, decode_const_data_v2, sha256_short};
  |             ^^^^^^^^^^^^^^^^^

warning: unused imports: `Deserialize` and `Serialize`
 --> luisa_compute_backend_impl/src/cpu/shader.rs:7:13
  |
7 | use serde::{Deserialize, Serialize};
  |             ^^^^^^^^^^^  ^^^^^^^^^

warning: unused import: `CString`
  --> luisa_compute_backend_impl/src/cpu/shader.rs:10:17
   |
10 |     ffi::{CStr, CString},
   |                 ^^^^^^^

warning: use of deprecated function `std::arch::x86_64::_MM_SET_FLUSH_ZERO_MODE`: see `_mm_setcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:508:33
    |
508 | ...                   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated function `std::arch::x86_64::_mm_setcsr`: see `_mm_setcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:511:33
    |
511 | ...                   _mm_setcsr(
    |                       ^^^^^^^^^^

warning: use of deprecated function `std::arch::x86_64::_mm_getcsr`: see `_mm_getcsr` documentation - use inline assembly instead
   --> luisa_compute_backend_impl/src/cpu/mod.rs:512:38
    |
512 | ...                   (_mm_getcsr() & !_MM_DENORMALS_ZERO_MASK)
    |                        ^^^^^^^^^^

warning: unreachable expression
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp.rs:1318:17
     |
1317 | ...   panic!("Use CpuFn/CpuCallable to pass closures to kernel directly instead of ExternalCallable on cpu backend!....
     |       ---------------------------------------------------------------------------------------------------------------- any code following this expression is unreachable
1318 | ...   true
     |       ^^^^ unreachable expression
     |
     = note: `#[warn(unreachable_code)]` on by default

warning: unused variable: `buffer_ty`
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp.rs:729:21
    |
729 |                 let buffer_ty = self.type_gen.gen_c_type(args[0].type_());
    |                     ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_buffer_ty`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `var`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1561:9
     |
1561 |         var: &String,
     |         ^^^ help: if this is intentional, prefix it with an underscore: `_var`

warning: unused variable: `node_ty_s`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1562:9
     |
1562 |         node_ty_s: &String,
     |         ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_node_ty_s`

warning: unused variable: `f`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1563:9
     |
1563 |         f: FuncRef,
     |         ^ help: if this is intentional, prefix it with an underscore: `_f`

warning: unused variable: `args_v`
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:1564:9
     |
1564 |         args_v: &Vec<String>,
     |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_args_v`

warning: unused variable: `e`
   --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:665:17
    |
665 |             let e = ty.element();
    |                 ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: function `decode_const_data_v2` is never used
   --> luisa_compute_backend_impl/src/cpu/codegen/mod.rs:445:8
    |
445 | pub fn decode_const_data_v2(data: &[u8], ty: TypeRef) -> String {
    |        ^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: struct `TypeGenInner` is never constructed
  --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:10:19
   |
10 | pub(crate) struct TypeGenInner {
   |                   ^^^^^^^^^^^^

warning: associated items `new`, `to_c_type_`, and `to_c_type` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:16:19
    |
15  | impl TypeGenInner {
    | ----------------- associated items in this implementation
16  |     pub(crate) fn new() -> Self {
    |                   ^^^
...
22  |     fn to_c_type_(&mut self, t: TypeRef) -> String {
    |        ^^^^^^^^^^
...
130 |     pub(crate) fn to_c_type(&mut self, t: TypeRef) -> String {
    |                   ^^^^^^^^^

warning: struct `TypeGen` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:141:8
    |
141 | struct TypeGen {
    |        ^^^^^^^

warning: associated items `new`, `gen_c_type`, and `generated` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:146:8
    |
145 | impl TypeGen {
    | ------------ associated items in this implementation
146 |     fn new() -> Self {
    |        ^^^
...
151 |     fn gen_c_type(&self, t: TypeRef) -> String {
    |        ^^^^^^^^^^
...
154 |     fn generated(&self) -> String {
    |        ^^^^^^^^^

warning: struct `GlobalEmitter` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:159:8
    |
159 | struct GlobalEmitter {
    |        ^^^^^^^^^^^^^

warning: struct `FunctionEmitter` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:170:8
    |
170 | struct FunctionEmitter<'a> {
    |        ^^^^^^^^^^^^^^^

warning: struct `PhiCollector` is never constructed
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:184:12
    |
184 | pub struct PhiCollector {
    |            ^^^^^^^^^^^^

warning: associated items `new` and `visit_block` are never used
   --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:190:12
    |
189 | impl PhiCollector {
    | ----------------- associated items in this implementation
190 |     pub fn new() -> Self {
    |            ^^^
...
196 |     pub unsafe fn visit_block(&mut self, block: BasicBlockRef) {
    |                   ^^^^^^^^^^^

warning: multiple associated items are never used
    --> luisa_compute_backend_impl/src/cpu/codegen/cpp_v2.rs:267:8
     |
266  | impl<'a> FunctionEmitter<'a> {
     | ---------------------------- associated items in this implementation
267  |     fn new(globals: &'a mut GlobalEmitter, type_gen: &'a TypeGen) -> S...
     |        ^^^
...
281  |     fn write_ident(&mut self) {
     |        ^^^^^^^^^^^
...
286  |     fn gen_node(&mut self, node: NodeRef) -> String {
     |        ^^^^^^^^
...
316  |     fn access_chain(&mut self, mut var: String, node: NodeRef, indices...
     |        ^^^^^^^^^^^^
...
335  |     fn atomic_chain_op(
     |        ^^^^^^^^^^^^^^^
...
363  |     fn gep_field_name(node: NodeRef, i: i32) -> String {
     |        ^^^^^^^^^^^^^^
...
381  |     fn gen_binop(
     |        ^^^^^^^^^
...
419  |     fn gen_call_op(
     |        ^^^^^^^^^^^
...
531  |     fn gen_buffer_op(
     |        ^^^^^^^^^^^^^
...
827  |     fn gen_misc(
     |        ^^^^^^^^
...
1283 |     fn gen_const(&mut self, var: &String, node_ty_s: &String, cst: Con...
     |        ^^^^^^^^^
...
1295 |     fn gen_instr(&mut self, node: NodeRef) {
     |        ^^^^^^^^^
...
1531 |     fn gen_block_(&mut self, block: BasicBlockRef) {
     |        ^^^^^^^^^^
...
1550 |     fn gen_block(&mut self, block: BasicBlockRef) {
     |        ^^^^^^^^^
...
1559 |     fn gen_callable(
     |        ^^^^^^^^^^^^

warning: method `copy_to_vec_2d` is never used
   --> luisa_compute_backend_impl/src/cpu/texture.rs:243:19
    |
142 | impl TextureView {
    | ---------------- method in this implementation
...
243 |     pub(crate) fn copy_to_vec_2d(&self) -> Vec<u8> {
    |                   ^^^^^^^^^^^^^^

warning: `luisa_compute_backend_impl` (lib) generated 28 warnings (run `cargo fix --lib -p luisa_compute_backend_impl` to apply 7 suggestions)

Environment

  • OS: Ubuntu 22.04
  • GPU/CPU: Intel i9 12900k, RTX 4070 TI
  • GPU-driver version: nvidia-driver-550
  • CUDA / CUDA-toolkit version: 12.8

Release version or Commit ID

version 0.2.0

Additional Context

No response

ph3rro avatar Jan 27 '25 00:01 ph3rro