Skip to content

Instantly share code, notes, and snippets.

@leopd
Created June 17, 2020 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leopd/2907f33d9ebdee65a469a9bfef16530f to your computer and use it in GitHub Desktop.
Save leopd/2907f33d9ebdee65a469a9bfef16530f to your computer and use it in GitHub Desktop.
How to use a specific GPU, not just the first one
# How to use a specific GPU other than the first one.
# Put this at the very top of your python script or notebook.
# Do this before importing your deep learning libraries.
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment