Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>

Contents

생애 첫 번째 고급 사양 PC 맞추다

아마도 생애 첫번째 고급 사양 PC 인 것 같다. 요즘은 고급 사양 PC는 곧 게이밍 PC라서, 100만원 후반에서 200만원까지 가뿐히 넘어간다. 하지만 내 PC의 주 사용 목적은 개발이라서 CPU 빵빵하고 메모리 빵빵하면 그만이다. 그래도 게임을 아주 안하는 건 아니라서 GTX 1050 ti 정도로 타협을 했다. 대략 16~18만원 정도에 구매 할 수 있다. GTX 1050도 있기는 한데, 가격 차이가 3만원 정도라서 그냥 GTX 1050ti로 선택했다.

운영체제

노트북과 데스크탑 모두 주요 운영체제로 우분투 리눅스, 윈도우 환경으로 KDE를 사용하고 있다.
  • 우분투 리눅스 18.04 : 2018년 8월 4일 현재 최신 버전이다.
  • KDE 환경 : KDE를 따로 설치하지는 않았고, 우분투에 KDE를 기본 윈도우 환경으로 패키징해서 배포하고 있는 쿠분투(Kubuntu)를 설치했다.

KDE 버전

kinfocenter로 KDE 버전을 확인 할 수 있다.

CPU

/proc/cpuinfo 에서 cpu 정보를 읽을 수 있다.
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 8
model name      : AMD Ryzen 7 2700 Eight-Core Processor
stepping        : 2
microcode       : 0x8008204
cpu MHz         : 2516.458
cache size      : 512 KB
physical id     : 0
siblings        : 16
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx hw_pstate sme ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 6387.63
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]
......  // 생략
processor	: 15
vendor_id	: AuthenticAMD
cpu family	: 23
model		: 8
model name	: AMD Ryzen 7 2700 Eight-Core Processor
stepping	: 2
microcode	: 0x8008204
cpu MHz		: 1352.143
cache size	: 512 KB
physical id	: 0
siblings	: 16
core id		: 7
cpu cores	: 65523
apicid		: 15
initial apicid	: 15
fpu		: yes
AMD Ryzen 7 2700 Eight-Core Processor, 8 core/16 thread를 확인 할 수 있다.
  • CPU 코어 수 : 8
  • 스레드 수 : 16
  • 기본클럭 : 3.2GHz
  • L3 캐시 : 16MB
  • CMOS : 12nm FinFET
  • PCI Express 버전 : PCIe 3.0 x 16
  • 기본 TDP/TDP : 65W
  • 패키지 : AM4

메인보드

dmidecodeDMI(Desktop Management Interface) 정보를 사람이 읽을 수 있게 출력해주는 프로그램이다.
$ sudo dmidecode
# dmidecode 3.1
Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.
Table at 0x000E8980.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: F22
	Release Date: 03/15/2018
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 16 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 5.13

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Gigabyte Technology Co., Ltd.
	Product Name: AB350M-Gaming 3
	Version: Default string
	Serial Number: Default string
	UUID: 03D502E0-045E-058C-0D06-9E0700080009
	Wake-up Type: PCI PME#
	SKU Number: Default string
	Family: Default string
Gigabyte Technology AB350M-Gaming 3 모델이다.

메모리

욕심은 32G 였지만 지금 당장 쓸만한 곳도 없어서, 16G로 맞췄다.

위 그림 처럼 방열판에 LED까지 달린 멋진 녀석을 구입하고 싶었으나, 가격차이가 8만원이상이 났다. 커스텀 PC를 만들 것도 아닌데, 이렇게 할 필요는 없을 것 같아서 무난한 삼성 16G 메모리를 구입했다. 메모리 정보를 확인해 보자.
$ free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        3.4G        9.2G        118M        3.1G         11G
스왑:        2.0G          0B        2.0G
자세한 특성을 확인해 보기로 했다.
$ sudo dmidecode --type memory
# dmidecode 3.1
Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.

Handle 0x0026, DMI type 16, 23 bytes
Physical Memory Array
	Location: System Board Or Motherboard
	Use: System Memory
	Error Correction Type: None
	Maximum Capacity: 256 GB
	Error Information Handle: 0x0025
	Number Of Devices: 4

...... // 생략
Handle 0x002F, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x0026
	Error Information Handle: 0x002E
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 8192 MB
	Form Factor: DIMM
	Set: None
	Locator: DIMM 1
	Bank Locator: P0 CHANNEL A
	Type: DDR4
	Type Detail: Synchronous Unbuffered (Unregistered)
	Speed: 2400 MT/s
	Manufacturer: Samsung
	Serial Number: 22D6C3AD
	Asset Tag: Not Specified
	Part Number: M378A1K43CB2-CRC    
	Rank: 1
	Configured Clock Speed: 2400 MT/s
	Minimum Voltage: 1.2 V
	Maximum Voltage: 1.2 V
DDR4, 2400 MT/S 8기가 메모리 두 개가 꽂혀있는 걸 확인했다. 16G 하나 꽂아달라고 주문을 넣었는데, 뭐 64G로 확장할일은 없겠지 싶은 생각에 그냥 넘어가기로 했다.

그래픽 카드

드라이버 설치

표준 우분투 저장소에서 설치하기로 했다. ubuntu-drivers 명령으로 디바이스 목록과 각 디바이스를 위한 권장 드라이버 모델을 검색 할 수 있다.
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:03.1/0000:06:00.0 ==
modalias : pci:v000010DEd00001C82sv000010DEsd000011BFbc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107 [GeForce GTX 1050 Ti]
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin
GeForce GTX 1050 Ti 모델을 확인 했다. 권장 드라이버는 nvidia-driver-390다. 여기에 동의 한다면 ubuntu-drivers로 드라이버를 설치하면 된다.
$ sudo ubuntu-drivers autoinstall
혹은 apt로 직접 설치 해도 된다.
$ sudo apt install nvidia-340

그래픽 카드 정보 확인

lshw 명령으로 확인 할 수 있다.
$ sudo lshw -C display
  *-display                 
       description: VGA compatible controller
       product: GP107 [GeForce GTX 1050 Ti]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:77 memory:fc000000-fcffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff
NVIDIA Corportaion의 GeForce GTX 1050 Ti 이다. nvidia-smi를 이용하면 그래픽카드의 사용 정보도 확인 할 수 있다.
$ nvidia-smi 
Sun Aug  5 01:08:43 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 105...  Off  | 00000000:06:00.0  On |                  N/A |
| 40%   38C    P0    N/A /  75W |    581MiB /  4036MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1168      G   /usr/lib/xorg/Xorg                           273MiB |
|    0      2530      G   kwin_x11                                      18MiB |
|    0      2535      G   /usr/bin/krunner                              14MiB |
|    0      2538      G   /usr/bin/plasmashell                          84MiB |
|    0      2826      G   /usr/bin/akonadi_archivemail_agent             1MiB |
|    0      2834      G   /usr/bin/akonadi_imap_resource                 1MiB |
|    0      2847      G   /usr/bin/akonadi_mailfilter_agent              1MiB |
|    0      2859      G   /usr/bin/akonadi_sendlater_agent              17MiB |
|    0      6806      G   ...am/.local/share/Steam/ubuntu12_32/steam    45MiB |
|    0      6815      G   ./steamwebhelper                               1MiB |
|    0      7342      G   ...-token=EDDEC38BA8FBE538EA35E36148460106   116MiB |
+-----------------------------------------------------------------------------+

Docker 환경 만들기

기본 설치는 Docker 설치문서를 참고했다. NVIDIA 그래픽카드도 설치했으니 docker가 GPU를 지원하도록 만들어보기로 했다. NVIDIA 드라이버는 설치했으니 NVIDIA docker만 설치하면 되겠다. nvidia-docker 문서를 참고해서 설치했다.
// 패키지 저장소를 이용하기 위해서 gpgkey를 등록한다. 
$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -

// 배포판 버전을 얻는다. 
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)

// 패키지 저장소를 등록한다.
$ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list

// 패키지를 업데이트하고
$ sudo apt-get update

// nvidia-docker2를 설치한다.
$ sudo apt-get install -y nvidia-docker2

// docker 서비스를 재시작 하고
$ sudo service docker restart

// nvidia/cuda 이미지로 부터 컨테이너를 실행한다.
// nvidia-smi를 실행해서 GPU 정보가 나오면 성공
$ docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 105...  Off  | 00000000:06:00.0  On |                  N/A |
| 40%   35C    P8    N/A /  75W |    575MiB /  4036MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

그래서 가격은

120만원 정도 나왔다. 조립 했으면 몇 만원 정도 더 싸게 했겠지만 굉장히 귀찮을 것 같아서 조립 PC 판매 업체를 통해서 해결 했다. 배송도 빠르고 괜찮기는 한데, 아래의 문제를 발견했다.
  • 16G 하나를 견적했는데, 8G x 2개로 나왔다. 10,000원 정도 차이가 난다.
  • 3만원 정도 하는 쿨러를 따로 신청했는데, 기본 쿨러가 온 것 같다.
기본 사양이 있고, 여기에서 몇 개 부품들을 바꾸는 방식이라 실수를 했을 수도 있는데 확인은 해봐야 겠다.

앞으로 할 일은