summaryrefslogtreecommitdiff
path: root/ot/gpu/cudamat/INSTALL.md
blob: 95cfef352417e318672a6600347b63acfaffdc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Prerequisites
-------------

cudamat needs the following to be installed first:

* Python 2.x or 3.x and numpy
* The CUDA SDK
* nose for running the tests (optional)

Installation
------------

Once you have installed the prerequisites and downloaded cudamat, switch to the
cudamat directory and run either of the following commands to install it:

```bash
# a) Install for your user:
python setup.py install --user
# b) Install for your user, but with pip:
pip install --user .
# c) Install system-wide:
sudo python setup.py install
# d) Install system-wide, but with pip:
sudo pip install .
```

If your Nvidia GPU supports a higher Compute Capability than the default one of
your CUDA toolkit, you can set the `NVCCFLAGS` environment variable when
installing cudamat to compile it for your architecture. For example, to install
for your user for a GTX 780 Ti (Compute Capability 3.5), you would run:

```bash
NVCCFLAGS=-arch=sm_35 python setup.py install --user
```

To compile for both Compute Capability 2.0 and 3.5, you would run:

```bash
NVCCFLAGS="-gencode arch=compute_20,code=sm_20 -gencode arch=compute_35,code=sm_35" ...
```

Testing
-------

To test your setup, run the included unit tests and optionally the benchmark:

```bash
cd test  # so it doesn't try importing cudamat from the source directory
# Run tests
nosetests
# Run benchmark
python ../examples/bench_cudamat.py
```