Skip to content

Conversation

@Flakebi
Copy link

@Flakebi Flakebi commented Dec 10, 2025

Compute the solution on the GPU, one thread/kernel execution for every cell.

The main solution code is in the gpu directory, this is the part compiled for the GPU.
The cpu directory contains the host code that reads the input file, copies it to GPU memory and launches the GPU kernel with enough threads.

Compiling

The ROCM_PATH environment variable must be set to an installation of ROCm.
When compiling the GPU crate, the hardware architecture must be specified through an environment variable, e.g.
CARGO_BUILD_RUSTFLAGS='-Ctarget-cpu=gfx900'. Replace gfx900 with your GPU as printed by e.g. rocminfo or the cpu executable.
See also here for instructions: https://github.com/Flakebi/amdgpu-rs

E.g.

$ cd gpu
$ CARGO_BUILD_RUSTFLAGS='-Ctarget-cpu=gfx900' cargo build --release
$ cd ../cpu
$ cargo run ../gpu/target/amdgcn-amd-amdhsa/release/gpu.elf

Compute the solution on the GPU, one thread/kernel execution for every
cell.

The main solution code is in the `gpu` directory, this is the part
compiled for the GPU.
The `cpu` directory contains the host code that reads the input file,
copies it to GPU memory and launches the GPU kernel with enough threads.

Compiling
---
The `ROCM_PATH` environment variable must be set to an installation of
ROCm.
When compiling the GPU crate, the hardware architecture must be
specified through an environment variable, e.g.
`CARGO_BUILD_RUSTFLAGS='-Ctarget-cpu=gfx900'`. Replace `gfx900` with
your GPU as printed by e.g. `rocminfo` or the `cpu` executable.

E.g.
```bash
$ cd gpu
$ CARGO_BUILD_RUSTFLAGS='-Ctarget-cpu=gfx900' cargo build --release
$ cd ../cpu
$ cargo run ../gpu/target/amdgcn-amd-amdhsa/release/gpu.elf
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant