Linux build nvidia driver

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

NVIDIA driver packaging for Ubuntu

NVIDIA/ubuntu-packaging-nvidia-driver

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

ubuntu packaging nvidia driver

Packaging templates for Ubuntu based Linux distros to build NVIDIA driver packages.

The main branch contains this README. The control and .install files can be found in the appropriate 16.04, 18.04, and 20.04 branches.

This repo contains the template files used to build the following DEB packages:

note: flavor is the first . delimited field in the driver version, ex: 460 in 460.32.03

- libnvidia-cfg1-$ - libnvidia-common-$ - libnvidia-compute-$ - libnvidia-decode-$ - libnvidia-encode-$ - libnvidia-extra-$ - libnvidia-fbc1-$ - libnvidia-gl-$ - libnvidia-ifr1-$ - nvidia-compute-utils-$ - nvidia-dkms-$ - nvidia-driver-$ - nvidia-headless-$ - nvidia-headless-no-dkms-$ - nvidia-kernel-common-$ - nvidia-kernel-source-$ - nvidia-utils-$ - xserver-xorg-video-nvidia-$
- libcuda1-$ - nvidia-libopencl1-$ - nvidia-opencl-icd-$ - nvidia-$ - nvidia-$ -dev
- libnvidia-grid-$ - nvidia-grid-utils-$

Clone this git repository:

Читайте также:  Настройка интернета linux fedora

Supported branches: 16.04 , 18.04 & 20.04

git clone -b $ https://github.com/NVIDIA/ubuntu-packaging-nvidia-driver > ex: git clone -b 18.04 https://github.com/NVIDIA/ubuntu-packaging-nvidia-driver

Download a NVIDIA driver runfile:

  • TRD location: https://us.download.nvidia.com/tesla/ (not browsable) ex:https://us.download.nvidia.com/tesla/460.32.03/NVIDIA-Linux-x86_64-460.32.03.run
  • UDA location: https://download.nvidia.com/XFree86/Linux-x86_64/ex:https://us.download.nvidia.com/XFree86/Linux-x86_64/460.56/NVIDIA-Linux-x86_64-460.56.run
  • CUDA runfiles: cuda_$_$_linux.run are not compatible. However a NVIDIA driver runfile can be extracted intact from a CUDA runfile:
sh cuda_$ _$ _linux.run --tar mxvf > ex: sh cuda_11.2.1_460.32.03_linux.run --tar mxvf ls builds/NVIDIA-Linux-$ -$ .run > ex: ls builds/NVIDIA-Linux-x86_460.32.03.run

Install build dependencies

note: these are only needed for building not installation

# Packaging apt-get install debhelper devscripts dpkg-dev

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Ubuntu 18.04 How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line

License

nathtest/Tutorial-Ubuntu-18.04-Install-Nvidia-driver-and-CUDA-and-CUDNN-and-build-Tensorflow-for-gpu

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Ubuntu-18.04 Install Nvidia driver and CUDA and CUDNN and build Tensorflow for gpu

Ubuntu 18.04 Tutorial : How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line

Thoses steps allowed me to build tensorflow for gpu with a comptute capabilities of 3.0 on a laptop with a GeForce 740m and Ubuntu 18.04.

Install neccesary library :

 sudo apt-get install openjdk-8-jdk git python-dev python3-dev python-numpy python3-numpy python-six python3-six build-essential python-pip python3-pip python-virtualenv swig python-wheel python3-wheel libcurl3-dev libcupti-dev 

If libcurl3-dev package is not found use:

 sudo apt-get install libcurl4-openssl-dev 

Add graphics drivers to your source list :

 sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update sudo apt upgrade 

Check what driver will be installed :

Auto install latest driver (it will do everything blacklist drivers nouveau , create nvidia daemon , ect . ) :

 sudo ubuntu-drivers autoinstall 

If you boot without any kernel crash you’re ok but you can check the correct install of the driver :

Download cuda_your_cuda_version.run on https://developer.nvidia.com/cuda-toolkit and install it:

 cd Downloads/ sudo sh cuda_9.0.176_384.81_linux.run --override --silent --toolkit 

If everything is ok you should see a cuda folder in /usr/local/ .

Download linux cudnn_your_version on https://developer.nvidia.com/cudnn and install it:

 tar -xzvf cudnn-9.0-linux-x64-v7.1.tgz sudo cp cuda/include/cudnn.h /usr/local/cuda/include sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 

Check if you have correctly copied cudnn in /usr/local/cuda/lib64/.

Now you must add some path to your /.bashrc :

Add those line at the end of your /.bashrc :

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" export CUDA_HOME=/usr/local/cuda 

Now reload your terminal config :

 source ~/.bashrc sudo ldconfig 

Check if the path are correctly installed :

Build tensorflow with Bazel

Install gcc 4.8 (only version of gcc that can currently compile tensorflow) :

 sudo apt-get install gcc-4.8 g++-4.8 sudo apt-get update 

If gcc-4.8 package is not found you can try to add :

 sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.8 g++-4.8 
 sudo apt install curl echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - sudo apt-get update sudo apt-get install bazel sudo apt-get upgrade bazel 

Download tensorflow and choose what branch you want :

 cd ~ git clone https://github.com/tensorflow/tensorflow cd ~/tensorflow git checkout r1.8 cd ~/tensorflow 

Create configuration file for tensorflow build :

Say no to most query just specify the python version you want , yes to jemalloc and specify correct path to gcc-4.8.

Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3 Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: Y Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: N Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: N Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: N Do you wish to build TensorFlow with Apache Kafka Platform support? [y/N]: N Do you wish to build TensorFlow with XLA JIT support? [y/N]: N Do you wish to build TensorFlow with GDR support? [y/N]: N Do you wish to build TensorFlow with VERBS support? [y/N]: N Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: N Do you wish to build TensorFlow with CUDA support? [y/N]: Y Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 9.0]: 9.0 Please specify the location where CUDA 9.1 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.1 Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda Do you wish to build TensorFlow with TensorRT support? [y/N]: N Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 5.0] 3.0 Do you want to use clang as CUDA compiler? [y/N]: N Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: /usr/bin/gcc-4.8 Do you wish to build TensorFlow with MPI support? [y/N]: N Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]: -march=native Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]:N 

Build tensorflow with bazel :

sudo bazel build --config=opt --config=cuda --action_env="/usr/local/cuda/lib64" //tensorflow/tools/pip_package:build_pip_package 

Create .whl for pip install :

 bazel-bin/tensorflow/tools/pip_package/build_pip_package tensorflow_pkg cd tensorflow_pkg/ sudo pip3 install tensorflow-.whl 

Let me know if you find some quicker way to build tensorflow or if you found some mistakes.

About

Ubuntu 18.04 How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line

Источник

Оцените статью
Adblock
detector