Ubuntu18.04LTS quickly build CUDA environment

For the driver installation of NVIDIA graphics card, please refer to old text. After installing the driver, only one instruction is needed to complete the cuda environment setup.

sudo apt install nvidia-cuda-toolkit

The size is about 2G, which is equivalent to the size of the installation package downloaded from the official website. Then use nvcc -V to check and find that the latest CUDA10.0 is not installed, but CUDA9.1 is installed. The operating system is Ubuntu18.04LTS.

CUDA version

Then use the following code to test:

# include <stdio.h>

__ global__ voidhelloFromGPU(){printf("Hello, world! from GPU!\n");}

int main(){printf("Hello, world! from CPU!\n");

  helloFromGPU <<<2,10>>>();cudaDeviceReset();return0;}

Use nvcc HWGPU.cu -o HWGPU.o command to compile, the running result is as follows:

operation result

Recommended Posts

Ubuntu18.04LTS quickly build CUDA environment
Docker learning 2- quickly build a centos7-python3.6 environment
CentOS6.7 build LNMP environment
Centos7.6 build LNMP environment
CentOS 7 build LNMP environment
Build docker environment under Centos6.5
ubuntu build python development environment
Ubuntu 18.04.1 build Java environment and HelloWorld
Ubuntu16.04 build php5.6 Web server environment
Build Nginx environment on Linux (CentOS)