Skip to content

Commit 873db0e

Browse files
committed
fixed bug in CPU_ONLY compilation
1 parent d3d6e68 commit 873db0e

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ xcode command line tools should be installed installed
2828
### Installation
2929
```
3030
pip install gbrl
31-
```
32-
To install a cpu only version please run
33-
```
34-
CPU_ONLY=1 pip install gbrl
35-
```
36-
37-
For GPU support GBRL looks for `CUDA_PATH` or `CUDA_HOME` environment variables. Unless found, GBRL will automatically compile only for CPU.
31+
```
3832

3933
Verify that GPU is visible by running
4034
```
@@ -43,6 +37,8 @@ import gbrl
4337
gbrl.cuda_available()
4438
```
4539

40+
GBRL can be compiled and installed with a CPU version only even on CUDA capable machines by setting `CPU_ONLY=1` as an environment variable.
41+
4642
*OPTIONAL*
4743
For tree visualization make sure graphviz is installed before compilation.
4844

docs/quickstart.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,4 @@ Install GBRL via pip:
77
88
pip install gbrl
99
10-
CPU only version is installed with the following command:
11-
12-
.. code-block:: console
13-
14-
CPU_ONLY=1 pip install gbrl
10+
GBRL can be compiled and installed with a CPU version only even on CUDA capable machines by setting `CPU_ONLY=1` as an environment variable.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def build_extension(self, ext):
5959
cmake_args.append('-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON')
6060
build_args.append('--verbose')
6161

62-
if ('CPU_ONLY' not in os.environ and platform.system() != 'Darwin') or ('CPU_ONLY' in os.environ and os.environ['CPU_ONLY'] == '1'):
62+
if ('CPU_ONLY' not in os.environ and platform.system() != 'Darwin') or ('CPU_ONLY' in os.environ and os.environ['CPU_ONLY'] != '1'):
6363
cmake_args.append('-DUSE_CUDA=ON')
6464

6565
build_temp = self.build_temp

0 commit comments

Comments
 (0)