![]() ![]() Then in one terminal, you could do: CUDA_VISIBLE_DEVICES="0". ![]() In the next terminal: CUDA_VISIBLE_DEVICES="1". Then the first instance will run on the first GPU enumerated by CUDA. The second instance will run on the second GPU (only), and so on.Īssuming bash, and for a given terminal session, you can make this "permanent" by exporting the variable: export CUDA_VISIBLE_DEVICES="2" ![]() Thereafter, all CUDA applications run in that session will observe only the third enumerated GPU (enumeration starts at 0), and they will observe that GPU as if it were device 0 in their session. You can also extend this to make multiple GPUs available, for example: export CUDA_VISIBLE_DEVICES="2,4" This means you don't have to make any changes to your application for this method, assuming your app uses the default GPU or GPU 0. Means the GPUs that would ordinarily enumerate as 2 and 4 would now be the only GPUs "visible" in that session and they would enumerate as 0 and 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |