Linux general questions and answer

cayoenrique

Member
Messages
475
This question is about GPGPU using Opencl https://www.sat-universe.com/index.php?threads/gpgpu-using-opencl.319462/post-2037234959

@Me2019H ask
------------------------------------------------------------------------------------------------
Hello,

It did't work
Code:
root@live:~/Crypto/opencl_samples/add_numbers# ls
add_numbers.c add_numbers.cbp add_numbers.cl main.c Makefile README.md
root@live:~/Crypto/opencl_samples/add_numbers# make
make: Warning: File 'add_numbers.c' has modification time 4458 s in the future
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c -lOpenCL
add_numbers.c:18:10: fatal error: CL/cl.h: No such file or directory
#include <CL/cl.h>
^~~~~~~~~
compilation terminated.
make: *** [Makefile:55: add_numbers] Error 1
root@live:~/Crypto/opencl_samples/add_numbers# clinfo
Number of platforms 0
root@live:~/Crypto/opencl_samples/add_numbers#

the same error in th second example (clinfo)

please explain the code to us
------------------------------------------------------------------------------------------------
 

cayoenrique

Member
Messages
475
It seems you want to use make file, instead of the Codeblocks project ( *.cbp )

This is a very general answer of the problem.
"makefile' work most of the time if the stuff necessary was installed correctly and in a standard mode.
But some time includes or libraries are not in the path. This means you need to learn to modify makefile
in order for it to pick where the stuff are located.

Now lets start getting on the issue in detail.

No very important but good to know.
1) What PC are you using, I assume the same you told me.
2) What Linux OS are you using?

Important:
How did you install OpenLinux. You could had use nvidia stuff or general mesa isntalation.

I will assume Mesa

This is a working folder for us to work:
Code:
# > mkdir -p ~/Apps/home/cryptodir/opencl

gcc make and other bulid packages
Code:
# > sudo apt update
# > sudo apt install build-essential
# > gcc -v
 
Last edited:

cayoenrique

Member
Messages
475
Mesa OpenCL stuff
Code:
# > sudo apt install opencl-c-headers ocl-icd-opencl-dev ocl-icd-libopencl1 \
mesa-opencl-icd firmware-linux clinfo

Codeblocks
Code:
# > sudo apt install codeblocks

Settings in Codeblocks

Lest setup compiler by copying existing [GNU GCC Compiler] and create a new
[OpenCl_MSYS2]
Restart codeblocks, at the top in the menu bar select in sequence
[Menu]> Setting> Compiler>
Select compiler = GNU GCC Compiler [Copy] rename to "OpenCl_MSYS2"

For this look at page 10 and 12 of 04_Installing_Codeblocks.pdf
Code:
[Menu]> Setting> Compiler> Compiler settings> Other compiler options
-fopenmp
-std=gnu11

[Menu]> Setting> Compiler> Linker Settings > Other linker options
-lgomp
-lOpenCL

I know why called "OpenCl_MSYS2". because in that way you are going to have same info as Windows guys.
The name of the compiler is unimportant.
 
Last edited:

cayoenrique

Member
Messages
475
@Me2019H

Now try again make. let me know what happened.

Listen I need to create a Busterdog environment that I can do all this. As mine is already setup with AMD stuff.
Give me some time. Then I can answer with direct answers
 
Last edited:

Me2019H

Registered
Messages
101
hello,
No very important but good to know.
1) What PC are you using, I assume the same you told me.
2) What Linux OS are you using?
i use laptop dell CPU i5 i gve you all informations
BusterDog

when i installed Mesa it is working now in any folder

# > sudo apt install opencl-c-headers ocl-icd-opencl-dev ocl-icd-libopencl1 \
mesa-opencl-icd firmware-linux clinfo

this is the first program ''clinfo'

root@live:~/New/opencl_samples/simleb.clinfo-master# make
cc -Wall -O3 -std=c99 -o clinfo clinfo.c -lOpenCL -lm
clinfo.c: In function ‘main’:
clinfo.c:38:15: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘cl_uint’ {aka ‘unsigned int’} [-Wformat=]
#define BOLD ""
^~
clinfo.c:595:8: note: in expansion of macro ‘BOLD’
printf(BOLD " Total num_devices \t\t\t%" PRIu64 "\n" NORMAL, num_devices);
^~~~
In file included from clinfo.c:21:
/usr/include/inttypes.h:105:34: note: format string is defined here
# define PRIu64 __PRI64_PREFIX "u"
clinfo.c: In function ‘printStringValue’:
clinfo.c:719:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘void *’ [-Wformat=]
printf("%s\n", value);
~^ ~~~~~
%p
clinfo.c: In function ‘printUlong’:
clinfo.c:773:22: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘cl_ulong’ {aka ‘const long unsigned int’} [-Wformat=]
sprintf(buffer, "%llu", num);
~~~^ ~~~
%lu
root@live:~/New/opencl_samples/simleb.clinfo-master# clinfo
Number of platforms 1
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 Mesa 18.3.6
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA

Platform Name Clover
Number of devices 1
Device Name NVD7
Device Vendor NVIDIA
Device Vendor ID 0x10de
Device Version OpenCL 1.1 Mesa 18.3.6
Driver Version 18.3.6
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Max compute units 2
Max clock frequency 512MHz
Max work item dimensions 3
Max work item sizes 1024x1024x64
Max work group size 1024
=== CL_PROGRAM_BUILD_LOG ===
invalid source Preferred work group size multiple <getWGsizes:1200: create kernel : error -46>
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 0 (n/a)
float 4 / 4
double 2 / 2 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (cl_khr_fp64)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Address bits 64, Little-Endian
Global memory size 1099511627776 (1024GiB)
Error Correction support No
Max memory allocation 1099511627776 (1024GiB)
Unified memory for Host and Device No
Minimum alignment for any data type 128 bytes
Alignment of base address 32768 bits (4096 bytes)
Global Memory cache type None
Image support No
Local memory type Local
Local memory size 49152 (48KiB)
Max number of constant args 15
Max constant buffer size 65536 (64KiB)
Max size of kernel argument 4096 (4KiB)
Queue properties
Out-of-order execution No
Profiling Yes
Profiling timer resolution 0ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Device Extensions cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Clover
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [MESA]
clCreateContext(NULL, ...) [default] Success [MESA]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
Platform Name Clover
Device Name NVD7
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Clover
Device Name NVD7
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Clover
Device Name NVD7

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.12
ICD loader Profile OpenCL 2.2
root@live:~/New/opencl_samples/simleb.clinfo-master#
but the 2nd "add numbers" nothing happened

root@live:~# cd New
root@live:~/New# cd opencl_samples
root@live:~/New/opencl_samples# ls
add_numbers simleb.clinfo-master
root@live:~/New/opencl_samples# cd add_numbers
root@live:~/New/opencl_samples/add_numbers# make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c -lOpenCL
root@live:~/New/opencl_samples/add_numbers# ls
add_numbers add_numbers.c add_numbers.cbp add_numbers.cl main.c Makefile README.md
root@live:~/New/opencl_samples/add_numbers# add_numbers
bash: add_numbers: command not found
root@live:~/New/opencl_samples/add_numbers# ./add_numbers
invalid source

it's late, tomorrow i will try Codeblocks
Good night
 

cayoenrique

Member
Messages
475
So then I will assume you have wifi working. Yes I see you tomorow.

I have already set a new Busterdog OS without AMD stuff. Now I can follow my self the instructions I gave you and see your errors myself. I will try next. I let you know what I find. Most likely I miss something, from my head. It is not the same trying our-self than asking people to do what seems to be right, I know. Again I let you know my findings.

Then I may try to follow with low level instructions.
 

cayoenrique

Member
Messages
475
Ok I clean the samples to work on Linux without warnings and errors.

opencl_samples_linux.zip (66.62 KB)
Code:
https://workupload.com/file/gmMSHUvujdc

Interesting Codeblocks is version 16.01.
And mesa refuses to see my CPU as a valid device. I read a little ans seems they removed it because Intel refuses to help then under Linux!!
Weird as MSYS2-MESA-MINGW64 do show CPU as a Valid device.

Listen open a terminal in Home
Code:
cd ~
clinfo > clinfo_home.txt
cd ~/Apps/home/cryptodir/opencl/opencl_samples/simleb.clinfo-master
make
./clinfo -a > clinfo_simleb.txt
ls -la /etc/OpenCL/vendors >> clinfo_simleb.txt

tar both files clinfo_simleb.txt + clinfo_home.txt , upload and send me a PM.

I just wonder if what you have is working.

Now yes add_numbers results is just
Code:
enrique@live:$ cd ~/Apps/home/cryptodir/opencl/opencl_samples/add_numbers
enrique@live:$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c   -lOpenCL
enrique@live:$ ./add_numbers
Computed sum = 2016.0.
Check passed.
enrique@live:$

I did sent opencl kernel add_numbers.cl to the GPU. The result was read from GPU memory and compare with expected value. Then program print Check passed

do not worry we will explain how all works.


Finally click on project add_numbers.cbp, notice *.cbp and check if it opens in Codeblocks, now it should I remove windows EOL characters. The compile and execute inside Codeblocks.
Do the same for clinfo.cbp project. report if you have any problems.
 

cayoenrique

Member
Messages
475
I try to experiment and broke my OS. I will do it again.

@Me2019H
I miss a package in codeblock, is the one that hold all the nice plugins. So do

Code:
 apt install codeblocks-contrib

Close and restart codeblocks. Now when you click on any word it should high light all same words in same page.
If word has wrong spelling it should sugest correct, you still need to corect it manually.

That Spellcheck is what did not work on mine. So I start to experiment and I did broke OS.
In my case it is better to start all over again.

So If you install codeblocks-contrib, PLEASE report me if spellchecker works for you.
 

Me2019H

Registered
Messages
101
hell
Now yes add_numbers results is just
Code:
enrique@live:$ cd ~/Apps/home/cryptodir/opencl/opencl_samples/add_numbers
enrique@live:$ make
gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c   -lOpenCL
enrique@live:$ ./add_numbers
Computed sum = 2016.0.
Check passed.
enrique@live:$

It didn't work for me

root@live:~/Apps/home/cryptodir/opencl/opencl_samples/add_numbers# ./add_numbers
invalid source
root@live:~/Apps/home/cryptodir/opencl/opencl_samples/add_numbe

Invalid source
 

cayoenrique

Member
Messages
475
Lets start with Codeblock plugins. So the way to install FULL codeblocks will be
Code:
sudo apt install codeblocks codeblocks-contrib hunspell
This will install Linux Spell checker hunspell + the plugingns that are in codeblocks-contrib

Now if you leave it like that it will not run spellchecker. To repair do:
Code:
cd /usr/lib/x86_64-linux-gnu/
sudo ln -s libhunspell-1.7.so.0 libhunspell-1.6.so.0

Now try codeblocks and write in a page a spell error for example // inportat next line
Then inportant should show a red line under, if it work you over the word and it suggest a correct spelling.

Now in my case it did still failed So I have to add the englis spell dictionary manually
Code:
 mkdir -p ~/.config/codeblocks/SpellChecker
cp /usr/share/hunspell/en_US.* ~/.config/codeblocks/SpellChecker/

Restart Codeblocks and this time works.
 

cayoenrique

Member
Messages
475
The files you sent me show that mesa recognize your Dell GeForce 820M GPU.
Now we know querying the GPU for info works as clinfo.c did work.

Lets do one try to see if this time it compiles.

In codblocks edit add_numbers.c

At the very top I wrote:
Code:
//++EnriqueMod
#define CL_TARGET_OPENCL_VERSION 120
#define __OPENCL_VERSION__  120

I want you to change 120 for 110 in both of those lines.
110 means that your mesa detects your card as 1.1, Why because is the smallest of the reported values. See clinfo

Code:
Platform Version			OpenCL 1.1 Mesa 18.3.6
Device Version				OpenCL 1.1 Mesa 18.3.6
Device OpenCL C Version		OpenCL C 1.1 
ICD loader Profile			OpenCL 2.2

Try to compile again and run. Try inside codeblock, then try with make.

If it does not work. Why are going to forget this isue. The sample is not even good to begin with.

We will build our own in the other thread.
 

Me2019H

Registered
Messages
101
Spellcheck works fine

bbut the program did not work i tried with 100,110
Ok let us build our own project
 

cayoenrique

Member
Messages
475
after run with make

Code:
root@live:~/Apps/home/cryptodir/opencl/OCLBiss_002# ls
add_numbers.cl log.txt makefile OCLBiss.c OCLBiss.cbp_Linux OCLBiss.cbp_win OCLBiss.layout
root@live:~/Apps/home/cryptodir/opencl/OCLBiss_002# make
Detected OS = Linux
CFLAGS = -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110
INC_DIRS =
LIB_DIRS =
LIBS = -lgomp -lOpenCL
CC = gcc
STRIP = strip
RM = rm -f
RRM = rm -f r
srcfiles = ./OCLBiss.c
objects = ./OCLBiss.o
BIN = ./OCLBiss
make: Warning: File 'OCLBiss.c' has modification time 10663 s in the future
gcc -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110 -c ./OCLBiss.c -o ./OCLBiss.o
CC OCLBiss.c
g++ ./OCLBiss.o -lgomp -lOpenCL -o ./OCLBiss
strip ./OCLBiss
make: warning: Clock skew detected. Your build may be incomplete.
root@live:~/Apps/home/cryptodir/opencl/OCLBiss_002# ls
add_numbers.cl log.txt makefile OCLBiss OCLBiss.c OCLBiss.cbp_Linux OCLBiss.cbp_win OCLBiss.layout OCLBiss.o
root@live:~/Apps/home/cryptodir/opencl/OCLBiss_002# ./OCLBiss


Inspecting System for OpenCL devices...Platforms found: 1
00 NVIDIA NVD7 GPU


Today is Mon Aug 28 13:20:18 2023
Connected to device:NVIDIA => NVD7
invalid source
root@live:~/Apps/home/cryptodir/opencl/OCLBiss_002#

always invalid source But it didn't work in the codeblocks

dvlajkovic

How do you run it
 

cayoenrique

Member
Messages
475
Lets do things very descryptic to simplify in the future

Code:
sudo apt update
sudo apt install unzip
mkdir -p ~/bin

reboot PC to make sure ~/bin will be on your path

Code:
echo $PATH

Lets download
Code:
mkdir -p ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2
cd ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2
wget https://gist.githubusercontent.com/shawnli87/f226b4f0c7b2bef2e94477ccef00b0c8/raw/ba920c8a4bd2425ca4d4a8d67a1a78b9e6f45a0b/workupload_download.sh
sudo chown $USER:$USER workupload_download.sh
chmod +x workupload_download.sh
mv workupload_download.sh ~/bin/wudget
wudget https://workupload.com/file/ejrEvqqCm68
ls -la

So now we have a Linux tool name wudget capable of downloading from workupload. Lets try it. This is what I get

Code:
enrique@live:$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/bin:/home/enrique/bin
enrique@live:$ wget https://gist.githubusercontent.com/shawnli87/f226b4f0c7b2bef2e94477ccef00b0c8/raw/ba920c8a4bd2425ca4d4a8d67a1a78b9e6f45a0b/workupload_download.sh
--2023-08-29 01:47:53--  https://gist.githubusercontent.com/shawnli87/f226b4f0c7b2bef2e94477ccef00b0c8/raw/ba920c8a4bd2425ca4d4a8d67a1a78b9e6f45a0b/workupload_download.sh
Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 958 [text/plain]
Saving to: ‘workupload_download.sh’

workupload_download.sh           100%[========================================================>]     958  --.-KB/s    in 0s      

2023-08-29 01:47:54 (19.7 MB/s) - ‘workupload_download.sh’ saved [958/958]

enrique@live:$ sudo chown $USER:$USER workupload_download.sh
enrique@live:$ chmod +x workupload_download.sh
enrique@live:$ mv workupload_download.sh ~/bin/wudget
enrique@live:$ wudget https://workupload.com/file/ejrEvqqCm68
Getting token from workupload servers
Getting download url from workupload servers
Starting to download the actual file
Download finished. Have a happy day :)
enrique@live:$ ls -la
total 16
drwxr-xr-x 2 enrique enrique 4096 Aug 29 01:48 .
drwxr-xr-x 3 enrique enrique 4096 Aug 29 01:39 ..
-rw-r--r-- 1 enrique enrique 7510 Aug 29 01:48 OCLBiss_002.zip
enrique@live:$

Now lets work with the sample

Code:
unzip OCLBiss_002.zip
sudo chown -R $USER:$USER OCLBiss_002
cd OCLBiss_002
ls -la

My results
Code:
enrique@live:$ unzip OCLBiss_002.zip
Archive:  OCLBiss_002.zip
   creating: OCLBiss_002/
  inflating: OCLBiss_002/add_numbers.cl  
  inflating: OCLBiss_002/log.txt     
  inflating: OCLBiss_002/makefile    
  inflating: OCLBiss_002/OCLBiss.c   
  inflating: OCLBiss_002/OCLBiss.cbp_Linux  
  inflating: OCLBiss_002/OCLBiss.cbp_win  
  inflating: OCLBiss_002/OCLBiss.layout  
enrique@live:$ sudo chown -R $USER:$USER OCLBiss_002
enrique@live:$ cd OCLBiss_002
enrique@live:$ ls -la
total 48
drwxrwxrwx 2 enrique enrique  4096 Aug 28 11:17 .
drwxr-xr-x 3 enrique enrique  4096 Aug 29 01:57 ..
-rwxrwxrwx 1 enrique enrique  1847 Aug 25 15:30 add_numbers.cl
-rwxrwxrwx 1 enrique enrique   254 Aug 28 11:17 log.txt
-rwxrwxrwx 1 enrique enrique  2940 Aug 27 14:45 makefile
-rwxrwxrwx 1 enrique enrique 13204 Aug 28 11:16 OCLBiss.c
-rwxrwxrwx 1 enrique enrique  1115 Aug 28 11:10 OCLBiss.cbp_Linux
-rwxrwxrwx 1 enrique enrique  1148 Aug 28 10:59 OCLBiss.cbp_win
-rwxrwxrwx 1 enrique enrique   362 Aug 28 11:16 OCLBiss.layout
 
Last edited:

cayoenrique

Member
Messages
475
Lets make and run
Code:
make
./OCLBiss

My reuslts
Code:
enrique@live:$ make
Detected OS = Linux
CFLAGS = -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110 
INC_DIRS = 
LIB_DIRS = 
LIBS = -lgomp -lOpenCL
CC = gcc
STRIP = strip
RM = rm -f
RRM = rm -f r
srcfiles = ./OCLBiss.c
objects =  ./OCLBiss.o
BIN =  ./OCLBiss
gcc -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110  -c ./OCLBiss.c -o  ./OCLBiss.o 
CC	OCLBiss.c
g++   ./OCLBiss.o   -lgomp -lOpenCL  -o  ./OCLBiss
strip  ./OCLBiss
enrique@live:$ ./OCLBiss


Inspecting System for OpenCL devices...Platforms found: 1
00                                                AMD AMD TURKS (DRM 2.50.0 / 4.19.0-6-amd64, LLVM 7.0.1)     GPU


Today is Tue Aug 29 02:47:32 2023
Connected to device:AMD => AMD TURKS (DRM 2.50.0 / 4.19.0-6-amd64, LLVM 7.0.1)

Device Kernel properties:
	number of cores: 				6
	recommended work group size (local threads): 	64
	max work group size:				256

Leaving now OCLBiss
enrique@live:$
 

Me2019H

Registered
Messages
101
I did what you ask me to do but the Wudget commant did not work

root@live:~# mkdir -p ~/bin
root@live:~# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/bin:/usr/local/sbin:/usr/sbin:/sbin
root@live:~# mkdir -p ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2
root@live:~# cd ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# wget https://gist.githubusercontent.com/...d4a8d67a1a78b9e6f45a0b/workupload_download.sh
--2023-08-28 21:21:30-- https://gist.githubusercontent.com/...d4a8d67a1a78b9e6f45a0b/workupload_download.sh
Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 958 [text/plain]
Saving to: ‘workupload_download.sh’

workupload_download 100%[===================>] 958 --.-KB/s in 0s

2023-08-28 21:21:31 (9.82 MB/s) - ‘workupload_download.sh’ saved [958/958]

I can download from workupload from the browser and downlad file
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# sudo chown $USER:$USER workupload_download.sh
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# chmod +x workupload_download.sh
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# mv workupload_download.sh ~/bin/wudget
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# wudget https://workupload.com/file/ejrEvqqCm68
bash: wudget: command not found
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2#
 

Me2019H

Registered
Messages
101
I downloaded the file with the browsser and i putted it in the right folder and this is the result it's the same:(

root@live:~# cd ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# unzip OCLBiss_002.zip
Archive: OCLBiss_002.zip
creating: OCLBiss_002/
inflating: OCLBiss_002/add_numbers.cl
inflating: OCLBiss_002/log.txt
inflating: OCLBiss_002/makefile
inflating: OCLBiss_002/OCLBiss.c
inflating: OCLBiss_002/OCLBiss.cbp_Linux
inflating: OCLBiss_002/OCLBiss.cbp_win
inflating: OCLBiss_002/OCLBiss.layout
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# sudo chown -R $USER:$USER OCLBiss_002
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2# cd OCLBiss_002
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2/OCLBiss_002# ls -la
total 48
drwxrwxrwx 2 root root 4096 Aug 28 16:17 .
drwxr-xr-x 3 root root 4096 Aug 28 22:25 ..
-rwxrwxrwx 1 root root 1847 Aug 25 20:30 add_numbers.cl
-rwxrwxrwx 1 root root 254 Aug 28 16:17 log.txt
-rwxrwxrwx 1 root root 2940 Aug 27 19:45 makefile
-rwxrwxrwx 1 root root 13204 Aug 28 16:16 OCLBiss.c
-rwxrwxrwx 1 root root 1115 Aug 28 16:10 OCLBiss.cbp_Linux
-rwxrwxrwx 1 root root 1148 Aug 28 15:59 OCLBiss.cbp_win
-rwxrwxrwx 1 root root 362 Aug 28 16:16 OCLBiss.layout
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2/OCLBiss_002# make
Detected OS = Linux
CFLAGS = -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110
INC_DIRS =
LIB_DIRS =
LIBS = -lgomp -lOpenCL
CC = gcc
STRIP = strip
RM = rm -f
RRM = rm -f r
srcfiles = ./OCLBiss.c
objects = ./OCLBiss.o
BIN = ./OCLBiss
gcc -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110 -c ./OCLBiss.c -o ./OCLBiss.o
CC OCLBiss.c
g++ ./OCLBiss.o -lgomp -lOpenCL -o ./OCLBiss
strip ./OCLBiss
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2/OCLBiss_002# ./OCLBiss


Inspecting System for OpenCL devices...Platforms found: 1
00 NVIDIA NVD7 GPU


Today is Mon Aug 28 22:28:44 2023
Connected to device:NVIDIA => NVD7
invalid source
root@live:~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_002_test2/OCLBiss_002#
 

cayoenrique

Member
Messages
475
Code:
bash: wudget: command not found

This error was because you did not reboot. After reboot DogBuster will recognize that you have a ~\bin. This will be now in your $PATH.

Next time after reboot it will work ok.


About invalid source

invalid source is not part of my code. Now I suspect is from creating program.


This is what we are going to do.
Try this addnumbers 1rst while I create a printabel step by step of my program.

add_numbers_l03.zip (6.16 KB)
Code:
https://workupload.com/file/vXpCGNZvfRL


Reboot the PC if you have not rebooted.

Code:
mkdir -p ~/Apps/home/cryptodir/opencl/OCLBiss/opencl_samples_test3
cd ~/Apps/home/cryptodir/opencl/OCLBiss/opencl_samples_test3
wudget https://workupload.com/file/vXpCGNZvfRL
unzip add_numbers_l03.zip
cd add_numbers_l03
ls -la
make
./add_numbers


My results
Code:
enrique@live:$ wudget https://workupload.com/file/vXpCGNZvfRL
Getting token from workupload servers
Getting download url from workupload servers
Starting to download the actual file
Download finished. Have a happy day :)
enrique@live:$ unzip add_numbers_l03.zip
Archive:  add_numbers_l03.zip
   creating: add_numbers_l03/
  inflating: add_numbers_l03/add_numbers.cbp  
  inflating: add_numbers_l03/add_numbers.cl  
  inflating: add_numbers_l03/add_numbers.layout  
  inflating: add_numbers_l03/makefile  
  inflating: add_numbers_l03/add_numbers.c  
enrique@live:$ cd add_numbers_l03
enrique@live:$ ls -la
total 36
drwxr-xr-x 2 enrique enrique 4096 Aug 29 07:07 .
drwxr-xr-x 3 enrique enrique 4096 Aug 29 07:14 ..
-rw-r--r-- 1 enrique enrique 8282 Aug 29 07:01 add_numbers.c
-rw-r--r-- 1 enrique enrique 1193 Aug 25 15:30 add_numbers.cbp
-rw-r--r-- 1 enrique enrique 1847 Aug 25 15:30 add_numbers.cl
-rw-r--r-- 1 enrique enrique  178 Aug 27 14:07 add_numbers.layout
-rwxrwxrwx 1 enrique enrique 2940 Aug 27 14:45 makefile
enrique@live:$ make
Detected OS = Linux
CFLAGS = -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110 
INC_DIRS = 
LIB_DIRS = 
LIBS = -lgomp -lOpenCL
CC = gcc
STRIP = strip
RM = rm -f
RRM = rm -f r
srcfiles = ./add_numbers.c
objects =  ./add_numbers.o
BIN =  ./add_numbers
gcc -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110  -c ./add_numbers.c -o  ./add_numbers.o 
CC	add_numbers.c
g++   ./add_numbers.o   -lgomp -lOpenCL  -o  ./add_numbers
strip  ./add_numbers
enrique@live:$ ./add_numbers
Computed sum = 2016.0.
Check passed.
enrique@live:$
 

cayoenrique

Member
Messages
475
This is with prints. Just tell me last one you see or print here the output
OCLBiss_004Print.zip (9.81 KB)
Code:
https://workupload.com/file/jsUKG6AdcP3[code]


Lets download
[code]mkdir -p ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_004Print_test4
cd ~/Apps/home/cryptodir/opencl/OCLBiss/OCLBiss_004Print_test4
wudget https://workupload.com/file/jsUKG6AdcP3
unzip OCLBiss_004Print.zip
cd OCLBiss_004Print
make
./OCLBiss

myresults

Code:
enrique@live:$ wudget https://workupload.com/file/jsUKG6AdcP3
Getting token from workupload servers
Getting download url from workupload servers
Starting to download the actual file
Download finished. Have a happy day :)
enrique@live:$ unzip OCLBiss_004Print.zip
Archive:  OCLBiss_004Print.zip
   creating: OCLBiss_004Print/
  inflating: OCLBiss_004Print/OCLBiss.layout  
  inflating: OCLBiss_004Print/OCLBiss.cbp  
  inflating: OCLBiss_004Print/add_numbers.cl  
  inflating: OCLBiss_004Print/OCLB_toolbox.h  
  inflating: OCLBiss_004Print/OCLB_toolbox.c  
  inflating: OCLBiss_004Print/makefile  
  inflating: OCLBiss_004Print/OCLBiss.c  
  inflating: OCLBiss_004Print/OCLBiss.cfg  
enrique@live:$ cd OCLBiss_004Print
enrique@live:$ make
Detected OS = Linux
CFLAGS = -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110 
INC_DIRS = 
LIB_DIRS = 
LIBS = -lgomp -lOpenCL
CC = gcc
STRIP = strip
RM = rm -f
RRM = rm -f r
srcfiles = OCLBiss.c OCLB_toolbox.c
objects = OCLBiss.o OCLB_toolbox.o
BIN = OCLBiss
gcc -Wall -g -fopenmp -std=gnu11 -DCL_TARGET_OPENCL_VERSION=110 -D__OPENCL_VERSION__=110  -c OCLBiss.c OCLB_toolbox.c
CC	OCLBiss.c
g++  OCLBiss.o OCLB_toolbox.o   -lgomp -lOpenCL  -o OCLBiss
strip OCLBiss
enrique@live:$
 
Top