본문 바로가기

카테고리 없음

[Windows] wsl 2 설치하기

https://www.44bits.io/ko/post/wsl2-install-and-basic-usage

 

WSL2(Windows Subsystem for Linux 2) 설치 및 사용 방법

지난 5월 윈도우10의 대규모 업데이트가 있었습니다. 이번 업데이트에는 WSL2 정식 릴리스가 포함되어있습니다. WSL은 경략 가상화 기술을 통해 윈도우에서 리눅스 배포판을 사용할 수 있게 도와

www.44bits.io

 

 

wsl --set-version Ubuntu-18.04 2

 

https://docs.nvidia.com/cuda/wsl-user-guide/index.html#wsl2-system-requirements

 

CUDA on WSL :: CUDA Toolkit Documentation

In some cases, when running a Docker container, you may encounter nvidia-container-cli : initialization error: $ sudo docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark docker: Error response from daemon: OCI runtime create fa

docs.nvidia.com

https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2

 

Getting started with CUDA on Ubuntu on WSL 2 | Ubuntu

At Build 2020 Microsoft announced support for GPU compute on Windows Subsystem for Linux 2. Ubuntu is the leading Linux distribution for WSL and a sponsor of WSLConf. Canonical, the publisher of Ubuntu, provides enterprise support for Ubuntu on WSL through

ubuntu.com

 

docker ps가 에러가 떴다 

https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker

 

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050 scrapinghub/

stackoverflow.com

 

21.08.30 win11으로 업데이트가 되니까 gpu인식도 잘 되고

1epoch당 5초이내 학습도 잘 되고

import tensorflow as tf
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plt

mnist = keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()   
x_train_norm, x_test_norm = x_train / 255.0, x_test / 255.0
x_train_reshaped=x_train_norm.reshape( -1, 28, 28, 1)  
x_test_reshaped=x_test_norm.reshape( -1, 28, 28, 1)

model=keras.models.Sequential()
model.add(keras.layers.Conv2D(16, (3,3), activation='relu', input_shape=(28,28,1)))
model.add(keras.layers.MaxPool2D(2,2))
model.add(keras.layers.Conv2D(32, (3,3), activation='relu'))
model.add(keras.layers.MaxPooling2D((2,2)))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(32, activation='relu'))
model.add(keras.layers.Dense(10, activation='softmax'))

model.summary()
model.compile(optimizer='adam',
             loss='sparse_categorical_crossentropy',
             metrics=['accuracy'])

# 모델 훈련
model.fit(x_train_reshaped, y_train, epochs=10)

ubuntu에서 하면 epoch당 2초가 걸린다.

ubuntu에서 2배나 빨리 되는 이유? --> driver version 때문인 것 같다.