I am using ATI RV770 graphics card, OpenCl 1.0 and ati-stream-sdk-v2.3-lnx64 on linux.
While running my host code which includes following two sections to build kernel program, i am getting error code (-11) i.e. cl_build_program_failure
. Does it means that kernel program compiled, if not then how is it compiled and debugged?
const char* KernelPath = "abc_kernel.cl"; //kernel program is in separate file but in same directory of host code..
/* Create Program object from the kernel source *******/
char* sProgramSource = readKernelSource(KernelPath);
size_t sourceSize = strlen(sProgramSource) ;
program = clCreateProgramWithSource(context, 1,(const char **) &sProgramSource,&sourceSize, &err);
checkStatus("error while creating program",err);
/* Build (compile & Link ) Program *******/
char* options = (char* )malloc(10*sizeof(char));
strcpy(options, "-g");
err = clBuildProgram(program, num_devices, devices_id, options, NULL, NULL);
checkStatus("Build Program Failed", err); //This line throwing the error....
function to read kernel program is as follows::
/* read program source file*/
char* readKernelSource(const char* kernelSourcePath){
FILE *fp = NULL;
size_t sourceLength;
char *sourceString ;
fp = fopen( kernelSourcePath , "r");
if(fp == 0)
{
printf("failed to open file");
return NULL;
}
// get the length of the source code
fseek(fp, 0, SEEK_END);
sourceLength = ftell(fp);
rewind(fp);
// allocate a buffer for the source code string and read it in
sourceString = (char *)malloc( sourceLength + 1);
if( fread( sourceString, 1, sourceLength, fp) !=sourceLength )
{
printf("nt Error : Fail to read file ");
return 0;
}
sourceString[sourceLength+1]='';
fclose(fp);
return sourceString;
}// end of readKernelSource
Can anyone tell how to fix it?
Does it means that it is OpenCl compilation error at runtime or something else?
//Printing build_log info using clGetProgramBuildInfo() as below, But why is is not printing anything?
char* build_log;
size_t log_size;
// First call to know the proper size
err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
build_log = (char* )malloc((log_size+1));
// Second call to get the log
err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL);
build_log[log_size] = '';
printf("--- Build log ---n ");
fprintf(stderr, "%sn", build_log);
free(build_log);
Describe the bug
ethminer fails to run on systems with amdgpu/mesa drivers
To Reproduce
Steps to reproduce the behavior:
- Download and extract binary from github releases
- ./bin/ethminer -G -M 123
Expected behavior
ethminer succesfully starts up, runs test and prints hashrate.
Screenshots (Optional)
$ ./bin/ethminer -G -M 123
ethminer 0.19.0-alpha.0
Build: linux/release/gnui 10:28:43 ethminer Selected pool localhost:0
i 10:28:43 ethminer Established connection to localhost:0
i 10:28:43 ethminer Spinning up miners…
cl 10:28:43 cl-0 OpenCL OpenCL 1.1 Mesa 20.3.4 not supported, but platform Clover might work nevertheless. USE AT OWN RISK!
cl 10:28:43 cl-0 Using PciId : AMD VEGAM (DRM 3.40.0, 5.10.12-200.fc33.x86_64, LLVM 11.0.0) OpenCL 1.1 Mesa 20.3.4 Memory : 4.00 GB
i 10:28:43 sim Epoch : 0 Difficulty : 4.29 Gh
i 10:28:43 sim Job: bcb4e018… block 123 localhost:0
cl 10:28:43 cl-0 Generating DAG + Light : 1.02 GB
cl 10:28:43 cl-0 OpenCL kernel
X 10:28:43 cl-0 OpenCL kernel build log:
input.cl:321:9: error: implicit declaration of function ‘amd_bitalign’ is invalid in OpenCL
input.cl:180:9: note: expanded from macro ‘KECCAK_PROCESS’
input.cl:99:60: note: expanded from macro ‘KECCAKF_1600_RND’
input.cl:87:24: note: expanded from macro ‘ROTL64_1’
input.cl:433:5: error: implicit declaration of function ‘amd_bitalign’ is invalid in OpenCL
input.cl:180:9: note: expanded from macro ‘KECCAK_PROCESS’
input.cl:99:60: note: expanded from macro ‘KECCAKF_1600_RND’
input.cl:87:24: note: expanded from macro ‘ROTL64_1’X 10:28:43 cl-0 OpenCL kernel build error (-11):
clBuildProgram
SIGSEGV encountered …
stack trace:
backtrace() returned 7 addresses
./bin/ethminer() [0x426929]
/lib64/libc.so.6(+0x3da60) [0x7f99f10a3a60]
./bin/ethminer() [0x6e3ca3]
./bin/ethminer() [0x4bbdef]
./bin/ethminer() [0x7bdb20]
/lib64/libpthread.so.0(+0x93f9) [0x7f99f139b3f9]
/lib64/libc.so.6(clone+0x43) [0x7f99f1167b53]
Environment (please complete the following information):
- Operating System: Fedora 33, linux v5.10.12rpm , mesa v20.3.4
- Hardware: Radeon RX Vega M GL
- Ethminer Version [0.16, 0.17, 0.18, 0.19-alpha0]
- Ethminer options used: -G -M 123
Additional context
ethmoner v0.15 works succesfully. It starts failing with v0.16
I have problems with OpenCl compilation.
For example, when I wan’t to launch SmallptGPU :
Usage: ./smallptGPU
Usage: ./smallptGPU 0 and power of 2)>
OpenCL Platform 0: NVIDIA Corporation
OpenCL Device 0: Type = TYPE_GPU
OpenCL Device 0: Name = GeForce 840M
OpenCL Device 0: Compute units = 3
OpenCL Device 0: Max. work group size = 1024
[SELECTED] OpenCL Device 0: Type = TYPE_GPU
[SELECTED] OpenCL Device 0: Name = GeForce 840M
[SELECTED] OpenCL Device 0: Compute units = 3
[SELECTED] OpenCL Device 0: Max. work group size = 1024
Reading file ‘rendering_kernel.cl’ (size 3216 bytes)
Failed to build OpenCL kernel: -11
OpenCL Programm Build Log:
It returns the same error for every program I try to launch with OpenCL.
I have nvidia-346, nvidia-346-uvm, nvidia-modprobe, nvidia-opencl-icd-346 and opencl-headers installed and CUDA works fine.
My computer has two GPUs (an Intel one and the nVidia GPU) so I use bumblebee, and when I wan’t to use CUDA, I load the nvidia-346-uvm module, and it works fine.
Can somebody help me to fix this issue ?
Thanks
A.B.
87.7k21 gold badges242 silver badges317 bronze badges
asked May 25, 2015 at 8:37
It works now. I ran smallptGPU using strace and I saw that the program couldn’t find libnvidia-compiler.so.346.72
I had to copy /usr/lib/nvidia-346/libnvidia-compiler.so* to /usr/lib/ and it works properly now.
The fact is that nvidia-346 and nvidia-346-uvm don’t seem to copy/link their needed libraries to /usr/lib/, and that’s true too for libvdpau.so for exemple ..
answered May 25, 2015 at 10:03
Я использую видеокарту ATI RV770, OpenCl 1.0 и ati-stream-sdk-v2.3-lnx64 в Linux.
При запуске моего хост-кода, который включает следующие два раздела для создания программы ядра, я получаю код ошибки (-11), т.е. cl_build_program_failure
. Означает ли это, что программа ядра скомпилирована, если нет, то как она компилируется и отлаживается?
const char* KernelPath = "abc_kernel.cl"; //kernel program is in separate file but in same directory of host code..
/* Создать объект Program из исходного кода ядра *******/
char* sProgramSource = readKernelSource(KernelPath);
size_t sourceSize = strlen(sProgramSource) ;
program = clCreateProgramWithSource(context, 1,(const char **) &sProgramSource,&sourceSize, &err);
checkStatus("error while creating program",err);
/* Построить (скомпилировать и связать) программу **** /
char* options = (char* )malloc(10*sizeof(char));
strcpy(options, "-g");
err = clBuildProgram(program, num_devices, devices_id, options, NULL, NULL);
checkStatus("Build Program Failed", err); //This line throwing the error....
Функция чтения программы ядра выглядит следующим образом:
/ * читать исходный файл программы * /
char* readKernelSource(const char* kernelSourcePath){
FILE *fp = NULL;
size_t sourceLength;
char *sourceString ;
fp = fopen( kernelSourcePath , "r");
if(fp == 0)
{
printf("failed to open file");
return NULL;
}
// get the length of the source code
fseek(fp, 0, SEEK_END);
sourceLength = ftell(fp);
rewind(fp);
// allocate a buffer for the source code string and read it in
sourceString = (char *)malloc( sourceLength + 1);
if( fread( sourceString, 1, sourceLength, fp) !=sourceLength )
{
printf("nt Error : Fail to read file ");
return 0;
}
sourceString[sourceLength+1]='';
fclose(fp);
return sourceString;
} // конец readKernelSource
Может кто подскажет как исправить?
Означает ли это, что это ошибка компиляции OpenCl во время выполнения или что-то еще?
// Печать информации build_log с помощью clGetProgramBuildInfo (), как показано ниже, но почему он ничего не печатает?
char * build_log; size_t log_size;
// First call to know the proper size
err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size);
build_log = (char* )malloc((log_size+1));
// Second call to get the log
err = clGetProgramBuildInfo(program, devices_id, CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL);
build_log[log_size] = '';
printf("--- Build log ---n ");
fprintf(stderr, "%sn", build_log);
free(build_log);
Вопрос:
Я немного поработал в OpenCL, но в последнее время “clBuildProgram” не удалось выполнить в одной из моих программ. Ниже приведен фрагмент кода:
cl_program program;
program = clCreateProgramWithSource(context, 1, (const char**) &kernel_string, NULL, &err);
if(err != CL_SUCCESS)
{
cout<<"Unable to create Program Object. Error code = "<<err<<endl;
exit(1);
}
if(clBuildProgram(program, 0, NULL, NULL, NULL, NULL) != CL_SUCCESS)
{
cout<<"Program Build failedn";
size_t length;
char buffer[2048];
clGetProgramBuildInfo(program, device_id[0], CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &length);
cout<<"--- Build log ---n "<<buffer<<endl;
exit(1);
}
Обычно раньше я получал синтаксис или другие ошибки внутри файла ядра здесь с помощью функции “clGetProgramBuildInfo()” всякий раз, когда “clBuildProgram” сработала, но когда эта программа запускается, на консоли она только печатает:
Ошибка сборки программы
— Строить журнал —
И когда я попытался напечатать код ошибки, возвращенный командой “clBuildProgram” ; это “-11″……
Что может быть проблемой с моим файлом ядра, что я не получаю информацию о сбое сборки?
Ответ №1
Вы можете узнать значение кодов ошибок OpenCL, выполнив поиск в cl.h. В этом случае -11 это то, что вы ожидаете, CL_BUILD_PROGRAM_FAILURE. Конечно, любопытно, что журнал сборки пуст. Два вопроса:
1.) Что такое возвращаемое значение из clGetProgramBuildInfo?
2.) На какой платформе вы работаете? Если вы используете реализацию Apple OpenCL, вы можете попробовать установить CL_LOG_ERRORS = stdout в своей среде. Например, из терминала:
$CL_LOG_ERRORS = stdout./myprog
Также довольно легко установить это в Xcode (Edit Scheme → Arguments → Environment Variables).
Ответ №2
Если вы используете C вместо С++:
err = clBuildProgram(program, 0, NULL, NULL, NULL, NULL);
////////////////Add the following lines to see the log file///////////
if (err != CL_SUCCESS) {
char *buff_erro;
cl_int errcode;
size_t build_log_len;
errcode = clGetProgramBuildInfo(program, devices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &build_log_len);
if (errcode) {
printf("clGetProgramBuildInfo failed at line %dn", __LINE__);
exit(-1);
}
buff_erro = malloc(build_log_len);
if (!buff_erro) {
printf("malloc failed at line %dn", __LINE__);
exit(-2);
}
errcode = clGetProgramBuildInfo(program, devices[0], CL_PROGRAM_BUILD_LOG, build_log_len, buff_erro, NULL);
if (errcode) {
printf("clGetProgramBuildInfo failed at line %dn", __LINE__);
exit(-3);
}
fprintf(stderr,"Build log: n%sn", buff_erro); //Be careful with the fprint
free(buff_erro);
fprintf(stderr,"clBuildProgram failedn");
exit(EXIT_FAILURE);
}
Ответ №3
Я столкнулся с той же проблемой с пустым файлом журнала. Я тестировал свое ядро ocl на другом компьютере. У него было 2 платформы вместо одного. Один графический процессор Intel и один графический процессор AMD. У меня только был установлен SDK AMD OCL. Проблема с установкой Intel OCL SDK. Также исправлен выбор платформы AMD вместо платформы Intel GPU.
я получаю ошибку -11 в этой строке
checkerror(clBuildProgram(program, deviceidcount, deviceids.data(), nullptr, nullptr, nullptr));
мое ядро
__kernel void render(double playerx,double playery,double playerz,double yaw,double pitch,double x1,double y1,double z1,double x2,double y2,double z2,double x3,double y3,double z3,__global int* texture){
//const int i = get_global_id(0);
//x[i] = a*x[i];
//x[i] = cos(a);
x1 = x1-playerx;
y1 = y1-playery;
z1 = z1-playerz;
x2 = x2-playerx;
y2 = y2-playery;
z2 = z2-playerz;
x3 = x3-playerx;
y3 = y3-playery;
z3 = z3-playerz;
double smallyaw = yaw - M_PI_2;
double bigpitch = pitch + M_PI_2;
double screenx1 = cos(smallyaw)*cos(pitch)*x1 + sin(smallyaw)*cos(pitch)*y1 + sin(pitch)*z1;
double screeny1 = cos(yaw)*cos(bigpitch)*x1 + sin(yaw)*cos(bigpitch)*y1 + sin(bigpitch)*z1;
double screenz1 = cos(yaw)*cos(pitch)*x1 + sin(yaw)*cos(pitch)*y1 + sin(pitch)*z1;
printf(screenx1);
printf(screeny1);
printf(screenz1);
}
я не вижу ничего плохого с точки зрения синтаксиса. и я также попытался заменить все парные числа поплавками.
это глупо после долгого времени, когда я закомментировал строки printf, и это сработало. Как я должен проверить, что эти переменные равны. Может кто-нибудь сказать мне, как правильно печатать вещи?
1
Решение
printf("value = %#gn", 3.012);
печатает 3.012 на консоль.
Печать на консоль должна выполняться потокобезопасным способом, поэтому ваш поток cl должен совпадать с потоком очистки консоли.
1
Другие решения
Вывод на печать из многих ядер может дать неожиданные результаты. Время выключено, отпечатки не возвращаются в каком-либо определенном порядке и т. Д. Попробуйте выполнить печать только с одного рабочего элемента.
if i == 0{
printf(...)
}
Вы также можете поставить барьер выше этого и, если нужно, перебрать несколько значений из рабочего элемента 0.
0
я не вижу ничего плохого с точки зрения синтаксиса.
Ну, попробуйте выглядеть сложнее, потому что вы не так используете printf.
Если вы хотите напечатать дубли, используйте
printf("%f", value);
Если это не имеет смысла, рекомендую прочитать документацию как для обычного C printf, так и для OpenCL printf.
Также, поскольку -11 — это CL_BUILD_PROGRAM _FAILURE, вы можете использовать clGetProgramBuildInfo, чтобы получить журнал сборки и проверить, где компиляция прошла неправильно.
0
В Intel-платформе и компиляторе Intel SDK clBuildProgram возвращает CL_BUILD_PROGRAM_FAILURE clGetProgramBuildInfo показывает статус как 0. Но платформы AMD и NVIDIA не будут создавать ошибок для того же кода при построении с их SDK и компилятором. Журнал построения программы показан ниже
OPENCL ERROR : CL_BUILD_PROGRAM_FAILURE
Build failed; error=-11, status=0, programLog:
Compilation started
Compilation done
Linking started
Linking done
Kernel <Kernel1> was successfully vectorized
Доступные платформы и устройства: 1. FULL_PROFILE — OpenCL 1.2 — Intel (R) OpenCL — Корпорация Intel (R) 1. Intel (R) Core i5-4670 CPU @3,40 ГГц — OpenCL 1.2 (Build 76413) 2. Intel (R) HD Graphics 4600 — OpenCL 1.2
Операционная система — 64-разрядная Windows 7.
07 июль 2014, в 16:18
Поделиться
Источник
1 ответ
Я нашел проблему. Это из-за
#pragma OPENCL EXTENSION cl_khr_fp64: enable
если я прокомментирую это и сделаю double для float, то clBuildProgram вернет успех. Но путем включения этого дает выход.
Sijo
08 июль 2014, в 07:51
Поделиться
Ещё вопросы
- 1Selenium получить активную вкладку
- 0это в AngularJS
- 1Android SDK предоставляет удобные методы для преобразования Shape в Path?
- 0Неверное значение из DDX_CBIndex ()
- 1Прохождение комнат в текстовой игре на Java
- 1Python — h2o: как правильно указать типы столбцов?
- 1Вызов метода .querySelector () с использованием вызова с контекстом, отличным от документа?
- 1Геолокация для iPhone JavaScript Веб-приложение
- 1Передача данных в событие — Объединить события
- 0Ошибка времени выполнения с матрицей, реализованной 2d Vector
- 0Phonegap и JqueryMobile блокируют события и функции пользовательского интерфейса
- 0Получить открытое имя файла убивает ifstream
- 0VB.Net Удалить выбранную строку в DataGridView MySql
- 0phpseclib не возвращает результатов даже по простой команде
- 1MATLAB: Как использовать Java-код в MATLAB?
- 1Максимальный размер пинга Android менее 64 КБ
- 0Подсчитайте отличительные логические значения для каждого идентификатора в уникальных группах
- 0MySQL вставка не вставляя предполагаемое значение
- 0Форматирование, преобразование из строки C
- 1Отображение списка просмотра Android на основе выбора списка
- 0Как получить URL-адреса только из строки с тегами HTML
- 1Отправка MMS в Android
- 0Mysql эффект разделения на индекс
- 1Не показывать текст в строке
- 1Как мы можем скопировать данные столбца данных таблицы данных в другую таблицу данных?
- 1AutoMapper — Создание карты для члена интерфейса
- 0Ошибка C ++: сбой отладочного утверждения
- 1Выражение, которое возвращает содержимое между двумя DateTimes в файле журнала, если определенный токен остается между
- 0MySQL Cursor не может выбрать переменную извлечения
- 1Как изменить URL ссылки перед переходом на
- 0Извлечь несколько атрибутов из тега с помощью оболочки
- 0Ошибка в запросе вставки mysql error # 1364
- 1Изменить формат вывода даты
- 0как включить http, fs модули внутри узла webkit
- 1как включить служебные классы в Eclipse (Android-программирование)
- 1Присоединить обычную переменную JavaScript к модели Angular 2 (вход)?
- 0Как скрыть или показать textField с помощью checkBox в JavaScript Yii
- 1Только получать одинаковые пакеты udp
- 1Рабочая роль Azure Что пошло не так до метода OnRun ()?
- 0jQuery — DIV больше не появляется после закрытия всего сайта
- 0Как объединить массив по значению запятой?
- 0Поиск по родительскому массиву и вывод имени дочернего массива, если совпадение найдено
- 0Выберите отдельные значения в одну результирующую запись в виде списка через запятую
- 1Обратитесь к виджету tkinter по его экземпляру
- 0Неверная конфигурация продавца для PayPal Прямая оплата кредитной картой
- 1Пользовательский интерфейс в wpf для пользовательской задачи SSIS
- 1SVG Path оптимизация
- 1Панды — Посмотрите на 2 столбца и проверьте каждый столбец для различного элемента, если оба столбца содержат элементы, возвращают значение в другом столбце
- 0Невозможно создать таблицы в sqlalchemy postgresql
- 1Ошибка аутентификации Twitter4j
I have the following AMD graphics card and I have been trying to use it for GPU accelerated computing using OpenCL mesa driver. I am trying to use ArrayFire for the computation and after posting a couple of issues about it in the ArrayFire github page, found that the issue is with the Mesa driver for Arch.
0d:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] (rev 83)
Subsystem: Hewlett-Packard Company Device 80c2
Flags: bus master, fast devsel, latency 0, IRQ 52
Memory at b0000000 (64-bit, prefetchable) [size=256M]
Memory at d4000000 (64-bit, non-prefetchable) [size=256K]
I/O ports at 4000 [size=256]
Expansion ROM at d4040000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeon, amdgpu
I tried using the mesa driver with OpenCl support in the official repositories, but found that it is buggy and would always result in some error. Also, it does not support any higher version other than OpenCL 1.1. After a distro hop to Ubuntu, I used the mesa driver from Oibaf’s PPA and it seemed to work pretty well. After some searching, I found that an equivalent in Arch is the mesa-git driver. Now, in my Arch, I installed the compiled mesa-git and opencl-mesa-git from Laurent Carlier’s repository. After, testing it with Julia I find the following errors.
julia> a = AFArray(rand(4,4))
AFArray: 4×4 Array{Float64,2}:
0.910863 0.528568 0.769485 0.262519
0.758505 0.59156 0.464172 0.498584
0.888846 0.839448 0.482488 0.179536
0.470455 0.0313732 0.784979 0.995334
julia> a+1
AFArray: Error showing value of type AFArray{Float64,2}:
ERROR: ArrayFire Error (998) : Internal error
OpenCL Error (-11): Build Program Failure when calling clBuildProgram
Stacktrace:
[1] _error(::UInt32, ::Bool) at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/util.jl:96
[2] _error at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/util.jl:85 [inlined]
[3] get_data_ptr at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/wrap.jl:748 [inlined]
[4] convert_array(::AFArray{Float64,2}) at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/util.jl:216
[5] Array at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/array.jl:33 [inlined]
[6] toa(::AFArray{Float64,2}) at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/util.jl:48
[7] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::AFArray{Float64,2}) at /home/<username>/.julia/packages/ArrayFire/wYxcd/src/util.jl:52
[8] display(::REPL.REPLDisplay, ::MIME{Symbol("text/plain")}, ::Any) at /build/julia/src/julia-1.4.2/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:137
[9] display(::REPL.REPLDisplay, ::Any) at /build/julia/src/julia-1.4.2/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:141
[10] display(::Any) at ./multimedia.jl:323
[11] #invokelatest#1 at ./essentials.jl:712 [inlined]
[12] invokelatest at ./essentials.jl:711 [inlined]
[13] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /build/julia/src/julia-1.4.2/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:161
[14] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /build/julia/src/julia-1.4.2/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:146
[15] (::REPL.var"#do_respond#38"{Bool,REPL.var"#48#57"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /build/julia/src/julia-1.4.2/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:729
So, it seems the mesa-git is also buggy in my case. My question is why are the drivers on Mesa buggy and can it be fixed? Also, is there any way that I can install the drivers from Oibaf’s PPA(which are for Ubuntu) on Arch as they seem to work without any errors? You help here would be great as I will then be able to do my calculations without the need to switch over from Arch.
Linux <username> 5.7.3-arch1-1 #1 SMP PREEMPT Wed, 17 Jun 2020 19:42:12 +0000 x86_64 GNU/Linux
Further information: I am using the latest Arch kernel and have just updated all my drivers after a fresh reinstall a couple of days ago. I would be happy to provide any other information as needed. Thank you
Last edited by Lattitude (2020-06-21 04:23:29)
Knowing all errors by heart is good for quick programming, but not always the best option. Therefore I started to create a full list with extra info, taken from cl.h and the reference documentation.
The problem with many error-codes is that they are sometimes context-dependent and then become quite useless in helping the programmer out. Also some drivers return different error-codes. Notice also that different errors are given per OpenCL-version for the same function. If you find problems, help make OpenCL better and give feedback.
Want it on your wall? You can easily copy these two tables into Excel or alike software and print it out.
Run-time and JIT Compiler Errors (driver-dependent)
Code | OpenCL Error Flag | Function(s) | Description |
0 | CL_SUCCESS | The sweet spot. | |
-1 | CL_DEVICE_NOT_FOUND | clGetDeviceIDs | if no OpenCL devices that matched device_type were found. |
-2 | CL_DEVICE_NOT_AVAILABLE | clCreateContext | if a device in devices is currently not available even though the device was returned by clGetDeviceIDs. |
-3 | CL_COMPILER_NOT _AVAILABLE | clBuildProgram | if program is created with clCreateProgramWithSource and a compiler is not available i.e. CL_DEVICE_COMPILER_AVAILABLE specified in the table of OpenCL Device Queries for clGetDeviceInfo is set to CL_FALSE. |
-4 | CL_MEM_OBJECT _ALLOCATION_FAILURE | if there is a failure to allocate memory for buffer object. | |
-5 | CL_OUT_OF_RESOURCES | if there is a failure to allocate resources required by the OpenCL implementation on the device. | |
-6 | CL_OUT_OF_HOST_MEMORY | if there is a failure to allocate resources required by the OpenCL implementation on the host. | |
-7 | CL_PROFILING_INFO_NOT _AVAILABLE | clGetEventProfilingInfo | if the CL_QUEUE_PROFILING_ENABLE flag is not set for the command-queue, if the execution status of the command identified by event is not CL_COMPLETE or if event is a user event object. |
-8 | CL_MEM_COPY_OVERLAP | clEnqueueCopyBuffer, clEnqueueCopyBufferRect, clEnqueueCopyImage | if src_buffer and dst_buffer are the same buffer or subbuffer object and the source and destination regions overlap or if src_buffer and dst_buffer are different sub-buffers of the same associated buffer object and they overlap. The regions overlap if src_offset ≤ to dst_offset ≤ to src_offset + size – 1, or if dst_offset ≤ to src_offset ≤ to dst_offset + size – 1. |
-9 | CL_IMAGE_FORMAT _MISMATCH | clEnqueueCopyImage | if src_image and dst_image do not use the same image format. |
-10 | CL_IMAGE_FORMAT_NOT _SUPPORTED | clCreateImage | if the image_format is not supported. |
-11 | CL_BUILD_PROGRAM _FAILURE | clBuildProgram | if there is a failure to build the program executable. This error will be returned if clBuildProgram does not return until the build has completed. |
-12 | CL_MAP_FAILURE | clEnqueueMapBuffer, clEnqueueMapImage | if there is a failure to map the requested region into the host address space. This error cannot occur for image objects created with CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR. |
-13 | CL_MISALIGNED_SUB _BUFFER_OFFSET | if a sub-buffer object is specified as the value for an argument that is a buffer object and the offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue. | |
-14 | CL_EXEC_STATUS_ERROR_ FOR_EVENTS_IN_WAIT_LIST | if the execution status of any of the events in event_list is a negative integer value. | |
-15 | CL_COMPILE_PROGRAM _FAILURE | clCompileProgram | if there is a failure to compile the program source. This error will be returned if clCompileProgram does not return until the compile has completed. |
-16 | CL_LINKER_NOT_AVAILABLE | clLinkProgram | if a linker is not available i.e. CL_DEVICE_LINKER_AVAILABLE specified in the table of allowed values for param_name for clGetDeviceInfo is set to CL_FALSE. |
-17 | CL_LINK_PROGRAM_FAILURE | clLinkProgram | if there is a failure to link the compiled binaries and/or libraries. |
-18 | CL_DEVICE_PARTITION _FAILED | clCreateSubDevices | if the partition name is supported by the implementation but in_device could not be further partitioned. |
-19 | CL_KERNEL_ARG_INFO _NOT_AVAILABLE | clGetKernelArgInfo | if the argument information is not available for kernel. |
The last four (-16 till -19) are new in OpenCL 1.2.
Compile-time Errors (driver-independent)
Code | OpenCL Error Flag | Function(s) | Description |
-30 | CL_INVALID_VALUE | clGetDeviceIDs, clCreateContext | This depends on the function: two or more coupled parameters had errors. |
-31 | CL_INVALID_DEVICE_TYPE | clGetDeviceIDs | if an invalid device_type is given |
-32 | CL_INVALID_PLATFORM | clGetDeviceIDs | if an invalid platform was given |
-33 | CL_INVALID_DEVICE | clCreateContext, clBuildProgram | if devices contains an invalid device or are not associated with the specified platform. |
-34 | CL_INVALID_CONTEXT | if context is not a valid context. | |
-35 | CL_INVALID_QUEUE_PROPERTIES | clCreateCommandQueue | if specified command-queue-properties are valid but are not supported by the device. |
-36 | CL_INVALID_COMMAND_QUEUE | if command_queue is not a valid command-queue. |
|
-37 | CL_INVALID_HOST_PTR | clCreateImage, clCreateBuffer | This flag is valid only if host_ptr is not NULL. If specified, it indicates that the application wants the OpenCL implementation to allocate memory for the memory object and copy the data from memory referenced by host_ptr.CL_MEM_COPY_HOST_PTR and CL_MEM_USE_HOST_PTR are mutually exclusive.CL_MEM_COPY_HOST_PTR can be used with CL_MEM_ALLOC_HOST_PTR to initialize the contents of the cl_mem object allocated using host-accessible (e.g. PCIe) memory. |
-38 | CL_INVALID_MEM_OBJECT | if memobj is not a valid OpenCL memory object. | |
-39 | CL_INVALID_IMAGE_FORMAT_DESCRIPTOR | if the OpenGL/DirectX texture internal format does not map to a supported OpenCL image format. | |
-40 | CL_INVALID_IMAGE_SIZE | if an image object is specified as an argument value and the image dimensions (image width, height, specified or compute row and/or slice pitch) are not supported by device associated with queue. | |
-41 | CL_INVALID_SAMPLER | clGetSamplerInfo, clReleaseSampler, clRetainSampler, clSetKernelArg | if sampler is not a valid sampler object. |
-42 | CL_INVALID_BINARY | clCreateProgramWithBinary, clBuildProgram |
The provided binary is unfit for the selected device. if program is created with clCreateProgramWithBinary and devices listed in device_list do not have a valid program binary loaded. |
-43 | CL_INVALID_BUILD_OPTIONS | clBuildProgram | if the build options specified by options are invalid. |
-44 | CL_INVALID_PROGRAM | if program is a not a valid program object. |
|
-45 | CL_INVALID_PROGRAM_EXECUTABLE | if there is no successfully built program executable available for device associated with command_queue. | |
-46 | CL_INVALID_KERNEL_NAME | clCreateKernel | if kernel_name is not found in program. |
-47 | CL_INVALID_KERNEL_DEFINITION | clCreateKernel | if the function definition for __kernel function given by kernel_name such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built. |
-48 | CL_INVALID_KERNEL | if kernel is not a valid kernel object. | |
-49 | CL_INVALID_ARG_INDEX | clSetKernelArg, clGetKernelArgInfo | if arg_index is not a valid argument index. |
-50 | CL_INVALID_ARG_VALUE | clSetKernelArg, clGetKernelArgInfo | if arg_value specified is not a valid value. |
-51 | CL_INVALID_ARG_SIZE | clSetKernelArg | if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size != sizeof(cl_mem) or if arg_size is zero and the argument is declared with the __local qualifier or if the argument is a sampler and arg_size != sizeof(cl_sampler). |
-52 | CL_INVALID_KERNEL_ARGS | if the kernel argument values have not been specified. | |
-53 | CL_INVALID_WORK_DIMENSION | if work_dim is not a valid value (i.e. a value between 1 and 3). |
|
-54 | CL_INVALID_WORK_GROUP_SIZE | if local_work_size is specified and number of work-items specified by global_work_size is not evenly divisable by size of work-group given by local_work_size or does not match the work-group size specified for kernel using the __attribute__ ((reqd_work_group_size(X, Y, Z))) qualifier in program source.if local_work_size is specified and the total number of work-items in the work-group computed as local_work_size[0] *… local_work_size[work_dim – 1] is greater than the value specified by CL_DEVICE_MAX_WORK_GROUP_SIZE in the table of OpenCL Device Queries for clGetDeviceInfo.if local_work_size is NULL and the __attribute__ ((reqd_work_group_size(X, Y, Z))) qualifier is used to declare the work-group size for kernel in the program source. | |
-55 | CL_INVALID_WORK_ITEM_SIZE | if the number of work-items specified in any of local_work_size[0], … local_work_size[work_dim – 1] is greater than the corresponding values specified by CL_DEVICE_MAX_WORK_ITEM_SIZES[0], …. CL_DEVICE_MAX_WORK_ITEM_SIZES[work_dim – 1]. | |
-56 | CL_INVALID_GLOBAL_OFFSET | if the value specified in global_work_size + the corresponding values in global_work_offset for any dimensions is greater than the sizeof(size_t) for the device on which the kernel execution will be enqueued. | |
-57 | CL_INVALID_EVENT_WAIT_LIST | if event_wait_list is NULL and num_events_in_wait_list > 0, or event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events. | |
-58 | CL_INVALID_EVENT | if event objects specified in event_list are not valid event objects. | |
-59 | CL_INVALID_OPERATION | if interoperability is specified by setting CL_CONTEXT_ADAPTER_D3D9_KHR, CL_CONTEXT_ADAPTER_D3D9EX_KHR or CL_CONTEXT_ADAPTER_DXVA_KHR to a non-NULL value, and interoperability with another graphics API is also specified. (only if the cl_khr_dx9_media_sharing extension is supported). | |
-60 | CL_INVALID_GL_OBJECT | if texture is not a GL texture object whose type matches texture_target, if the specified miplevel of texture is not defined, or if the width or height of the specified miplevel is zero. | |
-61 | CL_INVALID_BUFFER_SIZE | clCreateBuffer, clCreateSubBuffer | if size is 0.Implementations may return CL_INVALID_BUFFER_SIZE if size is greater than the CL_DEVICE_MAX_MEM_ALLOC_SIZE value specified in the table of allowed values for param_name for clGetDeviceInfo for all devices in context. |
-62 | CL_INVALID_MIP_LEVEL | OpenGL-functions | if miplevel is greater than zero and the OpenGL implementation does not support creating from non-zero mipmap levels. |
-63 | CL_INVALID_GLOBAL_WORK_SIZE | if global_work_size is NULL, or if any of the values specified in global_work_size[0], …global_work_size [work_dim – 1] are 0 or exceed the range given by the sizeof(size_t) for the device on which the kernel execution will be enqueued. | |
-64 | CL_INVALID_PROPERTY | clCreateContext | Vague error, depends on the function |
-65 | CL_INVALID_IMAGE_DESCRIPTOR | clCreateImage | if values specified in image_desc are not valid or if image_desc is NULL. |
-66 | CL_INVALID_COMPILER_OPTIONS | clCompileProgram | if the compiler options specified by options are invalid. |
-67 | CL_INVALID_LINKER_OPTIONS | clLinkProgram | if the linker options specified by options are invalid. |
-68 | CL_INVALID_DEVICE_PARTITION_COUNT | clCreateSubDevices | if the partition name specified in properties is CL_DEVICE_PARTITION_BY_COUNTS and the number of sub-devices requested exceeds CL_DEVICE_PARTITION_MAX_SUB_DEVICES or the total number of compute units requested exceeds CL_DEVICE_PARTITION_MAX_COMPUTE_UNITS for in_device, or the number of compute units requested for one or more sub-devices is less than zero or the number of sub-devices requested exceeds CL_DEVICE_PARTITION_MAX_COMPUTE_UNITS for in_device. |
-69 | CL_INVALID_PIPE_SIZE | clCreatePipe | if pipe_packet_size is 0 or the pipe_packet_size exceeds CL_DEVICE_PIPE_MAX_PACKET_SIZE value for all devices in context or if pipe_max_packets is 0. |
-70 | CL_INVALID_DEVICE_QUEUE | clSetKernelArg | when an argument is of type queue_t when it’s not a valid device queue object. |
Errors -65 till -68 are new in OpenCL 1.2. Errors -69 en -70 are introduced in 2.0.
Errors thrown by extensions
Code | OpenCL Error Flag | Function(s) | Description |
-1000 | CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR | clGetGLContextInfoKHR, clCreateContext | CL and GL not on the same device (only when using a GPU). |
-1001 | CL_PLATFORM_NOT_FOUND_KHR | clGetPlatform | No valid ICDs found |
-1002 | CL_INVALID_D3D10_DEVICE_KHR | clCreateContext, clCreateContextFromType | if the Direct3D 10 device specified for interoperability is not compatible with the devices against which the context is to be created. |
-1003 | CL_INVALID_D3D10_RESOURCE_KHR | clCreateFromD3D10BufferKHR, clCreateFromD3D10Texture2DKHR, clCreateFromD3D10Texture3DKHR | If the resource is not a Direct3D 10 buffer or texture object |
-1004 | CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR | clEnqueueAcquireD3D10ObjectsKHR | If a mem_object is already acquired by OpenCL |
-1005 | CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR | clEnqueueReleaseD3D10ObjectsKHR | If a mem_object is not acquired by OpenCL |
-1006 | CL_INVALID_D3D11_DEVICE_KHR | clCreateContext, clCreateContextFromType | if the Direct3D 11 device specified for interoperability is not compatible with the devices against which the context is to be created. |
-1007 | CL_INVALID_D3D11_RESOURCE_KHR | clCreateFromD3D11BufferKHR, clCreateFromD3D11Texture2DKHR, clCreateFromD3D11Texture3DKHR | If the resource is not a Direct3D 11 buffer or texture object |
-1008 | CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR | clEnqueueAcquireD3D11ObjectsKHR | If a mem_object is already acquired by OpenCL |
-1009 | CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR | clEnqueueReleaseD3D11ObjectsKHR | If a ‘mem_object’ is not acquired by OpenCL |
-1010 | CL_INVALID_D3D9_DEVICE_NV CL_INVALID_DX9_DEVICE_INTEL | clCreateContext, clCreateContextFromType | If the Direct3D 9 device specified for interoperability is not compatible with the devices against which the context is to be created |
-1011 | CL_INVALID_D3D9_RESOURCE_NV CL_INVALID_DX9_RESOURCE_INTEL | clCreateFromD3D9VertexBufferNV, clCreateFromD3D9IndexBufferNV, clCreateFromD3D9SurfaceNV, clCreateFromD3D9TextureNV, clCreateFromD3D9CubeTextureNV, clCreateFromD3D9VolumeTextureNV | If a ‘mem_object’ is not a Direct3D 9 resource of the required type |
-1012 | CL_D3D9_RESOURCE_ALREADY_ACQUIRED_NV CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL | clEnqueueAcquireD3D9ObjectsNV | If any of the ‘mem_objects’ is currently already acquired by OpenCL |
-1013 | CL_D3D9_RESOURCE_NOT_ACQUIRED_NV CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL | clEnqueueReleaseD3D9ObjectsNV | If any of the ‘mem_objects’ is currently not acquired by OpenCL |
-1092 | CL_EGL_RESOURCE_NOT_ACQUIRED_KHR | clEnqueueReleaseEGLObjectsKHR | If a ‘mem_object’ is not acquired by OpenCL |
-1093 | CL_INVALID_EGL_OBJECT_KHR | clCreateFromEGLImageKHR, clEnqueueAcquireEGLObjectsKHR | If a ‘mem_object’ is not a EGL resource of the required type |
-1094 | CL_INVALID_ACCELERATOR_INTEL | clSetKernelArg | when ‘arg_value’ is not a valid accelerator object, and by clRetainAccelerator, clReleaseAccelerator, and clGetAcceleratorInfo when ‘accelerator’ is not a valid accelerator object |
-1095 | CL_INVALID_ACCELERATOR_TYPE_INTEL | clSetKernelArg, clCreateAccelerator | when ‘arg_value’ is not an accelerator object of the correct type, or when ‘accelerator_type’ is not a valid accelerator type |
-1096 | CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL | clCreateAccelerator | when values described by ‘descriptor’ are not valid, or if a combination of values is not valid |
-1097 | CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL | clCreateAccelerator | when ‘accelerator_type’ is a valid accelerator type, but it not supported by any device in ‘context’ |
-1098 | CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL | clCreateContext, clCreateContextFromType | If the VA API display specified for interoperability is not compatible with the devices against which the context is to be created |
-1099 | CL_INVALID_VA_API_MEDIA_SURFACE_INTEL | clEnqueueReleaseVA_APIMediaSurfacesINTEL | If ‘surface’ is not a VA API surface of the required type, by clGetMemObjectInfo when ‘param_name’ is CL_MEM_VA_API_MEDIA_SURFACE_INTEL when was not created from a VA API surface, and from clGetImageInfo when ‘param_name’ is CL_IMAGE_VA_API_PLANE_INTEL and ‘image’ was not created from a VA API surface |
-1100 | CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL | clEnqueueReleaseVA_APIMediaSurfacesINTEL | If any of the ‘mem_objects’ is already acquired by OpenCL |
-1101 | CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL | clEnqueueReleaseVA_APIMediaSurfacesINTEL | If any of the ‘mem_objects’ are not currently acquired by OpenCL |
Errors thrown by Vendors
Code | Vendor | Function(s) | Description |
-9999 | NVidia | clEnqueueNDRangeKernel | Illegal read or write to a buffer |
Hope you find this useful. Let me know how I could improve this list!
Have this in code-form? Supply a link in comments.
Related Posts