🐧

Windows+Docker μ—λŸ¬ λͺ¨μŒμ§‘

geum 2022. 11. 1. 11:05

연ꡬ싀 GPU μ„œλ²„μ—μ„œ μž‘μ—…ν•˜λ‹€κ°€ 둜컬 μœˆλ„μš°+WSL2 μ‘°ν•©μœΌλ‘œ Docker μ“°λ €κ³  ν–ˆλ”λ‹ˆ μ—λŸ¬κ°€ 우수수 πŸ™‚ ν•œκΈ€λ‘œ 된 μžλ£Œλ„ 잘 μ—†μ–΄μ„œ λˆ„κ΅°κ°€μ—κ²ŒλŠ” 도움이 되기λ₯Ό 바라며 마주친 μ—λŸ¬μ™€ ν•΄κ²° 방법을 정리해둔닀.

 

β€» ν™˜κ²½: Windows 10 Pro, Ubuntu 20.04


# 1

μ—λŸ¬ 문ꡬ

- Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 8h 29min 28s). Updates for this repository will not be applied.

 

μ—λŸ¬ 원인

- sudo apt-get update μ»€λ§¨λ“œ μ‚¬μš© μ‹œ 둜컬 μ‹œμŠ€ν…œκ³Ό μš°λΆ„νˆ¬ μ‹œμŠ€ν…œμ˜ μ‹œκ°„μ΄ λ‹¬λΌμ„œ μƒκΈ°λŠ” μ—λŸ¬. μ‹œκ°„ 동기화 ν•„μš”

 

μ‹œλ„

- timedatectl set-ntp 0으둜 μ‹œκ°„μ„ μˆ˜λ™ μž¬μ„€μ •ν•˜λ €κ³  ν–ˆμ§€λ§Œ λ°”λ‘œ μ•„λž˜ μ—λŸ¬(# 2)κ°€ λœ¨λ©΄μ„œ μ‹€νŒ¨

 

# 2

μ—λŸ¬ 문ꡬ

- System has not been booted with systemd as init system (PID 1). Can't operate. Failed to create bus connection: Host is down

 

μ—λŸ¬ 원인

- Host(이 λ•Œμ˜ Hostκ°€ μ •ν™•νžˆ 뭘 μ˜λ―Έν•˜λŠ”μ§€λŠ” νŒŒμ•…ν•˜μ§€ λͺ»ν•¨)κ°€ κΊΌμ Έ μžˆλŠ” μƒνƒœ

 

μ‹œλ„ 및 ν•΄κ²° 방법

- wsl --shutdown ν›„ WSL2 자체λ₯Ό μž¬μ‹œμž‘ν•˜λ‹ˆκΉŒ μ‹œκ°„μ΄ μžλ™μœΌλ‘œ 동기화(# 1 μ—λŸ¬ ν•΄κ²°)

 

# 3

μ—λŸ¬ 상황

- μ—λŸ¬ 문ꡬ가 μ •ν™•νžˆ κΈ°μ–΅λ‚˜μ§€ μ•Šμ§€λ§Œ WSL2μ—μ„œ GPUκ°€ μž‘νžˆλŠ”μ§€ ν™•μΈν•˜κΈ° μœ„ν•΄ nvidia-smi λͺ…λ Ήμ–΄ μž…λ ₯ν–ˆμ„ λ•Œ λͺ…λ Ήμ–΄κ°€ μ œλŒ€λ‘œ μΈμ‹λ˜μ§€ μ•ŠμŒ

 

μ—λŸ¬ 원인

- Windows 10κ³Ό κ΄€λ ¨λœ 버전 문제

 

μ‹œλ„ 및 ν•΄κ²° 방법

- μ•„λž˜ 사진 μ°Έκ³ ν•˜μ—¬ 21H1일 경우 21H2 μ΄μƒμœΌλ‘œ μ—…λ°μ΄νŠΈ ν•„μš”. μ›λž˜ 21H1μ΄μ—ˆλŠ”λ° μ—…λ°μ΄νŠΈ ν›„ 정상 μž‘λ™

 

# 4

μ—λŸ¬ 문ꡬ

- docker: unrecognized service

 

μ—λŸ¬ 원인

- docker λͺ…λ Ήμ–΄κ°€ μ—†κ±°λ‚˜ μ œλŒ€λ‘œ μ„€μΉ˜λ˜μ§€ μ•ŠμŒ

 

μ‹œλ„ 및 ν•΄κ²° 방법

- docker-ce docker-ce-cli containerd.io μž¬μ„€μΉ˜

 

⭐ μ°Έκ³  μ‚¬μ΄νŠΈ: https://velog.io/@inthecode/Windows-10WSL%EC%97%90%EC%84%9C-Docker%EB%A5%BC-%ED%99%9C%EC%9A%A9%ED%95%98%EC%97%AC-Tensorflow-GPU%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0#33-nvidia-docker-%EC%84%A4%EC%B9%98

 

# 5

μ—λŸ¬ 문ꡬ

- Error response from daemon: Container XXX is restarting, wait until the container is running

 

μ—λŸ¬ 원인

- μ •ν™•νžˆ νŒŒμ•…ν•˜μ§€ λͺ»ν–ˆμ§€λ§Œ docker run -d ~~~ 둜 μ»¨ν…Œμ΄λ„ˆ 생성 ν›„ docker exec ~~~ μ‚¬μš©ν–ˆμ„ λ•Œ λ°œμƒ

 

μ‹œλ„ 및 ν•΄κ²° 방법

- μ»¨ν…Œμ΄λ„ˆ μ‚­μ œ ν›„ docker run -it -d ~~~ 둜 μ»¨ν…Œμ΄λ„ˆ μž¬μƒμ„±