A step by Step Guide to Install Tensorflow GPU on Ubuntu 18.04 LTS

 

I wanted to note down what I did to get tensorflow-gpu working with my fresh Ubuntu 18.04 LTS install.I thought it will be helpfull if i share that here There isn’t any official downloads for Ubuntu 18.04 yet from NVIDIA, but you can use the files for Ubuntu 17.04.

1.Nvidia driver

The first we should check is that we have an Nvidia driver installed for our graphics card. Our graphics card must support at least Nvidia compute 3.0 to install tensorflow-gpu.

check here the compute capability https://developer.nvidia.com/cuda-gpus

we can check what graphics driver we have installed with thenvidia-smicommand. we should see some output like the following:

 
The driver version we have installed is near the top left next to “NVIDIA-SMI”. I’ve got nvidia-390.48installed.

2.CUDA Toolkit 9.0

Got to https://developer.nvidia.com/cuda-toolkit-archive in the Archived Releases select CUDA Toolkit 9.0 (Sept 2017).Then download the runfile for Ubuntu 17.04.

 
It ll be something like this. download the file from the Base Installer link.

Once you’ve finished downloading that file, navigate to where the file was downloaded in your terminal.usually it ll be in your downloads directory.So navigate to the download directory and right click there and click open terminal.

In the terminal execute following two commands one by one

sudo chmod +x cuda_9.0.176_384.81_linux.run
./cuda_9.0.176_384.81_linux.run --override

Accept the terms and conditions, say yes to installing with an unsupported configuration.and no to “Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?”. Make sure you don’t agree to install the new driver.Follow the prompts to install the toolkit using the default install locations.

3.CUDA post-install actions

So Tensorflow can find our CUDA installation and use it properly, we need to add these lines to the end of you ~/.bashrc

first in our terminal type following command to open ~/.bashrc :

nano ~/.bashrc

Then add following paths at the end of the file ~/.bashrc

export PATH=/usr/local/cuda-9.0/bin${PATH:+${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}

finally In order to activate the installation, we should source the ~/.bashrc file:

source ~/.bashrc

4.CUDNN 7.0

Now visit https://developer.nvidia.com/cudnn to get CUDNN 7.0. Go to the downloads archive page again and find version 7.0 for CUDA 9.0 that we just installed. Download the link that says “cuDNN v7.0.5 Library for Linux”. This will download an archive that we can unpack and move the contents the correct locations.

 
Get the Library for Linux file for CUDA 9.0.

Once downloaded,we are going to unpack the archive and move it the contents into the directory where we installed CUDA 9.0:

execute following commands in terminal of the download directory

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

# Unpack the archive
tar -zxvf cudnn-9.0-linux-x64-v7.tgz
# Move the unpacked contents to your CUDA directory
sudo cp -P cuda/lib64/* /usr/local/cuda-9.0/lib64/
sudo cp  cuda/include/* /usr/local/cuda-9.0/include/
# Give read access to all users
sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h

5.Install libcupti

simply execute following command

sudo apt-get install libcupti-dev

6.Installing Anaconda

The best way to install Anaconda is to download the latest Anaconda installer bash script, verify it, and then run it.

Navigate download directory.Now we can run the script:

bash Anaconda3-5.0.1-Linux-x86_64.sh

follow all prompts an install.Once it’s complete we’ll receive the following output:

...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/kekayan/.bashrc ? [yes|no]
[no] >>>

Type yes so that we can use the conda command.

In order to activate the installation, you should source the ~/.bashrc file:

source ~/.bashrc

Once we have done that, you can verify our installation by making use of the conda command, for example with list:

conda list

Let’s create our virtual environment.so we can install tensorflow there

conda create --name tf

tf is the name i have for my environment.

Then we can activate it by

source activate tf

Next we intsall pip by following command

easy_install -U pip

finally install tensorflow gpu by issuing following command

pip3 install --upgrade tensorflow-gpu

follow link to check how to validate

 

[source] https://medium.com/codezillas/step-by-step-guide-to-install-tensorflow-gpu-on-ubuntu-18-04-lts-6feceb0df5c0

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
공지 오라클 기본 샘플 데이터베이스 졸리운_곰 2014.01.02 86308
공지 [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE 가을의 곰을... 2013.02.10 78761
공지 [G_SQL] Sample Database 가을의 곰을... 2012.05.20 95508
22 Docker에서 SQL Server 컨테이너 이미지 구성 file 졸리운_곰 2020.01.23 1554
21 MSSQL 설치형 한글 환경으로 변경 file 졸리운_곰 2020.01.23 2886
20 PRIMARY KEY 와 FOREIGN KEY 를 전부 뽑아주는 쿼리 졸리운_곰 2018.12.16 1773
19 [MSSQL] CASE 문 . 조건에 따라 값 정하기 ! CASE WHEN THEN 졸리운_곰 2018.07.24 1568
18 Track Data Changes (SQL Server) file 졸리운_곰 2018.07.02 1302
17 Docker가 있는 SQL Server 2017 컨테이너 이미지를 실행 하는 빠른 시작 file 졸리운_곰 2018.06.26 1055
16 [MSSQL] Management Studio 이용해 데이터베이스 생성하기 file 졸리운_곰 2018.06.17 1283
15 [MSSQL - GROUP BY HAVING 을 이용한 중복 데이타 체크] file 졸리운_곰 2018.06.15 1280
14 [SQL] select 한 결과로 update 처리, SQL한문장, How to UPDATE from SELECT in SQL Server 졸리운_곰 2018.01.22 1472
13 UNION으로 결과 집합 조합 졸리운_곰 2017.08.27 1341
12 uniqueidentifier(Transact-SQL) file 가을의곰 2017.06.10 1755
11 하위 쿼리를 사용하여 다른 쿼리 또는 식에 쿼리 중첩 [MS-ACCESS : ms offce suit] 가을의곰 2017.06.10 1639
10 [MS-SQL] 테이블명, 컬럼명 검색 졸리운_곰 2017.04.17 1934
9 DB의 모든 테이블에서 데이터 검색 졸리운_곰 2017.04.17 1717
8 Microsoft SQL Server DBA 가이드-DBA라면 이정도는 알아야한다!!! file 졸리운_곰 2017.01.15 1302
7 SQL Server DBA 가이드 file 졸리운_곰 2017.01.15 1685
6 IDENTITY_INSERT가 OFF로 설정되면 ‘테이블명’ 테이블의 ID 열에 명시적 값을 삽입할 수 없습니다 file 졸리운_곰 2017.01.15 1503
5 MS SQL 서버에서 자동증가, autoincrement 처리 file 졸리운_곰 2017.01.15 1773
4 MS SQL 서버의 날짜, 시간 => 문자열 변환 포멧 설명 졸리운_곰 2017.01.15 1215
3 MS SQL 서버 코딩 표준 가이드 file 졸리운_곰 2017.01.14 1654
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED