update some content

This commit is contained in:
2021-10-28 14:15:01 +08:00
parent b8600ab259
commit 27b5a11382
163 changed files with 951 additions and 922 deletions

View File

@@ -45,9 +45,9 @@
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://h.cowbay.org/css/style.css?v=1634607506" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/style.css?v=1635401692" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1634607506" rel="stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1635401692" rel="stylesheet" type='text/css' media='all'>
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
@@ -317,13 +317,13 @@ if (!doNotTrack) {
<h4 id="安裝-nvidia-driver-1">安裝 nvidia driver</h4>
<p>試過幾種方法最後還是覺得用apt來安裝比較妥當
先新增repository、update、裝driver</p>
<pre tabindex="0"><code>sudo add-apt-repository ppa:graphics-drivers/ppa
<pre><code>sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install ubuntu-drivers-common
</code></pre><p>然後用這個指令</p>
<pre tabindex="0"><code>ubuntu-drivers devices
<pre><code>ubuntu-drivers devices
</code></pre><p>看一下現在的驅動程式狀態</p>
<pre tabindex="0"><code>administrator@hqdc032:~/pg-strom$ ubuntu-drivers devices
<pre><code>administrator@hqdc032:~/pg-strom$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001288sv0000174Bsd0000326Bbc03sc00i00
vendor : NVIDIA Corporation
@@ -337,12 +337,12 @@ driver : nvidia-driver-415 - third-party free
driver : xserver-xorg-video-nouveau - distro free builtin
</code></pre><p>我這張卡,可以裝到 430 的版本,
接下來就繼續安裝驅動程式、裝完之後重開機</p>
<pre tabindex="0"><code>sudo apt install nvidia-driver-430
<pre><code>sudo apt install nvidia-driver-430
sudo reboot
</code></pre><p>這時候,應該可以看到一些基本資訊</p>
<pre tabindex="0"><code>lsmod|grep nvidia
<pre><code>lsmod|grep nvidia
</code></pre><p>大概長這樣</p>
<pre tabindex="0"><code>nvidia_uvm 798720 0
<pre><code>nvidia_uvm 798720 0
nvidia_drm 45056 3
nvidia_modeset 1093632 7 nvidia_drm
nvidia 18194432 258 nvidia_uvm,nvidia_modeset
@@ -356,7 +356,7 @@ ipmi_msghandler 53248 2 ipmi_devintf,nvidia
<p>依照自己的系統選擇</p>
<p>我選擇 Linux &ndash; x86_64 &ndash; Ubuntu &ndash; 18.04 &ndash; deb(local)</p>
<p>畫面上就會有安裝步驟,照著做就沒問題了</p>
<pre tabindex="0"><code>wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
<pre><code>wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
@@ -364,10 +364,10 @@ sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
</code></pre><p>一樣,安裝完成後重新開機,然後來編譯一個 deviceQuery 的小程式來看看資訊</p>
<pre tabindex="0"><code>cd /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery
<pre><code>cd /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery
sudo make
</code></pre><p>會產生一個叫 deviceQuery 的執行檔,執行後,會有相關資訊</p>
<pre tabindex="0"><code>administrator@hqdc032:/usr/local/cuda-10.1/samples/1_Utilities/deviceQuery$ ./deviceQuery
<pre><code>administrator@hqdc032:/usr/local/cuda-10.1/samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
@@ -415,7 +415,7 @@ Result = PASS
</code></pre><p>到這邊, CUDA 也安裝完成,再來是簡單的 postgresql 11</p>
<h4 id="安裝-postgresql-11">安裝 postgresql 11</h4>
<p>步驟差不多就是新增repository然後選擇要安裝的套件不過套件的選擇和平常安裝postgresql 不太一樣</p>
<pre tabindex="0"><code>sudo apt install wget ca-certificates
<pre><code>sudo apt install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo &quot;deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main&quot; &gt;&gt; /etc/apt/sources.list.d/pgdg.list'
sudo apt update
@@ -433,30 +433,30 @@ sudo apt install postgresql-client-11 postgresql-11 postgresql-server-dev-11 pos
<p>不過發現在ubuntu 底下,照著這篇操作還是會有問題</p>
<p>在做完git clone 要 make 之前,要先執行底下兩行指令</p>
<p>其中的 11 是 postgresql 版本,要依照自己安裝的版本做調整</p>
<pre tabindex="0"><code>sudo ln -snf /usr/lib/postgresql/11/lib/libpgcommon.a /usr/lib/x86_64-linux-gnu/libpgcommon.a
<pre><code>sudo ln -snf /usr/lib/postgresql/11/lib/libpgcommon.a /usr/lib/x86_64-linux-gnu/libpgcommon.a
sudo ln -snf /usr/lib/postgresql/11/lib/libpgport.a /usr/lib/x86_64-linux-gnu/libpgport.a
</code></pre><p>接著再去 make 就沒問題了</p>
<pre tabindex="0"><code>git clone https://github.com/heterodb/pg-strom.git
<pre><code>git clone https://github.com/heterodb/pg-strom.git
cd pg-strom
make &amp;&amp; sudo make install
</code></pre><p>再來設定一下 postgresql</p>
<h4 id="postgresql-相關設定">postgresql 相關設定</h4>
<p>需要修改一下postgresql.conf來指定載入 pgstrom 的 library</p>
<p>官方是這麼說的</p>
<pre tabindex="0"><code>PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries. Unable to load it on demand. Therefore, you must add the configuration below.
<pre><code>PG-Strom module must be loaded on startup of the postmaster process by the shared_preload_libraries. Unable to load it on demand. Therefore, you must add the configuration below.
</code></pre><p>修改 /etc/postgresql/11/main/postgresql.conf
加入一行</p>
<pre tabindex="0"><code>shared_preload_libraries = '$libdir/pg_strom'
<pre><code>shared_preload_libraries = '$libdir/pg_strom'
</code></pre><p>然後還有其他三個要修改不過這個不改不會影響pgstrom 的啟動</p>
<p>看狀況要不要修改吧</p>
<pre tabindex="0"><code>max_worker_processes = 100
<pre><code>max_worker_processes = 100
shared_buffers = 10GB
work_mem = 1GB
</code></pre><p>修改完後,重新啟動 postgresql service 有沒有很感動我終於可以享受用GPU跑SQL Query 的快感啦!!!</p>
<p>等等為什麼postgresql service 沒起來!?</p>
<p>看一下 /var/log/syslog</p>
<pre tabindex="0"><code>Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file=&quot;/etc/postgresql/11/main/postgresql.conf&quot; exited with status 1:
<pre><code>Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file=&quot;/etc/postgresql/11/main/postgresql.conf&quot; exited with status 1:
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: 2019-08-20 14:23:43.538 CST [11806] LOG: PG-Strom version 2.2 built for PostgreSQL 11
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: 2019-08-20 14:23:43.565 CST [11806] LOG: PG-Strom: GPU0 GeForce GT 720 - CC 3.5 is not supported
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: 2019-08-20 14:23:43.565 CST [11806] FATAL: PG-Strom: no supported GPU devices found
@@ -758,7 +758,7 @@ title="pinterest icon"></i>
</div>
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1634607506"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1635401692"></script>
</body>
</html>