티스토리 뷰

728x90

multi-gpu일 때, gpu를 나눠서 메모리를 활용하는 경우에 사용할 수 있다.

 

1. python process를 각 세션에서 실행

2. CUDA_VISIBLE_DEVICES 에 대해 gpu number 할당

$ CUDA_VISIBLE_DEVICES=0 python my_script.py  # Uses GPU 0.
$ CUDA_VISIBLE_DEVICES=1 python my_script.py  # Uses GPU 1.
$ CUDA_VISIBLE_DEVICES=2,3 python my_script.py  # Uses GPUs 2 and 3.

 

 

출처: https://stackoverflow.com/questions/34775522/tensorflow-multiple-sessions-with-multiple-gpus

728x90
댓글