Caffe: GPU 0은 λ‹€λ₯Έ GPUμ—μ„œ μ‹€ν–‰ν•  λ•Œλ„ μ‚¬μš©λ©λ‹ˆλ‹€ (# 440 λ‹€μ‹œ λ°œμƒ ν–ˆμŠ΅λ‹ˆκΉŒ?)

에 λ§Œλ“  2015λ…„ 03μ›” 24일  Β·  9μ½”λ©˜νŠΈ  Β·  좜처: BVLC/caffe

방금 CUDA 7.0 및 λ“œλΌμ΄λ²„ 346.47둜 caffe-rc2λ₯Ό λΉŒλ“œν–ˆμŠ΅λ‹ˆλ‹€. λ‚΄ 첫 번째 GPU (ID 0)μ—μ„œ ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•  λ•Œ λͺ¨λ“  것이 잘 μž‘λ™ν•©λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ 두 번째 GPU (ID 1 λ˜λŠ” build/test/test_all.testbin 1 )μ—μ„œ ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•  λ•Œ nvidia-smi λͺ…령은 두 GPUκ°€ λͺ¨λ‘ μ‚¬μš© μ€‘μž„μ„ ν‘œμ‹œν•©λ‹ˆλ‹€. GPU0μ—μ„œ ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•  λ•Œλ‚˜ caffe-rc1 (ν•œλ™μ•ˆ CUDA 6.5둜 λΉŒλ“œ 됨)을 μ‚¬μš©ν•˜μ—¬ ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•  λ•ŒλŠ” 그렇지 μ•ŠμŠ΅λ‹ˆλ‹€. CUDA 6.5λ₯Ό μ‚¬μš©ν•˜μ—¬ caffe-rc2 λΉŒλ“œλ₯Ό μ‹œλ„ν–ˆμ§€λ§Œ λ¬Έμ œκ°€ μ§€μ†λ©λ‹ˆλ‹€.

export CUDA_VISIBLE_DEVICES=1 λ₯Ό μ„€μ •ν•˜κ³  build/test/test_all.testbin 0 λ₯Ό μ‹€ν–‰ν•˜λ©΄ λ¬Έμ œκ°€ μ‚¬λΌμ‘ŒμŠ΅λ‹ˆλ‹€. κ·Έλž˜μ„œ 이것은 https://github.com/BVLC/caffe/issues/440 μ—μ„œμ™€ 같은 문제처럼 λ³΄μž…λ‹ˆλ‹€

μ—…λ°μ΄νŠΈ : λ‹€λ₯Έ μ†Œν”„νŠΈμ›¨μ–΄ (제 κ²½μš°μ—λŠ” cuda_memtest)λ₯Ό μ‚¬μš©ν•˜μ—¬ GPU0의 λ©”λͺ¨λ¦¬κ°€ 가득 μ°¬ μƒνƒœμ—μ„œ build/test/test_all.testbin 1 --gtest_filter=DataLayerTest* μ‹€ν–‰ν–ˆμ„ λ•Œ ν”„λ‘œκ·Έλž¨μ΄ μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.

build/test/test_all.testbin 1 --gtest_filter=DataLayerTest/3*
Cuda number of devices: 2
Setting to use device 1
Current device id: 1
Note: Google Test filter = DataLayerTest/3*
[==========] Running 12 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 12 tests from DataLayerTest/3, where TypeParam = caffe::DoubleGPU
[ RUN      ] DataLayerTest/3.TestReadLevelDB
F0324 20:34:20.499236 20499 benchmark.cpp:111] Check failed: error == cudaSuccess (2 vs. 0)  out of memory
*** Check failure stack trace: ***
    @     0x7f16777cfdaa  (unknown)
    @     0x7f16777cfce4  (unknown)
    @     0x7f16777cf6e6  (unknown)
    @     0x7f16777d2687  (unknown)
    @     0x7f1675f133b8  caffe::Timer::Init()
    @     0x7f1675f13569  caffe::CPUTimer::CPUTimer()
    @     0x7f1675ebacec  caffe::DataLayer<>::InternalThreadEntry()
    @     0x7f166de8da4a  (unknown)
    @     0x7f16755f5182  start_thread
    @     0x7f167532247d  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)

λ‹€λ₯Έ ν…ŒμŠ€νŠΈ λ²”μ£Ό (μ΅œμ†Œ NeuronLayerTest 및 FlattenLayerTest )λ₯Ό μ‚¬μš©ν•˜λ©΄ ν”„λ‘œκ·Έλž¨μ΄ μ œλŒ€λ‘œ μž‘λ™ν•©λ‹ˆλ‹€.

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

νŠΈμœ— λ‹΄μ•„ κ°€κΈ°
당신은 μ „ν™” λ§ˆμ‹­μ‹œμ˜€ caffe.set_gpu_mode 전에 caffe.set_device ? λŒ€λ‹΅μ΄ '예'인 경우 caffe.set_device 전에 caffe.set_gpu caffe.set_device μ „ν™”ν•˜λ©΄λ©λ‹ˆλ‹€.

caffe.set_device(devide_id)
caffe.set_mode_gpu()

λͺ¨λ“  9 λŒ“κΈ€

μ‹ κ³  ν•΄ μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€. μš°λ¦¬λŠ” 이것도 λ³΄μ•˜μŠ΅λ‹ˆλ‹€. 곧 μˆ˜μ • 될 μ˜ˆμ •μž…λ‹ˆλ‹€.

μˆ˜μ • λœλŒ€λ‘œ μ’…λ£Œλ©λ‹ˆλ‹€.

@shelhamer κ°μ‚¬ν•©λ‹ˆλ‹€. κ·Έλž˜μ„œ μˆ˜μ • PR이 λ³‘ν•©λ©λ‹ˆκΉŒ?

예, μˆ˜μ •λ˜μ–΄μ•Όν•©λ‹ˆλ‹€. μ£„μ†‘ν•©λ‹ˆλ‹€. ν˜„μž¬ PR 번호λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.

@shelhamer κ°μ‚¬ν•©λ‹ˆλ‹€. 방금 RC5 버전을 ν™•μΈν–ˆλŠ”λ° μž‘λ™ν•˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€!

1.0을 μ‚¬μš©ν•˜λŠ” 데 μ—¬μ „νžˆ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€.
8 개의 1080Ti. python2

ν•˜λ‚˜μ˜ ν”„λ‘œμ„ΈμŠ€ set_device_id (1) :
image

10 개의 ν”„λ‘œμ„ΈμŠ€ set_device_id ($ i), i from [0,9] :
image

@sczhengyabin κ³ μ³€ μŠ΅λ‹ˆκΉŒ? λ‹Ήμ‹ κ³Ό 같은 문제λ₯Ό λ§Œλ‚¬μŠ΅λ‹ˆλ‹€. pythonlayerλŠ” λ¬Έμ œμ™€ 관련이 μžˆμŠ΅λ‹ˆκΉŒ?

λΏ‘ 빡뀨
아직.
κ·ΈλŸ¬λ‚˜ caffe ν”„λ‘œκ·Έλž¨μ΄ λ‹€λ₯Έ GPUλ₯Ό 보지 λͺ»ν•˜λ„둝 ENV λ³€μˆ˜ "CUDA_VISIBLE_DEVICES = # gpu_id"λ₯Ό μ„€μ •ν–ˆμŠ΅λ‹ˆλ‹€.

예 :
CUDA_VISIBLE_DEVICES=0 python caffe_test.py

νŠΈμœ— λ‹΄μ•„ κ°€κΈ°
당신은 μ „ν™” λ§ˆμ‹­μ‹œμ˜€ caffe.set_gpu_mode 전에 caffe.set_device ? λŒ€λ‹΅μ΄ '예'인 경우 caffe.set_device 전에 caffe.set_gpu caffe.set_device μ „ν™”ν•˜λ©΄λ©λ‹ˆλ‹€.

caffe.set_device(devide_id)
caffe.set_mode_gpu()
이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰