Edit Info Other
Login

CUDA"

Differences between revisions 10 and 31 (spanning 21 versions)
Revision 10 as of 2017-05-19 13:11:28
Size: 2810
Comment:
Revision 31 as of 2019-04-06 12:00:27
Size: 5337
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
== Repository ==
Th
is repository contains a given version of CUDA that is parallel installable along with another version.
== NVIDIA official repositories ==
These repositories
contain versions of CUDA that are parallel installables along with another version.

=== CUDA Toolkit ===
Line 12: Line 14:
sudo yum install http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-repo-rhel7-8.0.61-1.x86_64.rpm sudo yum install https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-repo-rhel7-10.1.105-1.x86_64.rpm
Line 16: Line 18:
sudo yum install http://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/cuda-repo-rhel6-8.0.61-1.x86_64.rpm sudo yum install https://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/cuda-repo-rhel6-10.1.105-1.x86_64.rpm
Line 19: Line 21:
 * Fedora 23 (and later) {{{
sudo dnf install http://developer.download.nvidia.com/compute/cuda/repos/fedora23/x86_64/cuda-repo-fedora23-8.0.61-1.x86_64.rpm
 * Fedora 29 (and later) {{{
sudo dnf install https://developer.download.nvidia.com/compute/cuda/repos/fedora29/x86_64/cuda-repo-fedora29-10.1.105-1.x86_64.rpm
Line 23: Line 25:


=== Machine Learning repository ===

Please use the official link: https://developer.nvidia.com/nccl/nccl-download

 * RHEL/CentOS 7 {{{
sudo yum install https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm
sudo yum install libcudnn7 libcudnn7-dev
}}}

 * Fedora {{{
sudo dnf install https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm
sudo dnf install libcudnn7 libcudnn7-dev
}}}


=== Legacy NVIDIA 340xx/CUDA 6.5 ===
This repository contains a legacy version of CUDA 6.5 that will works with the NVIDIA 340xx serie

Please use the Official link: https://developer.nvidia.com/cuda-toolkit-65

 * RHEL/CentOS 6 {{{
sudo yum install http://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/cuda-repo-rhel6-6.5-14.x86_64.rpm
sudo yum install cuda
}}}
 * Fedora 20 (and later) {{{
sudo yum install install http://developer.download.nvidia.com/compute/cuda/repos/fedora20/x86_64/cuda-repo-fedora20-6.5-14.x86_64.rpm
sudo yum install cuda
}}}

Please verify to have a compatible compiler.
Line 29: Line 63:
 * Tweak the /usr/local/cuda-8.0/targets/x86_64-linux/include/host_defines.h to accept the Fedora default compiler.  * Tweak the /usr/local/cuda-9.2/targets/x86_64-linux/include/host_defines.h to accept the Fedora default compiler. (Not recommended).
Line 31: Line 65:
 * Install the appropriate gcc version for CentOS developper toolset. Please see https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/  * Install the appropriate gcc version from developper toolset. It will install in parallel. Please see https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/
Line 34: Line 68:
sudo dnf install http://ftp.ciril.fr/pub/linux/centos/7.3.1611/extras/x86_64/Packages/centos-release-scl-2-2.el7.centos.noarch.rpm
sudo dnf install devtoolset-4-toolchain
sudo dnf install http://centos.mirrors.ovh.net/ftp.centos.org/7/extras/x86_64/Packages/centos-release-scl-rh-2-2.el7.centos.noarch.rpm
sudo dnf install http://centos.mirrors.ovh.net/ftp.centos.org/7/updates/x86_64/Packages/libgfortran4-7.2.1-1.2.1.el7_5.x86_64.rpm
sudo dnf install devtoolset-7-toolchain
Line 37: Line 72:
You cannot install the whole devtoolset-4 collection, but the toolchain is enough , then each time you need to build using cuda, you start by You cannot install the whole devtoolset-7 collection, but the toolchain is enough , then each time you need to build using cuda, you start by
Line 39: Line 74:
scl run devtoolset-4 bash scl run devtoolset-7 bash
Line 41: Line 76:
gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)
Copyright (C) 2015 Free Software Foundation, Inc.
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
Line 44: Line 79:
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Line 47: Line 82:
gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)
Copyright © 2016 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER
gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Line 54: Line 89:
Both "Cuda" and "RPM Fusion" repositories provide the nvidia driver packages. Usually, the package provided by RPM Fusion is higher. But in case you want to avoid the risk, add this. Both "CUDA" and "RPM Fusion" repositories provide the nvidia driver packages. Usually, the package provided by RPM Fusion is higher. But in case you want to avoid the risk, add this:
Line 60: Line 95:
exclude=xorg-x11-drv-nvidia\*,akmod-nvidia\* exclude=akmod-nvidia*,kmod-nvidia*,*nvidia*,nvidia-*,cuda-nvidia-kmod-common,dkms-nvidia,nvidia-libXNVCtrl
Line 63: Line 98:

=== NVIDIA provided libOpenCL ===
NVIDIA only advertise OpenCL 1.2 with the binary driver at this time. As a consequence, they provide an old version of libOpenCL.so.1 which works fine with their binary driver.
As most software in Fedora and RPM Fusion are built using a newer libOpenCL, the system linker detects that and issues the following message:
{{{
 /usr/local/cuda-9.2/targets/x86_64-linux/lib/libOpenCL.so.1: no version information available (required by ffmpeg)
}}}

You can either ignore the message or manually delete the libOpenCL.so.1 provided by NVIDIA (run sudo ldconfig once deleted). Please verify to not have other OpenCL providers that might interfere with NVIDIA OpenCL usage.
(looking at /etc/OpenCL/vendors ).

=== Running blender ===
Even when only running blender, you need a CUDA compatible compiler as described above. This is because blender will compile the "CUDA Kernels" optimized for your own GPU. You can run blender with:
{{{
 scl run devtoolset-7 blender
}}}
Once the "CUDA kernels" are compiled, you can run blender normally

Line 64: Line 118:
 * CUDA Start quide: https://developer.nvidia.com/compute/cuda/8.0/prod/docs/sidebar/CUDA_Quick_Start_Guide-pdf  * CUDA whatsnew : https://developer.nvidia.com/cuda-toolkit/whatsnew

Installation

This Howto provides a way to install the official NVIDIA packages for CUDA.

NVIDIA official repositories

These repositories contain versions of CUDA that are parallel installables along with another version.

CUDA Toolkit

Please use the Official link: https://developer.nvidia.com/cuda-downloads

  • RHEL/CentOS 7

    sudo yum install https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-repo-rhel7-10.1.105-1.x86_64.rpm
    sudo yum install cuda
  • RHEL/CentOS 6

    sudo yum install https://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/cuda-repo-rhel6-10.1.105-1.x86_64.rpm
    sudo yum install cuda
  • Fedora 29 (and later)

    sudo dnf install https://developer.download.nvidia.com/compute/cuda/repos/fedora29/x86_64/cuda-repo-fedora29-10.1.105-1.x86_64.rpm
    sudo dnf install cuda

Machine Learning repository

Please use the official link: https://developer.nvidia.com/nccl/nccl-download

  • RHEL/CentOS 7

    sudo yum install https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm
    sudo yum install libcudnn7 libcudnn7-dev
  • Fedora

    sudo dnf install https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86_64/nvidia-machine-learning-repo-rhel7-1.0.0-1.x86_64.rpm
    sudo dnf install libcudnn7 libcudnn7-dev

Legacy NVIDIA 340xx/CUDA 6.5

This repository contains a legacy version of CUDA 6.5 that will works with the NVIDIA 340xx serie

Please use the Official link: https://developer.nvidia.com/cuda-toolkit-65

  • RHEL/CentOS 6

    sudo yum install http://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/cuda-repo-rhel6-6.5-14.x86_64.rpm
    sudo yum install cuda
  • Fedora 20 (and later)

    sudo yum install install http://developer.download.nvidia.com/compute/cuda/repos/fedora20/x86_64/cuda-repo-fedora20-6.5-14.x86_64.rpm
    sudo yum install cuda

Please verify to have a compatible compiler.

Known issues

GCC version

When using a later version of Fedora than what is supported by the NVIDIA CUDA Official repository, you might be unable to compile. You can either:

sudo dnf install http://centos.mirrors.ovh.net/ftp.centos.org/7/extras/x86_64/Packages/centos-release-scl-rh-2-2.el7.centos.noarch.rpm
sudo dnf install http://centos.mirrors.ovh.net/ftp.centos.org/7/updates/x86_64/Packages/libgfortran4-7.2.1-1.2.1.el7_5.x86_64.rpm
sudo dnf install devtoolset-7-toolchain

You cannot install the whole devtoolset-7 collection, but the toolchain is enough , then each time you need to build using cuda, you start by

scl run devtoolset-7 bash
gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
exit
gcc --version
gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Which driver Package

Both "CUDA" and "RPM Fusion" repositories provide the nvidia driver packages. Usually, the package provided by RPM Fusion is higher. But in case you want to avoid the risk, add this:

#/etc/yum.repos.d/cuda.repo
[cuda]
name=cuda
...
exclude=akmod-nvidia*,kmod-nvidia*,*nvidia*,nvidia-*,cuda-nvidia-kmod-common,dkms-nvidia,nvidia-libXNVCtrl

NVIDIA provided libOpenCL

NVIDIA only advertise OpenCL 1.2 with the binary driver at this time. As a consequence, they provide an old version of libOpenCL.so.1 which works fine with their binary driver. As most software in Fedora and RPM Fusion are built using a newer libOpenCL, the system linker detects that and issues the following message:

 /usr/local/cuda-9.2/targets/x86_64-linux/lib/libOpenCL.so.1: no version information available (required by ffmpeg)

You can either ignore the message or manually delete the libOpenCL.so.1 provided by NVIDIA (run sudo ldconfig once deleted). Please verify to not have other OpenCL providers that might interfere with NVIDIA OpenCL usage. (looking at /etc/OpenCL/vendors ).

Running blender

Even when only running blender, you need a CUDA compatible compiler as described above. This is because blender will compile the "CUDA Kernels" optimized for your own GPU. You can run blender with:

 scl run devtoolset-7 blender

Once the "CUDA kernels" are compiled, you can run blender normally

References


CategoryHowto

Howto/CUDA (last edited 2024-10-15 07:26:21 by NicolasChauvet)