CUDA VISIBLE DEVICE
TensorFlow will attempt to use (an equal fraction of the memory of) all GPU devices that are visible to it.
If you want to run different sessions on different GPUs, you should do the following.
- Run each session in a different Python process.
- Start each process with a different value for the CUDA_VISIBLE_DEVICES environment variable.
For example, if your script is calledmy_script.py
and you have 4 GPUs, you could run the following:
$ 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.
Note the GPU devices in TensorFlow will still be numbered from zero (i.e. "/gpu:0" etc.), but they will correspond to the devices that you have made visible with CUDA_VISIBLE_DEVICES
You can set environment variables in the notebook using os.environ
.
Do the following before initializing TensorFlow to limit TensorFlow to first GPU.
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="0"
相關文章
- 執行時報錯RuntimeError: expected device cpu but got device cuda:0ErrordevGo
- CUDA程式設計(4.1)—— 宣告符(global、device、host等)程式設計dev
- 【踩坑】RuntimeError: CUDA error: device-side assert triggeredErrordevIDE
- Property "visible" must be accessed with "$data.visible"
- jQuery :visiblejQuery
- Property "visible" must be accessed with "$data.visible" because properties
- cuda
- cuda 流
- wrap devicedev
- device dirverdev
- platform devicePlatformdev
- raw devicedev
- ubuntu 14.04 安裝cuda 7.5/CUDA 8.0Ubuntu
- vue專案報錯[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties startVue
- device-mapper create ioctl failed: Device or resource busydevAPPAI
- cuda和cudatoolkit
- CUDA優化優化
- CUDA簡介
- CUDA架構架構
- No space left on devicedev
- CUDA進階第三篇:CUDA計時方式
- CUDA學習筆記-1: CUDA程式設計概覽筆記程式設計
- HDU2841 Visible Trees (容斥原理)
- TROUBLESHOOTING - ASM disk not found/visible/discovered issuesASM
- CUDA學習指南
- 平行計算cuda
- CUDA執行模式模式
- CUDA C語言C語言
- cuda 核函式函式
- cuda安裝教程
- CUDA的問題
- Multipath and Device MapperdevAPP
- raw device, first blockdevBloC
- about raw device[zt]dev
- CSS display:none和visible:hidden區別CSSNone
- display:none 和visible:false 的區別(轉)NoneFalse
- 簡述CUDA執行緒及求CUDA中執行緒索引執行緒索引
- 【CUDA】CUDA9.0+VS2017+win10詳細配置Win10