diff --git a/CLINFO_LICENSE b/CLINFO_LICENSE
new file mode 100644
index 000000000..b238ac5a5
--- /dev/null
+++ b/CLINFO_LICENSE
@@ -0,0 +1,19 @@
+Windows binaries obtained from the clinfo repo fork here:
+
+https://github.com/ahoylabs/clinfo/releases/tag/master-d2baa06
+
+Source available here:
+https://github.com/Oblomov/clinfo
+
+see below LICENSE file for details on clinfo license
+
+=======
+
+clinfo by Giuseppe Bilotta
+
+To the extent possible under law, the person who associated CC0 with
+clinfo has waived all copyright and related or neighboring rights
+to clinfo.
+
+You should have received a copy of the CC0 legalcode along with this
+work. If not, see
diff --git a/koboldcpp.py b/koboldcpp.py
index 7e8529ec6..d963b87ba 100755
--- a/koboldcpp.py
+++ b/koboldcpp.py
@@ -1067,17 +1067,24 @@ def show_new_gui():
FetchedCUdevices = []
FetchedCUdeviceMem = []
try: # Get OpenCL GPU names on windows using a special binary. overwrite at known index if found.
- if os.name == 'nt':
- basepath = os.path.abspath(os.path.dirname(__file__))
- output = run([os.path.join(basepath, "simpleclinfo.exe")], capture_output=True, text=True, check=True, encoding='utf-8').stdout
- for line in output.splitlines():
- pd = line.split("=")[0].strip()
- name = line.split("=")[1].strip()
- plat = int(pd.split(" ")[0].strip())
- dev = int(pd.split(" ")[1].strip())
+ basepath = os.path.abspath(os.path.dirname(__file__))
+ output = run([((os.path.join(basepath, "winclinfo.exe")) if os.name == 'nt' else "clinfo"),"--json"], capture_output=True, text=True, check=True, encoding='utf-8').stdout
+ data = json.loads(output)
+ plat = 0
+ dev = 0
+ lowestclmem = 0
+ for platform in data["devices"]:
+ dev = 0
+ for device in platform["online"]:
+ dname = device["CL_DEVICE_NAME"]
+ dmem = int(device["CL_DEVICE_GLOBAL_MEM_SIZE"])
idx = plat+dev*2
if idx