|
|
<!DOCTYPE html>
|
|
|
<html lang="en-us">
|
|
|
<head><meta charset="utf-8">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
<script type="application/ld+json">
|
|
|
{
|
|
|
"@context" : "http://schema.org",
|
|
|
"@type" : "BlogPosting",
|
|
|
"mainEntityOfPage": {
|
|
|
"@type": "WebPage",
|
|
|
"@id": "https:\/\/h.cowbay.org"
|
|
|
},
|
|
|
"articleSection" : "post",
|
|
|
"name" : "[筆記] 在ubuntu 18.04 下安裝nvidia 顯示卡驅動程式以及 pgstrom \/ Install Nvidia Driver Cuda Pgstrom in Ubuntu 1804",
|
|
|
"headline" : "[筆記] 在ubuntu 18.04 下安裝nvidia 顯示卡驅動程式以及 pgstrom \/ Install Nvidia Driver Cuda Pgstrom in Ubuntu 1804",
|
|
|
"description" : "\x3cp\x3e因為老闆說要試試看用GPU 來跑postgresql 威力\x3c\/p\x3e\n\x3cp\x3e手邊剛好有一張 geforce gt 720\x3c\/p\x3e\n\x3cp\x3e一開始沒想太多,看到有這張卡的驅動程式,然後CUDA也有支援\x3c\/p\x3e\n\x3cp\x3e就直接從桌機拔下來,接去LAB Server ,然後就開始一連串的難關了\x26hellip;\x3c\/p\x3e",
|
|
|
"inLanguage" : "en",
|
|
|
"author" : "Eric Chang",
|
|
|
"creator" : "Eric Chang",
|
|
|
"publisher": "Eric Chang",
|
|
|
"accountablePerson" : "Eric Chang",
|
|
|
"copyrightHolder" : "Eric Chang",
|
|
|
"copyrightYear" : "2019",
|
|
|
"datePublished": "2019-08-20 14:51:54 \x2b0800 CST",
|
|
|
"dateModified" : "2019-08-20 14:51:54 \x2b0800 CST",
|
|
|
"url" : "https:\/\/h.cowbay.org\/post\/install-nvidia-driver-cuda-pgstrom-in-ubuntu-1804\/",
|
|
|
"wordCount" : "836",
|
|
|
"image" : "https://h.cowbay.orghttps://h.cowbay.org/images/post-default-7.jpg"",
|
|
|
"keywords" : [ ""nvidia"","Blog" ]
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
|
|
|
<title>[筆記] 在ubuntu 18.04 下安裝nvidia 顯示卡驅動程式以及 pgstrom / Install Nvidia Driver Cuda Pgstrom in Ubuntu 1804 </title>
|
|
|
|
|
|
|
|
|
<meta name="description" content="some articles about job,food,passion sisters" />
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<meta name="robots" content="all,follow">
|
|
|
<meta name="googlebot" content="index,follow,snippet,archive">
|
|
|
<link rel="stylesheet" id="ct-tracks-google-fonts-css" href="https://fonts.googleapis.com/css?family=Raleway%3A400%2C700&subset=latin%2Clatin-ext&ver=4.7.2" type="text/css" media="all">
|
|
|
|
|
|
<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=1629957884" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
|
|
|
|
|
|
<link href="https://h.cowbay.org/css/custom.css?v=1629957884" 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">
|
|
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
var doNotTrack = false;
|
|
|
if (!doNotTrack) {
|
|
|
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
|
|
ga('create', 'UA-138954876-1', 'auto');
|
|
|
|
|
|
ga('send', 'pageview');
|
|
|
}
|
|
|
</script>
|
|
|
<script async src='https://www.google-analytics.com/analytics.js'></script>
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
<body class="post-template-default single single-post single-format-standard ct-body singular singular-post not-front standard">
|
|
|
|
|
|
<div id="overflow-container" class="overflow-container">
|
|
|
<a class="skip-content" href="#main">Skip to content</a>
|
|
|
<header id="site-header" class="site-header" role="banner">
|
|
|
<div class='top-navigation'>
|
|
|
<div class='container'>
|
|
|
|
|
|
<div id="menu-secondary" class="menu-container menu-secondary" role="navigation">
|
|
|
<button id="toggle-secondary-navigation" class="toggle-secondary-navigation"><i class="fas fa-plus"></i></button>
|
|
|
|
|
|
<div class="menu">
|
|
|
|
|
|
<ul id="menu-secondary-items" class="menu-secondary-items">
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/ansible">ansible</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/linux">linux</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/proxmox">proxmox</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/ps">ps</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/%E7%A2%8E%E5%BF%B5">碎念</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/%E7%AD%86%E8%A8%98">筆記</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/%E7%BE%A4%E6%9A%89">群暉</a>
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
|
|
|
<a href="/categories/%E9%9B%9C%E5%BF%B5">雜念</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<ul class="social-media-icons">
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20Social%20profile%20url%20in%20facebook" data-animate-hover="pulse" class="facebook" target="_blank">
|
|
|
<i class="fab fa-facebook-square" title="facebook"></i>
|
|
|
<span class="screen-reader-text">facebook</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20googleplus" data-animate-hover="pulse" class="gplus" target="_blank">
|
|
|
<i class="fab fa-google-plus-g" title="googleplus"></i>
|
|
|
<span class="screen-reader-text">googleplus</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="chang0206" data-animate-hover="pulse" class="twitter" target="_blank">
|
|
|
<i class="fab fa-twitter-square" title="twitter"></i>
|
|
|
<span class="screen-reader-text">twitter</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="chang0206" data-animate-hover="pulse" class="instagram" target="_blank">
|
|
|
<i class="fab fa-instagram" title="instagram"></i>
|
|
|
<span class="screen-reader-text">instagram</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="mailto:mc@hotshraingmy.info" data-animate-hover="pulse" class="email">
|
|
|
<i class="fas fa-envelope" title="email"></i>
|
|
|
<span class="screen-reader-text">email</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20linkedin" data-animate-hover="pulse" class="linkedin" target="_blank">
|
|
|
<i class="fab fa-linkedin-in" title="linkedin"></i>
|
|
|
<span class="screen-reader-text">linkedin</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20stackoverflow" data-animate-hover="pulse" class="stackoverflow" target="_blank">
|
|
|
<i class="fab fa-stack-overflow" title="stackoverflow"></i>
|
|
|
<span class="screen-reader-text">stackoverflow</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="changchichung" data-animate-hover="pulse" class="github" target="_blank">
|
|
|
<i class="fab fa-github" title="github"></i>
|
|
|
<span class="screen-reader-text">github</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20pinterest" data-animate-hover="pulse" class="pinterest" target="_blank">
|
|
|
<i class="fab fa-pinterest" title="pinterest"></i>
|
|
|
<span class="screen-reader-text">pinterest</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="https://h.cowbay.org/index.xml" data-animate-hover="pulse" class="rss" target="_blank">
|
|
|
<i class="fas fa-rss" title="rss"></i>
|
|
|
<span class="screen-reader-text">rss</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
</ul></div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="container">
|
|
|
<div id="title-info" class="title-info">
|
|
|
<div id='site-title' class='site-title'>
|
|
|
|
|
|
<a href="/"> MC部落 </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<button id="toggle-navigation" class="toggle-navigation">
|
|
|
<i class="fas fa-bars"></i>
|
|
|
</button>
|
|
|
|
|
|
<div id="menu-primary-tracks" class="menu-primary-tracks"></div>
|
|
|
<div id="menu-primary" class="menu-container menu-primary" role="navigation">
|
|
|
|
|
|
<p class="site-description">What’s the Worst That Could Happen?</p>
|
|
|
|
|
|
|
|
|
<div class="menu">
|
|
|
<ul id="menu-primary-items" class="menu-primary-items">
|
|
|
|
|
|
|
|
|
<li class='menu-item menu-item-type-custom menu-item-object-custom '>
|
|
|
<a href="https://h.cowbay.org/">Home</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li class='menu-item menu-item-type-post_type menu-item-object-page '>
|
|
|
<a href="https://h.cowbay.org/about/">About</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li class='menu-item menu-item-type-post_type menu-item-object-page '>
|
|
|
<a href="https://h.cowbay.org/contact/">Get in touch</a>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</header>
|
|
|
|
|
|
<div id="main" class="main" role="main">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="loop-container" class="loop-container">
|
|
|
|
|
|
<div class="post type-post status-publish format-standard has-post-thumbnail hentry category-design tag-design tag-standard-2 tag-tagalicious tag-travel entry full-without-featured odd excerpt-1">
|
|
|
|
|
|
<div class='featured-image lazy lazy-bg-image' data-background="https://h.cowbay.org/images/post-default-7.jpg">
|
|
|
</div>
|
|
|
|
|
|
<div class="entry-meta">
|
|
|
<span class="date">20 August</span> <span> / </span>
|
|
|
|
|
|
<span class="author">
|
|
|
<a href="https://github.com/changchichung" title="Posts by Eric Chang" rel="author">Eric Chang</a>
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class="category">
|
|
|
<span> / </span>
|
|
|
|
|
|
<a href="/categories/%E7%AD%86%E8%A8%98">筆記</a>
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
<div class='entry-header'>
|
|
|
<h1 class='entry-title'> [筆記] 在ubuntu 18.04 下安裝nvidia 顯示卡驅動程式以及 pgstrom / Install Nvidia Driver Cuda Pgstrom in Ubuntu 1804</h1>
|
|
|
</div>
|
|
|
<div class="entry-container">
|
|
|
<div class="entry-content">
|
|
|
<article>
|
|
|
<p>因為老闆說要試試看用GPU 來跑postgresql 威力</p>
|
|
|
<p>手邊剛好有一張 geforce gt 720</p>
|
|
|
<p>一開始沒想太多,看到有這張卡的驅動程式,然後CUDA也有支援</p>
|
|
|
<p>就直接從桌機拔下來,接去LAB Server ,然後就開始一連串的難關了…</p>
|
|
|
<p>整個過程大致上分為四個步驟</p>
|
|
|
<h3 id="安裝-nvidia-driver">安裝 nvidia driver</h3>
|
|
|
<h3 id="安裝-cuda">安裝 CUDA</h3>
|
|
|
<h3 id="安裝-postgresql">安裝 postgresql</h3>
|
|
|
<h3 id="安裝-pgstrom">安裝 pgstrom</h3>
|
|
|
<hr>
|
|
|
<h4 id="安裝-nvidia-driver-1">安裝 nvidia driver</h4>
|
|
|
<p>試過幾種方法,最後還是覺得用apt來安裝比較妥當
|
|
|
先新增repository、update、裝driver</p>
|
|
|
<pre><code>sudo add-apt-repository ppa:graphics-drivers/ppa
|
|
|
sudo apt update
|
|
|
sudo apt install ubuntu-drivers-common
|
|
|
</code></pre><p>然後用這個指令</p>
|
|
|
<pre><code>ubuntu-drivers devices
|
|
|
</code></pre><p>看一下現在的驅動程式狀態</p>
|
|
|
<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
|
|
|
model : GK208B [GeForce GT 720]
|
|
|
driver : nvidia-driver-410 - third-party free
|
|
|
driver : nvidia-driver-418 - third-party free
|
|
|
driver : nvidia-340 - distro non-free
|
|
|
driver : nvidia-driver-430 - third-party free recommended
|
|
|
driver : nvidia-driver-390 - third-party free
|
|
|
driver : nvidia-driver-415 - third-party free
|
|
|
driver : xserver-xorg-video-nouveau - distro free builtin
|
|
|
</code></pre><p>我這張卡,可以裝到 430 的版本,
|
|
|
接下來就繼續安裝驅動程式、裝完之後重開機</p>
|
|
|
<pre><code>sudo apt install nvidia-driver-430
|
|
|
sudo reboot
|
|
|
</code></pre><p>這時候,應該可以看到一些基本資訊</p>
|
|
|
<pre><code>lsmod|grep nvidia
|
|
|
</code></pre><p>大概長這樣</p>
|
|
|
<pre><code>nvidia_uvm 798720 0
|
|
|
nvidia_drm 45056 3
|
|
|
nvidia_modeset 1093632 7 nvidia_drm
|
|
|
nvidia 18194432 258 nvidia_uvm,nvidia_modeset
|
|
|
drm_kms_helper 172032 1 nvidia_drm
|
|
|
drm 401408 6 drm_kms_helper,nvidia_drm
|
|
|
ipmi_msghandler 53248 2 ipmi_devintf,nvidia
|
|
|
</code></pre><p>到這邊 nvidia 驅動程式安裝完成,接下來安裝 cuda</p>
|
|
|
<h4 id="安裝-cuda-1">安裝 CUDA</h4>
|
|
|
<p>同樣採用官網下載deb 回來安裝的方法</p>
|
|
|
<p>到這邊 <a href="https://developer.nvidia.com/cuda-downloads">https://developer.nvidia.com/cuda-downloads</a></p>
|
|
|
<p>依照自己的系統選擇</p>
|
|
|
<p>我選擇 Linux – x86_64 – Ubuntu – 18.04 – deb(local)</p>
|
|
|
<p>畫面上就會有安裝步驟,照著做就沒問題了</p>
|
|
|
<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
|
|
|
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><code>cd /usr/local/cuda-10.1/samples/1_Utilities/deviceQuery
|
|
|
sudo make
|
|
|
</code></pre><p>會產生一個叫 deviceQuery 的執行檔,執行後,會有相關資訊</p>
|
|
|
<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)
|
|
|
|
|
|
Detected 1 CUDA Capable device(s)
|
|
|
|
|
|
Device 0: "GeForce GT 720"
|
|
|
CUDA Driver Version / Runtime Version 10.1 / 10.1
|
|
|
CUDA Capability Major/Minor version number: 3.5
|
|
|
Total amount of global memory: 1996 MBytes (2093416448 bytes)
|
|
|
( 1) Multiprocessors, (192) CUDA Cores/MP: 192 CUDA Cores
|
|
|
GPU Max Clock rate: 797 MHz (0.80 GHz)
|
|
|
Memory Clock rate: 900 Mhz
|
|
|
Memory Bus Width: 64-bit
|
|
|
L2 Cache Size: 524288 bytes
|
|
|
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
|
|
|
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
|
|
|
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
|
|
|
Total amount of constant memory: 65536 bytes
|
|
|
Total amount of shared memory per block: 49152 bytes
|
|
|
Total number of registers available per block: 65536
|
|
|
Warp size: 32
|
|
|
Maximum number of threads per multiprocessor: 2048
|
|
|
Maximum number of threads per block: 1024
|
|
|
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
|
|
|
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
|
|
|
Maximum memory pitch: 2147483647 bytes
|
|
|
Texture alignment: 512 bytes
|
|
|
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
|
|
|
Run time limit on kernels: Yes
|
|
|
Integrated GPU sharing Host Memory: No
|
|
|
Support host page-locked memory mapping: Yes
|
|
|
Alignment requirement for Surfaces: Yes
|
|
|
Device has ECC support: Disabled
|
|
|
Device supports Unified Addressing (UVA): Yes
|
|
|
Device supports Compute Preemption: No
|
|
|
Supports Cooperative Kernel Launch: No
|
|
|
Supports MultiDevice Co-op Kernel Launch: No
|
|
|
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
|
|
|
Compute Mode:
|
|
|
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
|
|
|
|
|
|
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.1, CUDA Runtime Version = 10.1, NumDevs = 1
|
|
|
Result = PASS
|
|
|
</code></pre><p>到這邊, CUDA 也安裝完成,再來是簡單的 postgresql 11</p>
|
|
|
<h4 id="安裝-postgresql-11">安裝 postgresql 11</h4>
|
|
|
<p>步驟差不多,就是新增repository,然後選擇要安裝的套件,不過套件的選擇和平常安裝postgresql 不太一樣</p>
|
|
|
<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 "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
|
|
|
sudo apt update
|
|
|
sudo apt install postgresql-client-11 postgresql-11 postgresql-server-dev-11 postgresql-common libicu-dev
|
|
|
</code></pre><p>跑完之後,就直接啟動 postgresql service 就可以了</p>
|
|
|
<p>再來是最麻煩的 pgstorm</p>
|
|
|
<h4 id="pgstorm">pgstorm</h4>
|
|
|
<p>話說,這軟體到底叫啥名字? pgstrom , pg-strom ? 看起來就像是拼錯字啊! =.=</p>
|
|
|
<p><a href="https://github.com/heterodb/pg-strom">https://github.com/heterodb/pg-strom</a></p>
|
|
|
<p>先 git clone 回來,然後make、make install</p>
|
|
|
<p>講是很簡單,但是一開始碰到很多問題,有去github 跟開發團隊回報,幸好有回覆我..</p>
|
|
|
<p>總之,目前在ubuntu 18.04 + postgresql-11 的環境下編譯是沒有問題了</p>
|
|
|
<h2 id="update">UPDATE</h2>
|
|
|
<p>今天拿到一張 GTX 1050 ti ,想說終於可以來測試看看 pg_strom 了</p>
|
|
|
<p>不過發現在ubuntu 底下,照著這篇操作還是會有問題</p>
|
|
|
<p>在做完git clone 要 make 之前,要先執行底下兩行指令</p>
|
|
|
<p>其中的 11 是 postgresql 版本,要依照自己安裝的版本做調整</p>
|
|
|
<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><code>git clone https://github.com/heterodb/pg-strom.git
|
|
|
cd pg-strom
|
|
|
make && sudo make install
|
|
|
</code></pre><p>再來設定一下 postgresql</p>
|
|
|
<h4 id="postgresql-相關設定">postgresql 相關設定</h4>
|
|
|
<p>需要修改一下postgresql.conf,來指定載入 pgstrom 的 library</p>
|
|
|
<p>官方是這麼說的</p>
|
|
|
<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><code>shared_preload_libraries = '$libdir/pg_strom'
|
|
|
</code></pre><p>然後還有其他三個要修改,不過這個不改不會影響pgstrom 的啟動</p>
|
|
|
<p>看狀況要不要修改吧</p>
|
|
|
<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><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="/etc/postgresql/11/main/postgresql.conf" 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
|
|
|
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: 2019-08-20 14:23:43.565 CST [11806] LOG: database system is shut down
|
|
|
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: pg_ctl: could not start server
|
|
|
Aug 20 14:23:43 hqdc032 postgresql@11-main[11801]: Examine the log output.
|
|
|
Aug 20 14:23:43 hqdc032 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory
|
|
|
Aug 20 14:23:43 hqdc032 systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
|
|
|
Aug 20 14:23:43 hqdc032 systemd[1]: Failed to start PostgreSQL Cluster 11-main.
|
|
|
</code></pre><p>啊幹!pg-strom 不支援這張GT 720啦!</p>
|
|
|
<p><a href="https://github.com/heterodb/pg-strom/wiki/001:-GPU-Availability-Matrix">https://github.com/heterodb/pg-strom/wiki/001:-GPU-Availability-Matrix</a></p>
|
|
|
<p>簡單說,就是至少從 GTX 1080 起跳,其他都不用想了</p>
|
|
|
<p>幹,花了兩天的時間在弄這東西,結果明明一開始就應該要先檢查的相容列表卻沒有檢查…</p>
|
|
|
<p>好了,現在就看准不准我買一張 GTX 1080 來測試了….</p>
|
|
|
<p>只是這價格嘛…嗯咳,不是我該煩惱的問題了..</p>
|
|
|
</article>
|
|
|
</div>
|
|
|
|
|
|
<div class='entry-meta-bottom'>
|
|
|
|
|
|
|
|
|
<div class="entry-categories"><p><span>Categories</span>
|
|
|
|
|
|
<a href="/categories/%E7%AD%86%E8%A8%98" title="View all posts in 筆記">筆記</a>
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="entry-tags"><p><span>Tags</span>
|
|
|
|
|
|
<a href="/tags/nvidia" title="View all posts tagged nvidia">nvidia</a>
|
|
|
|
|
|
|
|
|
</p></div> </div>
|
|
|
|
|
|
|
|
|
<div class="author-meta">
|
|
|
|
|
|
<div class="author">
|
|
|
|
|
|
<img alt='Eric Chang' src="https://www.gravatar.com/avatar/23f8ed94e007297499ac8df1641b3ff5?s=100&d=identicon" class='avatar avatar-72 photo' height='72' width='72'>
|
|
|
|
|
|
<span>
|
|
|
Written by:<a href="https://github.com/changchichung" title="Posts by Eric Chang" rel="author">Eric Chang</a> </span>
|
|
|
</div>
|
|
|
<div class="bio">
|
|
|
|
|
|
|
|
|
<p>塵世裡一個迷途小書僮</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a class="facebook" target="_blank"
|
|
|
href="full%20Social%20profile%20url%20in%20facebook">
|
|
|
<i class="fab fa-facebook-f"
|
|
|
title="facebook icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a class="googleplus" target="_blank"
|
|
|
href="full%20profile%20url%20in%20googleplus">
|
|
|
<i class="fab fa-google-plus-g"
|
|
|
title="googleplus icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a class="twitter" target="_blank"
|
|
|
href="chang0206">
|
|
|
<i class="fab fa-twitter-square"
|
|
|
title="twitter icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
<a class="linkedin" target="_blank"
|
|
|
href="full%20profile%20url%20in%20linkedin">
|
|
|
<i class="fab fa-linkedin"
|
|
|
title="linkedin icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a class="email" target="_blank"
|
|
|
href="mailto:mc@hotshraingmy.info">
|
|
|
<i class="fas fa-envelope"
|
|
|
title="email icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a class="instagram" target="_blank"
|
|
|
href="chang0206">
|
|
|
<i class="fab fa-instagram"
|
|
|
title="instagram icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a class="stackoverflow" target="_blank"
|
|
|
href="full%20profile%20url%20in%20stackoverflow">
|
|
|
<i class="fab fa-stack-overflow"
|
|
|
title="stackoverflow icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a class="github" target="_blank"
|
|
|
href="changchichung">
|
|
|
<i class="fab fa-github"
|
|
|
title="github icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a class="pinterest" target="_blank"
|
|
|
href="full%20profile%20url%20in%20pinterest">
|
|
|
<i class="fab fa-pinterest"
|
|
|
title="pinterest icon"></i>
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<section id="comments" class="comments">
|
|
|
<div id="disqus_thread"></div>
|
|
|
<script type="application/javascript">
|
|
|
var disqus_config = function () {
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
(function() {
|
|
|
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
|
|
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
|
|
|
return;
|
|
|
}
|
|
|
var d = document, s = d.createElement('script'); s.async = true;
|
|
|
s.src = '//' + "h-cowbay-org-1" + '.disqus.com/embed.js';
|
|
|
s.setAttribute('data-timestamp', +new Date());
|
|
|
(d.head || d.body).appendChild(s);
|
|
|
})();
|
|
|
</script>
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
|
|
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<footer id="site-footer" class="site-footer" role="contentinfo">
|
|
|
<h1>
|
|
|
|
|
|
<a href=""> MC部落 </a>
|
|
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
<p class="site-description">What’s the Worst That Could Happen?</p>
|
|
|
|
|
|
|
|
|
<div id="menu-footer" class="menu-container menu-footer" role="navigation">
|
|
|
<div class="menu">
|
|
|
|
|
|
<ul id="menu-footer-items" class="menu-footer-items">
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</div> </div>
|
|
|
|
|
|
<ul class="social-media-icons">
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a class="facebook" target="_blank"
|
|
|
href="full%20Social%20profile%20url%20in%20facebook" >
|
|
|
<i class="fab fa-facebook-f" title="facebook"></i>
|
|
|
<span class="screen-reader-text">facebook</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a class="googleplus" target="_blank"
|
|
|
href="full%20profile%20url%20in%20googleplus" >
|
|
|
<i class="fab fa-google-plus-g" title="googleplus"></i>
|
|
|
<span class="screen-reader-text">googleplus</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="chang0206" class="twitter" target="_blank">
|
|
|
<i class="fab fa-twitter-square" title="twitter"></i>
|
|
|
<span class="screen-reader-text">twitter</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="chang0206" class="instagram" target="_blank">
|
|
|
<i class="fab fa-instagram" title="instagram"></i>
|
|
|
<span class="screen-reader-text">instagram</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="mailto:mc@hotshraingmy.info" class="email">
|
|
|
<i class="fas fa-envelope" title="email"></i>
|
|
|
<span class="screen-reader-text">email</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20linkedin" class="linkedin" target="_blank">
|
|
|
<i class="fab fa-linkedin-in" title="linkedin"></i>
|
|
|
<span class="screen-reader-text">linkedin</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20stackoverflow" class="stackoverflow" target="_blank">
|
|
|
<i class="fab fa-stack-overflow" title="stackoverflow"></i>
|
|
|
<span class="screen-reader-text">stackoverflow</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="changchichung" class="github" target="_blank">
|
|
|
<i class="fab fa-github" title="github"></i>
|
|
|
<span class="screen-reader-text">github</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="full%20profile%20url%20in%20pinterest" class="pinterest" target="_blank">
|
|
|
<i class="fab fa-pinterest" title="pinterest"></i>
|
|
|
<span class="screen-reader-text">pinterest</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
<a href="https://h.cowbay.org/index.xml" data-animate-hover="pulse" class="rss" target="_blank">
|
|
|
<i class="fas fa-rss" title="rss"></i>
|
|
|
<span class="screen-reader-text">rss</span>
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
|
|
|
</ul> <div class="design-credit">
|
|
|
|
|
|
<p>© 2018 Göran Svensson</p>
|
|
|
|
|
|
<p>Nederburg Hugo Theme by <a href="https://appernetic.io">Appernetic</a>.</p>
|
|
|
|
|
|
<p>A port of Tracks by Compete Themes.</p>
|
|
|
|
|
|
</div>
|
|
|
</footer>
|
|
|
|
|
|
</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=1629957884"></script>
|
|
|
|
|
|
</body>
|
|
|
</html>
|