Showing posts with label Cuda. Show all posts
Showing posts with label Cuda. Show all posts

Saturday, March 12, 2022

Linux Libraries path

#Cuda 8.0 Settings
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}


#Cuda 9.1 Settings
export CUDA_HOME=/usr/local/cuda-9.1
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}


#Cuda 9.2 Settings
export CUDA_HOME=/usr/local/cuda-9.2
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}

 

$ LD_LIBRARY_PATH=. ./programtest  #direct execution
 

$ echo $LD_LIBRARY_PATH  
/usr/local/cuda-8.0/lib64
 

$ ls /etc/ld.so.conf.d
cuda-8-0.conf                   opencv.conf
fakeroot-x86_64-linux-gnu.conf  x86_64-linux-gnu.conf
glew.conf                       x86_64-linux-gnu_EGL.conf
i386-linux-gnu.conf             x86_64-linux-gnu_GL.conf
libc.conf                       zz_i386-biarch-compat.conf

$ldconfig -p  #list libraries

$sudo ldconfig #update paths

 

 


 

Thursday, August 19, 2021

OpenGL in Cuda Study

Starting

[1] https://www.geeksforgeeks.org/getting-started-with-opengl/

 


1) http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/

2) https://math.hws.edu/graphicsbook/c3/s4.html

 

 

Monday, March 15, 2021

Cuda on Linux18 (y2021)

After installation don't forget it(.bashrc):

#Cuda 8.0 Settings
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64  
PATH=${CUDA_HOME}/bin:${PATH}
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:

 

Drivers

[1] Legacy https://www.nvidia.com/en-us/drivers/unix/

To Review (Cuda and Driver)

CUDA 11.2             >= 450.80.02
CUDA 11.1 (11.1.0)     >= 450.80.02
CUDA 11.0 (11.0.3)     >= 450.36.06
CUDA 10.2 (10.2.89)     >= 440.33
CUDA 10.1 (10.1.105)     >= 418.39
CUDA 10.0 (10.0.130)     >= 410.48
CUDA 9.2 (9.2.88)     >= 396.26
CUDA 9.1 (9.1.85)     >= 390.46
CUDA 9.0 (9.0.76)     >= 384.81
CUDA 8.0 (8.0.61 GA2)     >= 375.26
CUDA 8.0 (8.0.44)     >= 367.48
CUDA 7.5 (7.5.16)     >= 352.31
CUDA 7.0 (7.0.28)     >= 346.46

[1] Compatibility  https://docs.nvidia.com/deploy/cuda-compatibility/index.html 

To Review (Cuda and GCC)

CUDA version     Max GCC version
11.1             10.0
11                9
10.1, 10.2    8
9.2, 10.0      7
9.0, 9.1        6
8                  5.3
7                  4.9
5.5, 6           4.8
4.2, 5           4.6
4.1               4.5
4.0               4.4

Cuda Toolkit from 6.5 to 10 and more

[1] https://developer.nvidia.com/cuda-toolkit-archive

Common problems

[1] Can't locate InstallUtils.pm in @INC

$sh ./cuda(your version).run --tar mxvf #for unpack

$cp InstallUtils.pm /usr/lib/x86_64-linux-gnu/perl-base #check path in error message

[2] Messages during Cuda installation

$sudo ./cuda_6.5.14_linux_64.run --override

$sudo ./cuda_xxx.run --override  #to ignore last compiler or related

#During Cuda 6.5

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 340.29?

#During Cuda 8

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?

#During Cuda 9

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?

[3] Adicional  notes

https://forums.dual.sphysics.org/discussion/1324/get-the-gpu-running


[4] How to disable nouveau driver to install NVIDIA drivers

$vi /etc/modprobe.d/blacklist-nvidia-nouveau.conf
blacklist nouveau
options nouveau modeset=0
$sudo update-initramfs -u 
$sudo reboot 

 

 

Tuesday, February 11, 2020

pycuda

pycuda error: src/cpp/cuda.cpp: No existe el archivo o el directorio

export PATH=/usr/local/cuda-10.2/bin:$PATH

Resources:
[1] Source https://github.com/inducer/pycuda (see too pyOpenCL)

[2] Documentation https://documen.tician.de/pycuda/tutorial.html

Friday, January 31, 2020

Ubuntu 18 Cuda 10 under NVidia Geforce 710 2GB






wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin 
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 
wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub 
sudo apt-get update 
sudo apt-get -y install cuda

Thursday, November 21, 2019

Linux System Information



Find if your Linux is 64 bit is by using:

$getconf LONG_BIT

`uname -m` tells only about the kernel, the userspace and distro can be still 32-bit. Similarly `lscpu` only tells what the CPU is capable of, not if OS, kernel and distro are 32 or 64 bit.
 
 
$file /lib/systemd/systemd
$lscpu
$uname -i
$uname -m 
$dpkg --print-architecture
 

Tuesday, November 19, 2019

cuda 8.0 compile related


Compile cuda-z

    https://sourceforge.net/p/cuda-z/code/HEAD/tree/trunk/


Cuda 8.0 and Qt5


$qmake file.pro

$make


1) Error fPIC

error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."

 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\


#sol, add next parameter in Makefile


$nvcc -shared -Xcompiler -fPIC

2) Compile error , comment CZ_VER_BUILD block

3) Error link stage

bld/o/czdialog.o: In function `CZDialog::getCudaDeviceNumber()':

czdialog.cpp:(.text+0x421): undefined reference to `CZCudaDeviceFound'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::prepareDevice()':

czdeviceinfo.cpp:(.text+0x569): undefined reference to `CZCudaCalcDeviceSelect'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::updateInfo()':

czdeviceinfo.cpp:(.text+0x5c5): undefined reference to `CZCudaCalcDeviceBandwidth'

czdeviceinfo.cpp:(.text+0x5d2): undefined reference to `CZCudaCalcDevicePerformance'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::readInfo()':

czdeviceinfo.cpp:(.text+0x448): undefined reference to `CZCudaReadDeviceInfo'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::prepareDevice()':

czdeviceinfo.cpp:(.text+0x585): undefined reference to `CZCudaPrepareDevice'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::cleanDevice()':

czdeviceinfo.cpp:(.text+0x615): undefined reference to `CZCudaCleanDevice'

bld/o/czcommandline.o: In function `CZCommandLine::printDeviceList()':

czcommandline.cpp:(.text+0x45b5): undefined reference to `CZCudaDeviceFound'

czcommandline.cpp:(.text+0x46e8): undefined reference to `CZCudaReadDeviceInfo'

bld/o/czcommandline.o: In function `CZCommandLine::exec()':

czcommandline.cpp:(.text+0x4b16): undefined reference to `CZCudaDeviceFound'

czcommandline.cpp:(.text+0x4e2c): undefined reference to `CZCudaReadDeviceInfo'

czcommandline.cpp:(.text+0x4fbb): undefined reference to `CZCudaPrepareDevice'

czcommandline.cpp:(.text+0x4fd0): undefined reference to `CZCudaCalcDeviceBandwidth'

czcommandline.cpp:(.text+0x52fe): undefined reference to `CZCudaCalcDevicePerformance'

czcommandline.cpp:(.text+0x561f): undefined reference to `CZCudaCleanDevice'

bld/o/main.o: In function `testCudaPresent()':

main.cpp:(.text+0x2): undefined reference to `CZCudaCheck'

bld/o/main.o: In function `getCudaDeviceNum()':

main.cpp:(.text+0x4c): undefined reference to `CZCudaDeviceFound'

main.cpp:(.text+0x96): undefined reference to `CZCudaReadDeviceInfo'


#sol, change order of object files


$ g++ -m64 -Wl,-O1 -o bin/cuda-z bld/o/main.o bld/o/cudainfo.o bld/o/czdialog.o bld/o/czdeviceinfo.o bld/o/czdeviceinfodecoder.o bld/o/czcommandline.o bld/o/log.o bld/o/platform.o bld/o/qrc_cuda-z.o bld/o/moc_czdialog.o bld/o/moc_czdeviceinfo.o bld/o/moc_czdeviceinfodecoder.o bld/o/moc_czcommandline.o   -L /usr/local/cuda/lib64 -L/usr/X11R6/lib64 -lcudart_static -ldl -lm -lrt -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread

4) Execution error
./cuda-z: error while loading shared libraries: bld/o/cudainfo.o: cannot open shared object file: No such file or directory


#sol, move from bin to ..

$./cuda-z


Firefox open multiple private window

    /opt/firefox/firefox-bin --profile $(mktemp -d) --private-window www.google.com www.bing.com