Skip to content

Commit 8bdfc5b

Browse files
committed
Request GPU only when num_gpus is positive
1 parent 42bd62e commit 8bdfc5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflowonspark/TFNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def start_cluster_server(ctx, num_gpus=1, rdma=False):
7070
cluster_spec = ctx.cluster_spec
7171
logging.info("{0}: Cluster spec: {1}".format(ctx.worker_num, cluster_spec))
7272

73-
if tf.test.is_built_with_cuda():
73+
if tf.test.is_built_with_cuda() and num_gpus > 0:
7474
# GPU
7575
gpu_initialized = False
7676
retries = 3

0 commit comments

Comments
 (0)