Skip to content

Commit

Permalink
OpenCL as default for GPU mining
Browse files Browse the repository at this point in the history
  • Loading branch information
Albermonte committed Aug 26, 2020
1 parent d03115c commit 69d5da5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
61 changes: 60 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,66 @@
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp"
"xloctime": "cpp",
"algorithm": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"exception": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ratio": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"xthread": "cpp",
"thread": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xmemory": "cpp",
"xmemory0": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
},
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ const startMining = async (gpu = false) => {
const priority = Object.entries(constants.priority)[
store.state.settings.cpuPriority
];
setPriority(priority[1]);
try {
setPriority(priority[1]);
} catch (error) {
console.error("Set CPU Priority Failed: ", error);
}

const deviceName = store.state.settings.deviceName;
const maxThreads = store.state.settings.cpuThreads;
Expand Down Expand Up @@ -219,7 +223,7 @@ const startMining = async (gpu = false) => {
});
} else {
const vendor = (await graphics()).controllers[0].vendor;
const type = vendor.includes("Advanced Micro Devices") ? "opencl" : "cuda";
const type = vendor.includes("NVIDIA") ? "cuda" : "opencl";
console.log(`GPU Type: ${type}`);

const argv = {
Expand Down

0 comments on commit 69d5da5

Please sign in to comment.