Skip to content

Commit 3b987ca

Browse files
committed
installation instr updates for issue NVIDIA#330
1 parent efb4fb6 commit 3b987ca

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The Minkowski Engine is an auto-differentiation library for sparse tensors. It s
99

1010
## News
1111

12+
- 2021-04-08 Due to recent errors in [pytorch 1.8 + CUDA 11](https://github.com/NVIDIA/MinkowskiEngine/issues/330), it is recommended to use [anaconda for installation](#anaconda).
1213
- 2020-12-24 v0.5 is now available! The new version provides CUDA accelerations for all coordinate management functions.
1314

1415
## Example Networks
@@ -54,7 +55,7 @@ We visualized a sparse tensor network operation on a sparse tensor, convolution,
5455

5556
- Ubuntu >= 14.04
5657
- CUDA >= 10.1.243 and **the same CUDA version used for pytorch** (e.g. if you use conda cudatoolkit=11.1, use CUDA=11.1 for MinkowskiEngine compilation)
57-
- pytorch >= 1.7 (if you use conda, install with `conda install -y -c conda-forge -c pytorch pytorch=1.8.1 cudatoolkit=11.1`)
58+
- pytorch >= 1.7 (pytorch 1.8.1 + CUDA 11.X is [unstable](https://github.com/NVIDIA/MinkowskiEngine/issues/330). To specify CUDA version, please use conda for installation. `conda install -y -c conda-forge -c pytorch pytorch=1.8.1 cudatoolkit=10.2`)
5859
- python >= 3.6
5960
- ninja (for installation)
6061
- GCC >= 7
@@ -100,17 +101,49 @@ pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps \
100101

101102
### Anaconda
102103

104+
Due to [errors in pytorch](https://github.com/NVIDIA/MinkowskiEngine/issues/330), pytorch 1.8.1 can only work with CUDA 10.2. To use CUDA 11.1, use pytorch 1.7.1 instead.
105+
#### CUDA 10.2
106+
103107
We recommend `python>=3.6` for installation.
104108
First, follow [the anaconda documentation](https://docs.anaconda.com/anaconda/install/) to install anaconda on your computer.
105109

106110
```
111+
sudo apt install g++-7 # For CUDA 10.2, must use GCC < 8
107112
conda create -n py3-mink python=3.8
108113
conda activate py3-mink
109114
110115
conda install openblas-devel -c anaconda
111-
conda install pytorch=1.8.1 torchvision cudatoolkit=11.1 -c pytorch -c conda-forge
116+
conda install pytorch=1.8.1 torchvision cudatoolkit=10.2 -c pytorch -c conda-forge
112117
113118
# Install MinkowskiEngine
119+
export CXX=g++-7
120+
# Uncomment the following line to specify the cuda home. Make sure `$CUDA_HOME/nvcc --version` is 10.2
121+
# export CUDA_HOME=/usr/local/cuda-10.2
122+
pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"
123+
124+
# Or if you want local MinkowskiEngine
125+
git clone https://github.com/NVIDIA/MinkowskiEngine.git
126+
cd MinkowskiEngine
127+
export CXX=g++-7
128+
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
129+
```
130+
131+
#### CUDA 11.X
132+
133+
We recommend `python>=3.6` for installation.
134+
First, follow [the anaconda documentation](https://docs.anaconda.com/anaconda/install/) to install anaconda on your computer.
135+
136+
```
137+
conda create -n py3-mink python=3.8
138+
conda activate py3-mink
139+
140+
conda install openblas-devel -c anaconda
141+
conda install pytorch=1.7.1 torchvision cudatoolkit=11.0 -c pytorch -c conda-forge
142+
143+
# Install MinkowskiEngine
144+
145+
# Uncomment the following line to specify the cuda home. Make sure `$CUDA_HOME/nvcc --version` is 11.X
146+
# export CUDA_HOME=/usr/local/cuda-11.1
114147
pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"
115148
116149
# Or if you want local MinkowskiEngine

tests/python/sparse_tensor.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
is_cuda_available,
3636
)
3737

38-
from MinkowskiEngine.utils import batched_coordinates
38+
from MinkowskiEngine.utils import batched_coordinates, sparse_quantize, sparse_collate
3939
from tests.python.common import data_loader, load_file
4040

4141

@@ -77,6 +77,7 @@ def test_device(self):
7777
print(f"{self.__class__.__name__}: test_device SparseTensor")
7878
if not is_cuda_available():
7979
return
80+
8081
coords = torch.IntTensor(
8182
[[0, 1], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 1]]
8283
)
@@ -87,6 +88,18 @@ def test_device(self):
8788
st = SparseTensor(feats, coords, device=feats.device)
8889
print(st)
8990

91+
def test_device2(self):
92+
print(f"{self.__class__.__name__}: test_device SparseTensor")
93+
if not is_cuda_available():
94+
return
95+
96+
coordinates = np.random.rand(8192,3) * 200
97+
quant_coordinates, quant_features = sparse_quantize(coordinates, coordinates)
98+
bcoords, bfeats = sparse_collate([quant_coordinates], [quant_features])
99+
bcoords, bfeats = bcoords.cuda(), bfeats.cuda()
100+
print(bcoords, bfeats)
101+
SparseTensor(bfeats, bcoords)
102+
90103
def test_quantization(self):
91104
print(f"{self.__class__.__name__}: test_quantization")
92105
coords, feats, labels = data_loader(nchannel=2)

0 commit comments

Comments
 (0)