Installing Tensorflow GPU on Ubuntu 18.04 LTS

While I’m not an expert, I wanted to detail what I did to get tensorflow-gpu working with my fresh Ubuntu 18.04 LTS install. NVIDIA doesn’t have any official downloads for Ubuntu 18.04 yet, but you can get things to work with the available files for Ubuntu 17.04.

Check your NVIDIA driver version

The first thing you should check is that you have an Nvidia driver installed for your graphics card. Your graphics card must support at least Nvidia compute 3.0 to install tensorflow-gpu.

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

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

If you don’t have a proper driver installed, go do that now.

Install CUDA Toolkit 9.0

Head over to https://developer.nvidia.com/cuda-toolkit and grab the the runfile download for Ubuntu 17.04. While this is for a different version of Ubuntu, you can get it to install what you need. You’ll have to go to the legacy downloads archive page to find version 9.0.

 
Runfile download page. Grab the file from the Base Installer link.

Once you’ve got that file, navigate to where the file was downloaded in your terminal and do

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. In my experience, doing so often leads to system instability issues. Follow the prompts to install the toolkit using the default install locations.

Install CUDNN 7.0

Next, head to 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 you just installed. Download the link that says “cuDNN v7.0.5 Library for Linux”. This will download an archive that you can unpack and move the contents the correct locations.

 
There are lots of options on the archive downloads page for CUDNN. Get the Library for Linux file for CUDA 9.0.

Once downloaded, unpack the archive and move it the contents into the directory where you install CUDA 9.0:

# 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/libcudnn/* /usr/local/cuda-9.0/lib64/
sudo cp  cuda/include/cudnn.h /usr/local/cuda-9.0/include/
# Give read access to all users
sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

Install libcupti

This one is easy.

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

sudo apt-get install libcupti-dev

Do the CUDA post-install actions

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

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

Restart your terminal before proceeding to the next step.

Install Tensorflow GPU

Finally, to install tensorflow-gpu run

pip install --upgrade tensorflow-gpu

I recommend installing tensorflow in a virtualenv to prevent having to muck around with your system Python packages. The official Tensorflow install instructions give various options, so you can choose what works best for you. If you choose the virtualenv route, I highly recommend using virtualenvwrapper, which makes using virtualenv far easier.

You can now test everything worked by opening a new python interpreter with python and running the following commands:

from tensorflow.python.client import device_lib

device_lib.list_local_devices()

If everything worked fine, you’ll see your GPU listed as part of the output like so:

[{
    name: "/device:CPU:0",
    device_type: "CPU",
    memory_limit: 268435456,
    locality {},
    incarnation: 12584189039274141042
},{
    name: "/device:GPU:0",
    device_type: "GPU",
    memory_limit: 3252486144,
    locality {
      bus_id: 1,
      links {}
    },
    incarnation: 16344452236433767630, 
    physical_device_desc: "device: 0, name: GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1"
]

That’s it! Good luck!

 

[source] https://medium.com/@taylordenouden/installing-tensorflow-gpu-on-ubuntu-18-04-89a142325138

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
공지 오라클 기본 샘플 데이터베이스 졸리운_곰 2014.01.02 86980
공지 [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE 가을의 곰을... 2013.02.10 79246
공지 [G_SQL] Sample Database 가을의 곰을... 2012.05.20 95981
78 [Kafka] Kafka 한번 살펴보자... Quickstart file 졸리운_곰 2021.06.18 1315
77 Java Kafka Producer, Consumer 예제 구현 Java를 이용하여 Kafka Producer와 Kakfa Consumer를 구현해보자. file 졸리운_곰 2021.06.18 1172
76 Beginner’s Guide to Understand Kafka file 졸리운_곰 2021.06.18 1575
75 [Kafka] Kafka 설치/실행 및 테스트 file 졸리운_곰 2021.06.18 1067
74 [java] [kafka] [Kafka] 개념 및 기본예제 file 졸리운_곰 2021.06.16 2171
73 Getting started with Apache Kafka in Python file 졸리운_곰 2020.09.10 2262
72 [Kafka] 다운로드 및 Quick Start file 졸리운_곰 2020.09.07 1900
71 [Kafka] 기본 개념잡기 file 졸리운_곰 2020.09.07 1720
70 Flume Integration with Kafka file 졸리운_곰 2019.04.16 2087
69 빅데이터: 플럼(Flume) 토폴로지 설계 file 졸리운_곰 2019.04.16 1604
68 실시간 처리를 위한 분산 메시징 시스템 카프카(Kafka) file 졸리운_곰 2018.05.12 1413
67 Flume과 Kafka를 사용한 초당 100만개 로그 수집 테스트 file 졸리운_곰 2018.05.12 1402
66 웹 크롤링 / web crwaling / web scraping / 웹 스크래핑 file 졸리운_곰 2017.07.09 1849
65 빅데이터 단지 몇퍼센트의 예측 정확성을 위하여 장애로 가득찬 빅데이터 시스템을 도입하여야 하는가에 대한 의문! file 졸리운_곰 2017.03.20 1612
64 빅데이터: 플럼(Flume) 토폴로지 설계 file 졸리운_곰 2017.03.20 1422
63 [실시간 분석 시스템] Apache Flume를 활용한 데이터 수집(1) file 졸리운_곰 2017.03.06 1324
62 [실시간 분석 시스템] 데이터 수집 #2 Apache Sqoop을 활용하여 RDBMS 데이터 수집(2) file 졸리운_곰 2017.03.06 1388
61 [실시간 분석 시스템] 데이터 수집 #2 Apache Sqoop을 활용하여 RDBMS 데이터 수집(1) file 졸리운_곰 2017.03.06 1109
60 [실시간 분석 시스템] 데이터 수집 #1 오픈 소스 수집기 비교 file 졸리운_곰 2017.03.06 1754
59 [실시간 분석 시스템] 일단 데이터 들여다 보기 file 졸리운_곰 2017.03.06 1949
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED