Skip to content

A project to start a simple starting project with CUDA

Notifications You must be signed in to change notification settings

AliGriv/cuda-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cuda-start

A project to start a simple starting project with CUDA

CUDA Installation

My operating system is Ubuntu 16.04 and the Kernel Release is 4.15.0-120-generic. The command is:

uname -a

The steps for installation was taken from DIX SOFT tutorial and I installed CUDA-8.0. I'm using CLion and my next problem was similar to this thread. One solution was to add /usr/local/cuda-/bin to PATH in the /etc/environment configuration file. After googling this issue, a similar dicussion was found here. The problem is how to change and add the path for all users in /etc/environment. The steps that I went through was:

  1. Copy the current file for backup. sudo cp /etc/environment /etc/environment.orig
  2. Edit the existing file sudo nano -w /etc/environment Previously, the content was PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"$. It was changed to: PATH="/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games".

Another error that was encountered was about not being able to find the library directory. Similar to previous step, one solution would be adding the directory for CUDA in a way that all the users and environments have access, i.e. adding it the shared library of the system. This article was useful. The steps were as following:

  1. Create a new file in /etc/ld.so.conf.d/ called .conf sudo touch libcuda.conf
  2. Edit the file and add a line per directory of shared libraries (*.so files) sudo gedit libcuda.conf
  3. The following was added to the blank file and saved:
#cuda library
/usr/local/cuda-8.0/lib64
  1. Reload the list of system-wide library paths:
sudo ldconfig

Results

Up to now, it seems that cudaMalloc takes a lot of time. It is to allocate memory beforehand so that we do not include it in measuring the performance. After cudaMalloc, cudaMemcpy also takes some time which the unnecessary part can be avoided. Other than that, the program seems to be working after all!!

About

A project to start a simple starting project with CUDA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages