Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CUDA support #44

Merged
merged 9 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
executors:
default:
machine:
image: ubuntu-1604-cuda-10.1:201909-23
image: ubuntu-2004-cuda-11.2:202103-01
working_directory: ~/gpuci
resource_class: gpu.nvidia.medium

Expand All @@ -18,6 +18,14 @@ restore-cache: &restore-cache
- repo-source-{{ .Branch }}-{{ .Revision }}

commands:
set-env-path:
steps:
- run:
name: Set the PATH env variable
command: |
echo 'export PATH="$HOME:~/.cargo/bin:/usr/local/cuda-11.2/bin:$PATH"' | tee --append $BASH_ENV
source $BASH_ENV

test_target:
parameters:
target:
Expand All @@ -37,10 +45,9 @@ jobs:
steps:
- checkout
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV
- set-env-path
- run: echo $BASH_ENV
- run: echo $HOME
- run: source $BASH_ENV
- run: cargo --version
- run: rustc --version
- run:
Expand Down Expand Up @@ -71,8 +78,7 @@ jobs:
test_x86_64-unknown-linux-gnu:
executor: default
steps:
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV
- run: source $BASH_ENV
- set-env-path
- run: sudo apt-get update -y
- run: apt-cache search opencl
- run: sudo apt install -y ocl-icd-opencl-dev
Expand All @@ -84,6 +90,7 @@ jobs:
steps:
- *restore-workspace
- *restore-cache
- set-env-path
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV
- run: source $BASH_ENV
- run:
Expand All @@ -95,8 +102,7 @@ jobs:
steps:
- *restore-workspace
- *restore-cache
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV
- run: source $BASH_ENV
- set-env-path
- run:
name: Run cargo clippy
command: cargo clippy --all-features --all-targets -- -D warnings
Expand All @@ -106,8 +112,7 @@ jobs:
steps:
- *restore-workspace
- *restore-cache
- run: echo 'export PATH="$HOME:~/.cargo/bin:$PATH"' >> $BASH_ENV
- run: source $BASH_ENV
- set-env-path
- run:
name: Run cargo release build
command: cargo build --release
Expand Down
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ license = "MIT/Apache-2.0"
repository = "https://github.com/filecoin-project/rust-gpu-tools"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["opencl", "cuda"]
opencl = ["opencl3"]
cuda = ["rustacuda"]

[dependencies]
dirs = "2.0.2"
sha2 = "0.8.2"
thiserror = "1.0.10"
lazy_static = "1.2"
log = "0.4.11"
opencl3 = { version = "0.4.1", default-features = false, features = ["CL_VERSION_1_2"] }
hex = "0.4.3"

opencl3 = { version = "0.4.1", default-features = false, features = ["CL_VERSION_1_2"], optional = true }
#rustacuda = { version = "0.1.3", optional = true }
rustacuda = { git = "https://github.com/vmx/RustaCUDA", branch = "load-from-bytes", optional = true }
Loading