๋ฐ˜์‘ํ˜•

๐Ÿ‘ป OS & Tools 34

Ubuntu 22.04์— nvidia driver, cuda, cuDNN, torch ์„ค์น˜ํ•˜๊ธฐ (2024 ver)

์„œ๋ฒ„ ์„ธํŒ…์€ ํ•ญ์ƒ ํž˜๋“ค๋‹ค.. ๋ชฉ์ฐจ 0. ubuntu ๋ฒ„์ „ ํ™•์ธ1. nvidia driver ์„ค์น˜2. cuda ์„ค์น˜3. cuDNN ์„ค์น˜4. torch ์„ค์น˜  0. ubuntu ๋ฒ„์ „ ํ™•์ธ์ผ๋‹จ ์‚ฌ์šฉ์ค‘์ธ ubuntu์˜ ๋ฒ„์ „์„ ํ™•์ธํ•ด์ค€๋‹ค.lsb_release -a  1. nvidia driver ์„ค์น˜1-1. ์™ธ๋ถ€์ €์žฅ์†Œ ์ถ”๊ฐ€ nvidia driver์„ ํฌํ•จํ•˜๋Š” ์™ธ๋ถ€์ €์žฅ์†Œ(PPA)๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ํ•ด๋‹น ๋‚ด์šฉ์„ ํŒจํ‚ค์ง€ ๋ฆฌ์ŠคํŠธ์— ์—…๋ฐ์ดํŠธํ•ด์ค€๋‹ค.sudo add-apt-repository ppa:graphics-drivers/ppasudo apt update  1-2. ์„ค์น˜ ๊ฐ€๋Šฅํ•œ ๋“œ๋ผ์ด๋ฒ„ ๋ชฉ๋ก ํ™•์ธ ubuntu-drivers๋ฅผ ์ด์šฉํ•ด ์„ค์น˜ ๊ฐ€๋Šฅํ•œ nvidia driver ๋ชฉ๋ก์„ ํ™•์ธํ•œ๋‹ค.ubuntu-drivers devices..

/etc/profile, /etc/bash.bashrc, ~/.bashrc, ~/.bash_profile ํŒŒ์ผ์˜ ์ฐจ์ด์ 

์œ ์ €๊ฐ€ ๋กœ๊ทธ์ธํ•  ๋•Œ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ˆœ์„œ๋กœ bash ์„ค์ •ํŒŒ์ผ๋“ค์„ ์ฝ๊ฒŒ ๋œ๋‹ค. 1. /etc/profile ์‹คํ–‰: ์‹œ์Šคํ…œ ์ „์—ญ์— ๋Œ€ํ•œ ํ™˜๊ฒฝ์„ค์ •. ์ผ๋ฐ˜์ ์œผ๋กœ ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. - `/etc/bash.bashrc` ์‹คํ–‰ → ์‹œ์Šคํ…œ ์ „์ฒด์˜ non-login shell ํ™˜๊ฒฝ์„ค์ • - `/etc/profile.d` ๋””๋ ‰ํ† ๋ฆฌ ์•ˆ์˜ ์ถ”๊ฐ€ ์„ค์ • ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰. 2. ~/.bash_profile, ~/.bash_login, ~/.profile ์ค‘ ํ•˜๋‚˜ ์‹คํ–‰: ๊ฐœ์ธ ํ™˜๊ฒฝ ์„ค์ • - ์ผ๋ฐ˜์ ์œผ๋กœ `~/.bashrc`๋ฅผ ์‹คํ–‰ํ•œ๋‹ค - ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด login shell๊ณผ non-login shell ๋ชจ๋‘์—์„œ `~/.bashrc`๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

ํด๋”๋ณ„๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” direnv

https://github.com/direnv/direnv GitHub - direnv/direnv: unclutter your .profile unclutter your .profile. Contribute to direnv/direnv development by creating an account on GitHub. github.com direnv๋Š” ํด๋”๋ณ„๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ๋‹ค๋ฅด๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํˆด์ด๋‹ค. 1. ์„ค์น˜๋ฐฉ๋ฒ• apt-get install direnv #Linux brew install direnv #MacOS 2. shell์— hook ์„ค์ • ์‚ฌ์šฉํ•˜๋Š” shell์˜ ์ข…๋ฅ˜์— ๋”ฐ๋ผ hook์„ ์„ค์ •ํ•ด ์ฃผ์–ด์•ผ ํ•œ๋‹ค. 2.1. bash vi ~/.bashrc #๋งจ ์•„๋ž˜์— ๋‹ค์Œ ๋‚ด์šฉ ์ถ”๊ฐ€ eval "$(dir..

VSCode ์œ ์šฉํ•œ ๋‹จ์ถ•ํ‚ค ๋ชจ์Œ

VSCode ๋‹จ์ถ•ํ‚ค ์„ค์ •์€ ์ขŒ์ธกํ•˜๋‹จ [Manage] ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ [Keyboard Shortcuts]๋กœ ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋‹ค. 1. Go to File (Windows: ctrl+p / Mac: cmd+p) ํŒŒ์ผ๋ช…์„ ๊ฒ€์ƒ‰ํ•ด์„œ ๋ฐ”๋กœ openํ•  ์ˆ˜ ์žˆ๋‹ค. 2. Go to Line/Column (Windows: ctrl+g / Mac: cmd+g) ํŠน์ • ๋ผ์ธ์œผ๋กœ ๋ฐ”๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ๋‹ค. 3. Toggle Vertical/Horizontal Editor Layout (Windows: alt+ctrl+o / Mac: alt+cmd+o) ์—๋””ํ„ฐ ๊ทธ๋ฃน์„ transposeํ•  ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์œ„์•„๋ž˜๋กœ ๊ทธ๋ฃน์ด ๋ฐฐ์น˜๋˜์–ด ์žˆ์—ˆ์œผ๋ฉด ์ขŒ์šฐ ๋ฐฐ์น˜๋กœ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

TeX ํŒŒ์ผ์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๋ณด์—ฌ์ฃผ๋Š” LatexDiff ์„ค์น˜๋ฐฉ๋ฒ•๊ณผ ์‚ฌ์šฉ๋ฒ• (Windows)

์ €๋„์—์„œ ๋ฆฌ๋น„์ „ ์‹œ ๋…ผ๋ฌธ์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ํ‘œ์‹œ๋œ ํŒŒ์ผ์„ ์š”๊ตฌํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค. ์›Œ๋“œ์˜ ๊ฒฝ์šฐ 'track change' ๊ธฐ๋Šฅ์„ ์ด์šฉํ•˜๋ฉด ๋˜๋Š”๋ฐ, LaTeX์˜ ๊ฒฝ์šฐ๋Š” LatexDiff๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. LatexDiff๋ฅผ ์ด์šฉํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ํ‘œ์‹œ๋œ tex ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ๋‹ค. ์„ค์น˜๋ฐฉ๋ฒ• ๋‹ค์Œ ๋งํฌ์—์„œ latexdiff.zip ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•„ ์••์ถ•์„ ํ•ด์ œํ•œ๋‹ค. ๋‹ค์šด๋กœ๋“œ ๋งํฌ: https://www.ctan.org/pkg/latexdiff CTAN: Package latexdiff latexdiff – Determine and mark up significant differences between LaTeX files Latexdiff is a Perl script for visual mar..

Git Stash - ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ๋“ค์„ ์ž„์‹œ ์ €์žฅํ•˜๊ธฐ

git stash ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด ์ž‘์—…์ค‘์ด๋˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ๋“ค์„ ์ž„์‹œ๋กœ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋‹ค. git status ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜๋ฉด stage์— ์žˆ๋Š” ํŒŒ์ผ๋“ค์˜ ๋ชฉ๋ก์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋“ค์€ tracked์ด๋ฉด์„œ modified ์ƒํƒœ์ด๊ฑฐ๋‚˜, ์ƒˆ๋กญ๊ฒŒ stage์— ์ถ”๊ฐ€๋œ ํŒŒ์ผ๋“ค์ด๋‹ค. $ git status Changes to be committed: (use "git reset HEAD ..." to unstage) modified: index.html Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) ..

Git commit ์ •ํ™•ํ•œ ์‹œ๊ฐ„ ํ™•์ธํ•˜๊ธฐ

Github์—์„œ commitํ•œ ์‹œ๊ฐ„์ด ํ‘œ์‹œ๋ ๋•Œ '6 days ago' ์™€ ๊ฐ™์ด ๋‚˜ํƒ€๋‚œ๋‹ค. ์ด๋•Œ '6 days ago' ๋ถ€๋ถ„์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ฆฌ๋ฉด ์ •ํ™•ํ•œ ์‹œ๊ฐ„์ด ํ‘œ์‹œ๋œ๋‹ค. ๋ช‡์‹œ ๋ช‡๋ถ„์— commit์ด ๋˜์—ˆ๋Š”์ง€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด์ƒ ์˜ค๋Š˜์˜ ๊ฟ€ํŒ ๐Ÿ‘

tar.gz ์••์ถ• ํ•ด์ œ ์‹œ not in gzip ์—๋Ÿฌ

tar.gz ํŒŒ์ผ์„ ์••์ถ•ํ•ด์ œํ•  ๋•Œ ๋ณดํ†ต ๋‹ค์Œ command๋ฅผ ์ด์šฉํ•˜๋Š”๋ฐ, tar -zxvf [filename.tar.gz] ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋œจ๋ฉด์„œ ์••์ถ•ํ•ด์ œ๊ฐ€ ์•ˆ๋  ๋•Œ๊ฐ€ ์žˆ๋‹ค. ์ด ๊ฒฝ์šฐ ํŒŒ์ผ์ด๋ฆ„์€ .tar.gz๋กœ ๋˜์–ด ์žˆ์ง€๋งŒ gzip ํฌ๋งท์œผ๋กœ ์••์ถ•๋˜์ง€ ์•Š์•˜์„ ์ˆ˜ ์žˆ๋‹ค. ๋‹ค์Œ command๋กœ ์ด๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. file [filename.tar.gz] ํŒŒ์ผ์ด tar ํ˜•์‹์œผ๋กœ๋งŒ ์••์ถ•๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด ๊ฒฝ์šฐ ๋‹ค์Œ command๋กœ ์••์ถ•์„ ํ•ด์ œํ•  ์ˆ˜ ์žˆ๋‹ค. tar -xvf [filename.tar.gz] ์ฐธ๊ณ : https://www.linuxfordevices.com/tutorials/linux/solved-gzip-stdin-not-in-gzip-format [SOLVED] gzip: s..

VSCode ๊พธ๋ฏธ๊ธฐ

์˜ˆ์œ ์Šคํ‚จ์„ ๊ฐ–์ถ”์ง€ ์•Š์œผ๋ฉด ์ฝ”๋”ฉ์„ ๋ชปํ•˜๋Š” ๋‚˜.. ์ •์ƒ์ธ๊ฐ€์š”? ์‹ฌ์ง€์–ด ๋‚˜๊ฐ™์€ ์‚ฌ๋žŒ๋“ค์€ ์•„๋ฌด๋ฆฌ ์˜ˆ์˜๊ฒŒ ์Šคํ‚จ์„ ์™„์„ฑ์‹œ์ผฐ์–ด๋„ ์ฃผ๊ธฐ์ ์œผ๋กœ ๋” ์˜ˆ์˜๊ฒŒ ๋ฐœ์ „์‹œ์ผœ์•ผ ๋˜๋Š” ๊ทธ๋Ÿฐ ๋ณ‘์ด ์žˆ๋‹ค. ์ด๋ฒˆ์—” ์–ด๋–ป๊ฒŒ VSCode๋ฅผ ๋˜ ๊พธ๋ฉฐ๋ณผ๊นŒ ํ•˜๋‹ค๊ฐ€ ๋ฐœ๊ฒฌํ•œ ์˜ˆ์œ extension ๋‘๊ฐ€์ง€๋ฅผ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค 1. vscode-icons https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons vscode-icons - Visual Studio Marketplace Extension for Visual Studio Code - Icons for Visual Studio Code marketplace.visualstudio.com ํŒŒ์ผ ์•„์ด์ฝ˜์„ ์•Œ๋ก๋‹ฌ๋กํ•˜..

LaTeX figure ๋„ฃ๊ธฐ

LaTex์—์„œ figure์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” graphics package๋ฅผ ์„ ์–ธํ•ด์•ผ ํ•œ๋‹ค. \usepackage{graphicx} LaTeX์— ๋“ค์–ด๊ฐ€๋Š” figure์€ ์ผ๋ฐ˜์ ์œผ๋กœ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ตฌ์„ฑ๋œ๋‹ค. \begin{figure}[!t] \centerline{\includegraphics[width=\columnwidth]{figure.png}} \caption{This is the first figure.} \label{figure_1} \end{figure} Figure์˜ ๋‚ด์šฉ์€ \begin{figure} ๊ณผ \end{figure} ์‚ฌ์ด์— ์œ„์น˜ํ•œ๋‹ค. [!t]๋Š” figure์ด ๋†“์ผ ์ˆ˜ ์žˆ๋Š” ์œ„์น˜๋ฅผ ์˜๋ฏธํ•œ๋‹ค. ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ option์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹จ, ์ˆœ์„œ๋Œ€๋กœ ์ ์šฉ๋˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ๋‹ค. ๋Œ€๋ถ€..

๋ฐ˜์‘ํ˜•