tgravescs commented on a change in pull request #24394:  [SPARK-27024] Executor 
interface for cluster managers to support GPU and other resources
URL: https://github.com/apache/spark/pull/24394#discussion_r276339704
 
 

 ##########
 File path: examples/src/main/resources/getGpuResources.sh
 ##########
 @@ -0,0 +1,33 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This is an example script that can be used to discover GPUs. It only works 
on NVIDIA GPUs since it
+# uses the nvidia-smi command. This script will find all visible GPUs, so if 
you aren't running
+# in an environment that can isolate GPUs to an executor and where multiple 
executors can run on a
+# single node you may not want to use this. See your cluster manager specific 
configs for other
+# options.
+#
+# It can be passed into Spark via the configs 
spark.executor.resource.gpu.discoveryScript and/or
+# spark.driver.resource.gpu.discoveryScript.
+# The script will return a string in the format: count:unit:comma-separated 
list of the resource addresses
+#
+
+ADDRS=`nvidia-smi --query-gpu=index --format=csv,noheader | sed 'N;s/\n/,/'`
 
 Review comment:
   I haven't referenced this script in any documentation yet, I think as part 
of this SPIP we should add some high level descriptions about how it all flows 
- SPARK-27492

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to