how to select gpu
#13971
Replies: 1 comment
-
Hi, a few points:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In spark NLP, how do I select the gpu I want to target? I tried
tokenizer.setGpu(0) , but that did not work.
In spark NLP, how do I select the cuda device I want to target (in both scala and python)? For example, if a node has 2 gpus, how do I select gpu 0 or gpu 1?
What I have observed so far, working with the NerDL benchmark/example, with scala:
The spark session will find both GPUs, and the training will be done on gpu0; the training is successful, and the engagement of the gpu can be seen with the utilization of the gpu 0 going up to 25%.
I tried “tokenizer.setGpu(1) “, but that did not work (the setGpu attribute does not exist).
I tried setting the environment variable with “export CUDA_VISIBLE_DEVICES=1” before running the scala commands, but the training still ran on GPU 0 (perhaps the default spark session configuration flips it back?).
spark-shell --packages com.johnsnowlabs.nlp:spark-nlp-gpu_2.12:5.0.1 --conf CUDA_VISIBLE_DEVICES=1
scala> System.setProperty("CUDA_VISIBLE_DEVICES", "1")
spark-shell --conf spark.executorEnv.CUDA_VISIBLE_DEVICES=1
…neither of the above commands worked; the training was still carried out on gpu 0.
Beta Was this translation helpful? Give feedback.
All reactions