Home >Operation and Maintenance >Docker >Can docker install cuda?

Can docker install cuda?

WBOY
WBOYOriginal
2022-07-22 16:00:265330browse

cuda can be installed in docker; upload the downloaded software package to the specified directory and execute "sudo sh cuda_downloaded version_linux.run" to install it. cuda is the operation exited by the graphics card manufacturer NVIDIA Platform, after the installation is complete, you can use "nvidia-smi" to view the installed cuda version.

Can docker install cuda?

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

docker can install cuda

CUDA (Compute Unified Device Architecture) is a computing platform launched by graphics card manufacturer NVIDIA. CUDA is a general-purpose parallel computing architecture introduced by NVIDIA that enables GPUs to solve complex computing problems. It includes the CUDA instruction set architecture (ISA) and the parallel computing engine inside the GPU. Developers can use C language to write programs for the CUDA™ architecture, and the written programs can run at ultra-high performance on CUDA™-enabled processors. CUDA3.0 has begun to support C and FORTRAN.

The example is as follows:

Installing cuda under docker_Ubuntu16.04

(1) Download the installation file. First go to NVIDIA official website to download the cuda installation package: https://developer.nvidia.com/cuda-toolkit-archive

Can docker install cuda?

(2) Update the system driver

System Settings - Software and Updates - Additional Drivers - Update nvidia and intel

If there is a problem of looping into the system when updating the driver, please uninstall the driver first, and then use the installation method with the driver to solve the problem (panacea ).

How to uninstall the driver at this time: Since the graphical user interface (GUI) cannot be entered after logging in, we can enter the text user interface (TUI). In the login interface state, press Ctrl Alt f1 to enter the TUI Execute

sudo /usr/bin/nvidia-uninstall

and then restart

sudo reboot

(3) cuda installation

After uploading the downloaded software package to the directory you defined, execute the following command

sudo sh cuda_9.0.176_384.81_linux.run

Then Use the corner of a book to hold down the Enter key until the Terms of Service display reaches 100%. Then follow the steps below to select

  • Accept

  •  n (Do not install the driver)

  •  y

  • y

  • failed--compilation aborted at ./cuda-installer.pl line 5
Solution: as follows

sudo apt install freeglut3-dev build-essential libx11-dev libxmu-dev 
libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev

(4) Set environment variables

Open the main Add the following path to the .bashrc file in the directory. For example, my .bashrc file is under /home/wangyuanwei. If it is not found, press the Ctrl H key to display the hidden file.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PATH=$PATH:/usr/local/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0
    然后在终端运行:
cat /usr/local/cuda/version.txt

                                           

Recommended learning: «

docker Video Tutorial

»

The above is the detailed content of Can docker install cuda?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn