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
- [CSS] :focus-visibleCSS
- CUDA
- wrap devicedev
- device dirverdev
- platform devicePlatformdev
- raw devicedev
- cuda 流
- cmake cuda
- 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
- No space left on devicedev
- cuda和cudatoolkit
- CUDA優化優化
- CUDA簡介
- CUDA架構架構
- CUDA進階第三篇:CUDA計時方式
- HDU2841 Visible Trees (容斥原理)
- TROUBLESHOOTING - ASM disk not found/visible/discovered issuesASM
- visible_windows生成邏輯和解析Windows
- CUDA學習筆記-1: CUDA程式設計概覽筆記程式設計
- Multipath and Device MapperdevAPP
- raw device, first blockdevBloC
- about raw device[zt]dev
- CUDA學習指南
- 平行計算cuda
- CUDA執行模式模式
- CUDA C語言C語言
- CUDA 版本檢視
- cuda 核函式函式
- cuda安裝教程
- CUDA的問題