[BUG] createGLBuffer and copyToGLBuffer do not point to the same device
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Bắt đầu với forge/examples/opencl và cl_helpers.h, đặc biệt là get_devices và hai overload của createCLGLContext. Tái hiện lỗi trên một hệ thống có nhiều card đồ họa, sau đó truy vết xem mỗi thao tác bộ đệm OpenGL sử dụng thiết bị OpenCL nào. Được xem là hoàn tất khi các ví dụ tạo và sao chép các bộ đệm GL thông qua cùng một thiết bị mà không phụ thuộc vào việc chọn thiết bị cuối cùng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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();
}
- Ngôn ngữ chính
- C++
- Star
- 238
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của arrayfire/forge
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Replace console outputs with logging using spdlogCó thể làm lại được @9prady9 đã nhận 1936 ngày trước và không có pull request nào đang mở. Đang mởenhancement
-
Axis does not scale or moving when zooming in to chart, or moving chart.Có thể làm lại được @9prady9 đã nhận 2027 ngày trước và không có pull request nào đang mở. Đang mởenhancement feature
Tất cả issue của arrayfire/forge
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hyprwm/aquamarine#426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Winget hash mismatch for 5.0.3.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
amnezia-vpn/amnezia-client#3222 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sdatkinson/NeuralAmpModelerCore#342 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
valkey-io/valkey-search#1465 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
KhronosGroup/Vulkan-Tutorial#524 ·
Maintainer thường phản hồi trong vòng 1 ngày