arrayfire / arrayfire/arrayfire

[Question] Have an array allocation failing w/ errno 103

Open
#3,619 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.9k
Forks
555
Avg merge
1h 24m
Merged PRs (30d)
1

Description

Hey all,

I have some code that is erroring and i have **no** idea why.

```int main(int argc, char** argv)
{
// Show available backends
auto backends = af::getAvailableBackends();
cout << "Available backends: ";
if(backends & AF_BACKEND_CPU) cout << "CPU ";
if(backends & AF_BACKEND_CUDA) cout << "CUDA ";
if(backends & AF_BACKEND_ONEAPI) cout << "OneAPI ";
if(backends & AF_BACKEND_OPENCL) cout << "OpenCL ";
cout << endl;

my_namespace::methods::af_benchmark_solve_linear_system();
}
void af_benchmark_solve_linear_system()
{
// Define the coefficient matrix A (10x10)
float A_vals[] =
{
2, 3, -4, 1, -5, 7, 2, -6, 8, -1,
5, -6, 3, 7, -1, 9, 4, 8, 2, -3,
-3, 5, -7, 9, -4, 6, 1, -2, 3, 5,
6, 1, -5, 3, -8, 4, 9, 2, -7, -1,
4, -7, 8, 2, -1, 3, 5, -6, 9, 1,
-1, 3, 6, -4, 7, -5, 8, 2, -3, 4,
7, -4, 3, -5, 6, 9, -2, 1, 4, -8,
8, 6, -9, 1, 3, -7, 5, -2, 1, 6,
5, -3, 7, -8, 4, 6, -1, 9, 2, -5,
3, 1, -6, 5, -7, 8, 2, 4, -9, 3
};

// Define the right-hand side vector b (10x1)
float b_vals[] = {15, -12, 10, 20, -5, 18, 25, -7, 14, 8};

// Create ArrayFire arrays for A and b
try
{
af::array A = af::randu(10, 10, f32);
af::array b(10, b_vals);

// Solve the linear system
af::array x = af::solve(A, b);
}
catch (af::exception &ex)
{
cout << stderr << " ArrayFire error: " << ex.what() << endl;
}

}
```

When it reaches the ```af:array A = af::randu(...)``` line, it throws this error:
```00007FFCA4679CE0 ArrayFire error: ArrayFire Exception (Runtime error :103):
In function af_err __cdecl af_randu(af_array *, const unsigned int, const dim_t *const, const af_dtype)
In file C:/Users/stef/coding/arrayfire/src/api/c/random.cpp:346

0# 0x00007FFC025A6E87 in C:\Program Files\ArrayFire\v3\lib\afoneapi.dll
1# 0x00007FFC0528FDB7 in C:\Program Files\ArrayFire\v3\lib\afoneapi.dll
2# 0x00007FFC054C8953 in C:\Program Files\ArrayFire\v3\lib\afoneapi.dll
3# 0x00007FFC054C8BB7 in C:\Program Files\ArrayFire\v3\lib\afoneapi.dll
4# 0x00007FF7A903A50A in C:\bin\arrayfire_bench.exe
5# 0x00007FF7A9033A8B in C:\bin\arrayfire_bench.exe
6# 0x00007FF7A9042F59 in C:\bin\arrayfire_bench.exe
7# 0x00007FF7A9042E42 in C:\bin\arrayfire_bench.exe
8# 0x00007FF7A9042CFE in C:\bin\arrayfire_bench.exe
9# 0x00007FF7A9042FEE in C:\bin\arrayfire_bench.exe
10# 0x00007FFD2598DBE7 in C:\WINDOWS\System32\KERNEL32.DLL
11# 0x00007FFD2647FBEC in C:\WINDOWS\SYSTEM32\ntdll.dll

In function array __cdecl af::randu(const dim4 &, const af::dtype)```

If anyone could help me understand what's going on that would be great. I was testing this library earlier and it was working just fine. Without the pdb files though I don't think I'll be able to get close enough to the exception source to figure this one out.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.