Rust-GPU / Rust-CUDA

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

Updated nvvm codegen to 1.72.0 nightly. #111

Open ZelboK opened 1 year ago

ZelboK commented 1 year ago

As title says I updated and built the crate. Problem is that I'm both a beginner in Rust and LLVM. This is my first rust project.

Things compile for now, I prioritized just getting things to compile so some methods implemented are left in a todo state. I'll eventually make a PR when I have time but for now if anyone is interested you can check my profile to see the repo.

Currently running into this:

  warning: `cuda_std_macros` (lib) generated 2 warnings (run `cargo fix --lib -p cuda_std_macros` to apply 2 suggestions)
     Compiling rustc-std-workspace-core v1.99.0 (C:\Users\devel\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\rustc-std-workspace-core)
     Compiling alloc v0.0.0 (C:\Users\devel\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc)
  error: could not compile `core` (lib)

  Caused by:
    process didn't exit successfully: `rustc --crate-name core --edition=2021 C:\Users\devel\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"panic_immediate_abort\"" -C metadata=2eed41a84448bb8c -C extra-filename=-2eed41a84448bb8c --out-dir C:\Users\devel\Rust-CUDA\target\cuda-builder\nvptx64-nvidia-cuda\release\deps --target nvptx64-nvidia-cuda -Z force-unstable-if-unmarked -L dependency=C:\Users\devel\Rust-CUDA\target\cuda-builder\nvptx64-nvidia-cuda\release\deps -L dependency=C:\Users\devel\Rust-CUDA\target\cuda-builder\release\deps --cap-lints allow -Zcodegen-backend=C:\Users\devel\Rust-CUDA\target\debug\deps\rustc_codegen_nvvm.dll -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(rust_cuda) -Zcrate-attr=no_std "-Cllvm-args=-arch=compute_61 --override-libm"` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
  warning: build failed, waiting for other jobs to finish...
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BuildFailed', examples\cuda\cpu\add\build.rs:7:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

As per @RDambrosio016 suggested, I plan on building LLVM 7 from source and enabling debug assertions. If anyone is interested in helping please lmk.

ZelboK commented 1 year ago

Also I pulled in @apriori 's PR and worked on top of that.