Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ One may set the following environment variables before executing `pip`:
| --------------------- | ---------------------- | ------------- | -------------------------- |
| DP_VARIANT | `cpu`, `cuda`, `rocm` | `cpu` | Build CPU variant or GPU variant with CUDA or ROCM support. |
| DP_FLOAT_PREC | `high`, `low` | `high` | Build high (double) or low (float) precision. |
| CUDA_TOOLKIT_ROOT_DIR | Path | Detected automatically | The path to the CUDA toolkit directory. |
| ROCM_ROOT | Path | Detected automatically | The path to the ROCM toolkit directory. |

To test the installation, one should firstly jump out of the source directory
```
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@
pass
elif dp_variant == "cuda":
cmake_args.append("-DUSE_CUDA_TOOLKIT:BOOL=TRUE")
cuda_root = os.environ.get("CUDA_TOOLKIT_ROOT_DIR")
if cuda_root:
cmake_args.append(f"-DCUDA_TOOLKIT_ROOT_DIR:STRING={cuda_root}")
elif dp_variant == "rocm":
cmake_args.append("-DUSE_ROCM_TOOLKIT:BOOL=TRUE")
elif dp_variant != "":
rocm_root = os.environ.get("ROCM_ROOT")
if rocm_root:
cmake_args.append(f"-DROCM_ROOT:STRING={rocm_root}")
else:
raise RuntimeError("Unsupported DP_VARIANT option: %s" % dp_variant)

# FLOAT_PREC
Expand Down