-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU/GC abstraction #2
Comments
I might as well do OpenGL first and then D3D11 afterwards, just to verify a few extra bits of information... |
OpenGL is literal hell on earth, I cri everytiem Ref: #2
So, Using OpenGL/OpenCL/D3D is only ever going to be a half-assed way of handling this. It's never going to give us all the information we need, just things like "and hey, this is how capable your DirectX Card is"/""this is how capable your OpenGL card is". We might want to relegate DirectX capabilities of a GPU device to either OpenGL / DirectX, and depending on |
We don't have any DX caps as of now (and your comment is the only mention of DX here) so we can't relegate them. |
FYI the GPU memory size is incorrect for my 8GiB RX580 Series card, it just shows 3Gib. |
Which detector (D3D/OCL/OGL)? |
@captainwong ping |
The following patch adds (max) GPU clock speed via OpenCL. Problem is, despite purportedly an API existing for that on Winblows, I couldn't find it. diff --git a/include/infoware/gpu.hpp b/include/infoware/gpu.hpp
index c77a300..fa88b01 100644
--- a/include/infoware/gpu.hpp
+++ b/include/infoware/gpu.hpp
@@ -34,6 +34,7 @@ namespace iware {
std::string name;
std::size_t memory_size;
std::size_t cache_size;
+ std::uint64_t max_frequency;
};
diff --git a/src/gpu/memory/OpenCL.cpp b/src/gpu/memory/OpenCL.cpp
index c1a4d6c..9ab9d55 100644
--- a/src/gpu/memory/OpenCL.cpp
+++ b/src/gpu/memory/OpenCL.cpp
@@ -51,13 +51,15 @@ std::vector<iware::gpu::device_properties_t> iware::gpu::device_properties() {
char vendorname[256];
cl_ulong cache;
cl_ulong memory;
+ cl_uint max_frequency;
clGetDeviceInfo(devices[j], CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, sizeof(cache), &cache, nullptr);
+ clGetDeviceInfo(devices[j], CL_DEVICE_MAX_CLOCK_FREQUENCY, sizeof(max_frequency), &max_frequency, nullptr);
clGetDeviceInfo(devices[j], CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(memory), &memory, nullptr);
clGetDeviceInfo(devices[j], CL_DEVICE_VENDOR, sizeof(vendorname) / sizeof(*vendorname), &vendorname, nullptr);
clGetDeviceInfo(devices[j], CL_DEVICE_NAME, sizeof(name) / sizeof(*name), &name, nullptr);
- ret.push_back({parse_vendor(vendorname), name, memory, cache});
+ ret.push_back({parse_vendor(vendorname), name, memory, cache, max_frequency});
}
}
diff --git a/src/gpu/memory/d3d.cpp b/src/gpu/memory/d3d.cpp
index e7933c3..95178dc 100644
--- a/src/gpu/memory/d3d.cpp
+++ b/src/gpu/memory/d3d.cpp
@@ -57,7 +57,7 @@ std::vector<iware::gpu::device_properties_t> iware::gpu::device_properties() {
auto device = iware::detail::identify_device(adapterdesc.VendorId, adapterdesc.DeviceId);
std::string device_name = device.device_name ? device.device_name : iware::detail::narrowen_winstring(adapterdesc.Description);
- devices.push_back({vendor_from_name(device.vendor_name), device_name, adapterdesc.DedicatedVideoMemory, adapterdesc.SharedSystemMemory});
+ devices.push_back({vendor_from_name(device.vendor_name), device_name, adapterdesc.DedicatedVideoMemory, adapterdesc.SharedSystemMemory, 0});
}
return devices;
} |
Played around with HIP – it's a whole thing and beyond the scope of me being able to build it (at least at this current moment). |
Functional on OpenCL, dead on D3D because I couldn't find the API that supposedly exists for that Ref: #2
Functional on OpenCL, dead on D3D because I couldn't find the API that supposedly exists for that Ref: #2
==> tarta <== Infoware version 0.6.0 Properties: Device #1: Vendor : Unknown Name : llvmpipe (LLVM 15.0.6, 128 bits) RAM size : 2147483648B Cache size : 0B Max frequency: 0Hz ==> chrust <== Infoware version 0.6.0 Properties: Device #1: Vendor : Intel Name : Intel(R) UHD Graphics 600 (GLK 2) RAM size : 1986174976B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 17.0.6, 128 bits) RAM size : 3972349952B Cache size : 0B Max frequency: 0Hz ==> nabuter <== Infoware version 0.6.0 Properties: Device #1: Vendor : AMD Name : AMD Radeon RX 5700 XT RAM size : 16866344960B Cache size : 0B Max frequency: 0Hz ==> rozbian <== Infoware version 0.6.0 Properties: Device #1: Vendor : AMD Name : AMD Radeon RX 6500 XT (RADV NAVI24) RAM size : 37947559936B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 17.0.6, 256 bits) RAM size : 67338743808B Cache size : 0B Max frequency: 0Hz ==> babtop <== Infoware version 0.6.0 Properties: Device #1: Vendor : Intel Name : Intel(R) UHD Graphics (AML-CFL) RAM size : 12505884672B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 16.0.6, 256 bits) RAM size : 16674512896B Cache size : 0B Max frequency: 0Hz
==> tarta <== Infoware version 0.6.0 Properties: Device #1: Vendor : Unknown Name : llvmpipe (LLVM 15.0.6, 128 bits) RAM size : 2147483648B Cache size : 0B Max frequency: 0Hz ==> chrust <== Infoware version 0.6.0 Properties: Device #1: Vendor : Intel Name : Intel(R) UHD Graphics 600 (GLK 2) RAM size : 1986174976B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 17.0.6, 128 bits) RAM size : 3972349952B Cache size : 0B Max frequency: 0Hz ==> nabuter <== Infoware version 0.6.0 Properties: Device #1: Vendor : AMD Name : AMD Radeon RX 5700 XT RAM size : 16866344960B Cache size : 0B Max frequency: 0Hz ==> rozbian <== Infoware version 0.6.0 Properties: Device #1: Vendor : AMD Name : AMD Radeon RX 6500 XT (RADV NAVI24) RAM size : 37947559936B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 17.0.6, 256 bits) RAM size : 67338743808B Cache size : 0B Max frequency: 0Hz ==> babtop <== Infoware version 0.6.0 Properties: Device #1: Vendor : Intel Name : Intel(R) UHD Graphics (AML-CFL) RAM size : 12505884672B Cache size : 0B Max frequency: 0Hz Device #2: Vendor : Unknown Name : llvmpipe (LLVM 16.0.6, 256 bits) RAM size : 16674512896B Cache size : 0B Max frequency: 0Hz
We need a way of finding out all relevant GPU information. This issue will be for what should theoretically be in there.
The text was updated successfully, but these errors were encountered: