[BUG] createGLBuffer and copyToGLBuffer do not point to the same device
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
forge/examples/opencl と cl_helpers.h から始め、特に get_devices と 2 つの createCLGLContext オーバーロードを確認してください。複数のグラフィックスカードを搭載したシステムで失敗を再現し、その後、各 OpenGL バッファ操作がどの OpenCL デバイスを使用するかを追跡してください。完了条件は、最後のデバイスを選択することに依存せず、例が同じデバイスを介して GL バッファを作成およびコピーすることです。
索引モデルが issue の本文から書いたものです。
説明
If you have more than one display cards, all the examples in forge/examples/opencl will fail.
A temporary workaround is to modify createCLGLContext in cl_helpers.h so that cl::Context always use the last device instead of the first device. But it is not a solution at all.
void get_devices(const forge::Window &wnd,
std::vector<cl::Platform> &platforms_interop,
std::vector<Device> &devices_interop) {
std::vector<cl::Platform> platforms;
Platform::get(&platforms);
for (auto platform : platforms) {
std::vector<cl::Device> devices;
try {
platform.getDevices(CL_DEVICE_TYPE_GPU, &devices);
for (auto device : devices) {
if (checkGLInterop(platform, device, wnd)) {
devices_interop.push_back(device);
platforms_interop.push_back(platform);
}
}
} catch (const cl::Error &err) {
if (err.err() != CL_DEVICE_NOT_FOUND) {
std::cout << "Platform: " << platform.getInfo<CL_PLATFORM_NAME>()
<< " got error = " << err.err() << std::endl;
throw std::runtime_error("Fatal Error!");
}
}
}
if (devices_interop.size() == 0)
throw std::runtime_error("No CL-GL sharing contexts found");
}
cl::Context createCLGLContext(const forge::Window &wnd, cl::Platform platform,
cl::Device device) {
// std::cout << "Platform: " << platform.getInfo<CL_PLATFORM_NAME>()
// << std::endl;
// std::cout << "Device: " << device.getInfo<CL_DEVICE_NAME>() << std::endl;
#if defined(OS_MAC)
CGLContextObj cgl_current_ctx = CGLGetCurrentContext();
CGLShareGroupObj cgl_share_group = CGLGetShareGroup(cgl_current_ctx);
cl_context_properties cps[] = {CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE,
(cl_context_properties)cgl_share_group, 0};
#elif defined(OS_LNX)
cl_context_properties cps[] = {CL_GL_CONTEXT_KHR,
(cl_context_properties)wnd.context(),
CL_GLX_DISPLAY_KHR,
(cl_context_properties)wnd.display(),
CL_CONTEXT_PLATFORM,
(cl_context_properties)platform(),
0};
#else /* OS_WIN */
cl_context_properties cps[] = {CL_GL_CONTEXT_KHR,
(cl_context_properties)wnd.context(),
CL_WGL_HDC_KHR,
(cl_context_properties)wnd.display(),
CL_CONTEXT_PLATFORM,
(cl_context_properties)platform(),
0};
#endif
return cl::Context(device, cps);
}
cl::Context createCLGLContext(const forge::Window &wnd) {
std::vector<cl::Platform> platforms;
std::vector<Device> devices;
get_devices(wnd, platforms, devices);
for (size_t i = devices.size() - 1; i >= 0; i--) {
// for (size_t i = 0; i < devices.size(); i++) {
try {
return createCLGLContext(wnd, platforms[i], devices[i]);
} catch (const cl::Error &err) {
std::cout << "[createCLGLContext]Error:" << err.err() << std::endl;
}
}
return cl::Context();
}
- 主要言語
- C++
- スター
- 238
- フォーク
- 46
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
arrayfire/forge のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
enhancement
-
enhancement feature
arrayfire/forge の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
duckdb/duckdb-wasm#2258 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend オープンcoarray
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·