카테고리 없음

기계학습시 GPU 백그라운드 실행

YHP 2021. 8. 9. 16:09

https://machinelearningmastery.com/command-line-recipes-deep-learning-amazon-web-services/

 

10 Command Line Recipes for Deep Learning on Amazon Web Services - Machine Learning Mastery

Running large deep learning processes on Amazon Web Services EC2 is a cheap and effective way to learn and develop […]

machinelearningmastery.com

 

참고한 글을 Amazon Web Services에서 딥러닝할때 사용할 수 있는 커맨드 라인에 대해서 소개하고 있지만

GPU 백그라운드 실행하는 방법은 개인 GPU머신에서 동일하게 사용해도 아무 문제 없다.

 

여기서 참고할만한 커맨드 라인은

 

4. Run Script on a Specific GPU on the Server 이다.

 

$ CUDA_VISIBLE_DEVICES=0 nohup python script.py > ./script.py.log </dev/null 2>&1 &

위의 경우에는 0번 GPU 사용하여 script.py 소스 코드를 실행하고 log를 동일한 디렉토리에 출력하는 경우이고

 

$ CUDA_VISIBLE_DEVICES=1 nohup python script.py > ./script.py.log &1 &

위의 경우에는 1번 GPU 사용하여 script.py 소스 코드를 실행하고 log를 동일한 디렉토리에 출력하는 경우이다.

 

링크되어있는 글들은 전반적으로 볼만하다.

물론 나는 저 커맨드 라인만 찾은거였지만...