Arto's Notes re: CUDA


$ lsmod | fgrep nvidia

$ nvidia-smi

Driver Installation

Driver Installation on Alpine Linux

$ apk add sudo bash ca-certificates wget xz make gcc linux-headers

$ wget -q -O /etc/apk/keys/

$ wget
$ wget
$ wget
$ wget

$ apk add glibc-2.27-r0.apk glibc-bin-2.27-r0.apk glibc-dev-2.27-r0.apk glibc-i18n-2.27-r0.apk

$ /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8

$ bash --check

$ bash --extract-only

$ cd NVIDIA-Linux-x86_64-390.77 && ./nvidia-installer

Driver Uninstallation

$ nvidia-uninstall

Driver Troubleshooting

  1. Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 line 998: /tmp/makeself.XXX/xz: No such file or directory\nExtraction failed.

    $ apk add xz  # Alpine Linux
  2. bash: ./nvidia-installer: No such file or directory

    Install the glibc compatibility layer package for Alpine Linux.

  3. ERROR: You do not appear to have libc header files installed on your system. Please install your distribution's libc development package.

    $ apk add musl-dev  # Alpine Linux
  4. ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured

    $ apk add linux-vanilla-dev  # Alpine Linux
  5. ERROR: Failed to execute `/sbin/ldconfig`: The installer has encountered the following error during installation: 'Failed to execute `/sbin/ldconfig`'. Would you like to continue installation anyway?

    Continue installation.


Toolkit Download

$ wget -c

Toolkit Installation

Toolkit Installation on Alpine Linux

$ apk add sudo bash

$ sudo bash cuda_9.2.148_396.37_linux

# You are attempting to install on an unsupported configuration. Do you wish to continue? y
# Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 396.37? y
# Do you want to install the OpenGL libraries? y
# Do you want to run nvidia-xconfig? n
# Install the CUDA 9.2 Toolkit? y
# Enter Toolkit Location: /opt/cuda-9.2
# Do you want to install a symbolic link at /usr/local/cuda? y
# Install the CUDA 9.2 Samples? y
# Enter CUDA Samples Location: /opt/cuda-9.2/samples

$ sudo ln -s cuda-9.2 /opt/cuda

$ export PATH="/opt/cuda/bin:$PATH"

Toolkit Uninstallation

$ sudo /opt/cuda-9.2/bin/

Toolkit Troubleshooting

  1. Cannot find termcap: Can't find a valid termcap file at /usr/share/perl5/core_perl/Term/ line 377.

    $ export PERL_RL="Perl o=0"
  2. gcc: error trying to exec 'cc1plus': execvp: No such file or directory

    $ apk add g++  # Alpine Linux
  3. cicc: Relink `/usr/lib/' with `/usr/glibc-compat/lib/' for IFUNC symbol `memset'

    $ scp /lib/x86_64-linux-gnu/ root@alpine:/usr/glibc-compat/lib/
    $ sudo /usr/glibc-compat/sbin/ldconfig /usr/glibc-compat/lib /lib /usr/lib