"...pytorch/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "e178158616012f2e3bc83e28457127ce6dc0cf03"
Unverified Commit ee13b623 authored by Rickard's avatar Rickard Committed by GitHub
Browse files

Updated documentation on compiling from source (#1048)

* Updated compiler instructuins

* Thank you, linter
parent 4941dd23
# Compiling from Source[[compiling]] # Compiling from Source[[compiling]]
To compile from source, the CUDA Toolkit is required. Ensure `nvcc` is installed; if not, follow these steps to install it along with the CUDA Toolkit: ## Linux
To compile from source, you need the following:
* The ability to compile C++ (gcc, make, headers, etc)
* CMake (version 3.22.1 or newer)
* Python 3.10 or newer
* [The CUDA toolkit](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) (nvcc)
On Ubuntu, install the first two with `apt-get install -y build-essential cmake`.
To install the CUDA toolkit, follow the [instructions from your distro](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html).
```bash
wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/install_cuda.sh
# Use the following syntax: cuda_install CUDA_VERSION INSTALL_PREFIX EXPORT_TO_BASH
# CUDA_VERSION options include 110 to 122
# EXPORT_TO_BASH: 0 for False, 1 for True
# Example for installing CUDA 11.7 at ~/local/cuda-11.7 and exporting the path to .bashrc:
bash install_cuda.sh 117 ~/local 1
```
For a single compile run with a specific CUDA version, set `CUDA_HOME` to point to your CUDA installation directory. For instance, to compile using CUDA 11.7 located at `~/local/cuda-11.7`, use: To install the package from source, then run
``` ```
CUDA_HOME=~/local/cuda-11.7 CUDA_VERSION=117 make cuda11x pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
make
pip install .
``` ```
## General Compilation Steps If you have multiple versions of CUDA installed, or have installed it in a non-standard location, please refer to [cmake CUDA documentation](https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html) for how to configure the CUDA compiler used.
1. Use `CUDA_VERSION=XXX make [target]` to compile, where `[target]` includes options like `cuda92`, `cuda10x`, `cuda11x`, and others. ## Windows
2. Install with `python setup.py install`.
Ensure `nvcc` is available in your system. If using Anaconda, determine your CUDA version with PyTorch using `conda list | grep cudatoolkit` and match it by downloading the corresponding version from the [CUDA Toolkit Archive](https://developer.nvidia.com/cuda-toolkit-archive). The following is required to install from source on Windows
To install CUDA locally without administrative rights: * [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) with C++ support
* CMake (version 3.22.1 or newer)
* Python 3.10 or newer
* [The CUDA toolkit](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) (nvcc)
```bash To install the CUDA toolkit, follow the [instructions for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html).
wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/install_cuda.sh
# Follow the same syntax and example as mentioned earlier
```
The compilation process relies on the `CUDA_HOME` environment variable to locate CUDA. If `CUDA_HOME` is unset, it will attempt to infer the location from `nvcc`. If `nvcc` is not in your path, you may need to add it or set `CUDA_HOME` manually. For example, if `python -m bitsandbytes` indicates your CUDA path as `/usr/local/cuda-11.7`, you can set `CUDA_HOME` to this path.
If compilation issues arise, please report them. To install the package from source, then run
```
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
cmake --build . --config Release
pip install .
```
## Compilation for Kepler Architecture ## Compilation for Kepler Architecture
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment