Skip to content

Commit 5649fba

Browse files
authored
Removed allow_growth and updated docs (#24)
This now allows users to customize this value by setting an environment variable instead of it being hard-coded.
1 parent 70e7c59 commit 5649fba

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/runtime_environment.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,17 @@ Note that non-relative imports to these files will `not` work:
5656
5757
import backend
5858
from utils import img_utils, ml_utils
59+
60+
Limiting GPU memory Growth
61+
-----------------------------------------
62+
63+
By default, OpenVisionCapsules maps all available memory of all visible CUDA configured GPUs.
64+
To prevent this, use following Environment flag while using Tensorflow.
65+
66+
.. code-block:: python
67+
68+
TF_FORCE_GPU_ALLOW_GROWTH=True
69+
70+
- This Environment variable is only applicable to Tensorflow.
71+
72+
For proper reference, visit Tensorflow: https://www.tensorflow.org/guide/gpu#limiting_gpu_memory_growth

vcap/vcap/device_mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_all_devices() -> List[str]:
2929
# TODO: Use tf.config.list_physical_devices in TF 2.1
3030
# TODO: Remove the config when using TF_FORCE_GPU_ALLOW_GROWTH\
3131
# environment variable
32-
_process_gpu_options = tf.GPUOptions(allow_growth=True)
32+
_process_gpu_options = tf.GPUOptions()
3333
config = tf.ConfigProto(gpu_options=_process_gpu_options)
3434

3535
with tf.Session(config=config):

0 commit comments

Comments
 (0)