Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

V1.7.0.0 #872

Open
wants to merge 383 commits into
base: v1.7.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
383 commits
Select commit Hold shift + click to select a range
58222db
version bump
S74nk0 Nov 25, 2016
1ef193e
big config redo
S74nk0 Nov 27, 2016
15e51f1
fixes, cleanup
S74nk0 Nov 27, 2016
c276edb
Merge branch 'config_redo'
S74nk0 Nov 27, 2016
daab829
don't show warning window for unsupported CUDA devices
S74nk0 Nov 27, 2016
63e601b
CPU id fix (multiple CPU run fix)
S74nk0 Nov 28, 2016
3f5a153
changing subprojects from .NET20 to .NET45
S74nk0 Nov 28, 2016
363be68
remove support for nonprofitable algos
S74nk0 Nov 28, 2016
dd5819c
ver bump remove NVIDIA CrytoNight (unstable miner)
S74nk0 Nov 28, 2016
e2062d3
remove NVIDIA Lyra2RE support, Currency converter fixes/logic change
S74nk0 Nov 28, 2016
fded86c
AvaragedSpeed for Algorithm and use for dagger dag load checking
S74nk0 Nov 28, 2016
7b5a564
check for profitability only when SMA switch checking is called
S74nk0 Nov 28, 2016
4c76dc7
fake compute device fix needed for dagger parsing
S74nk0 Nov 28, 2016
4a23781
GetGroupName bounds checking fix
S74nk0 Nov 28, 2016
a2d2995
disable neoscrypt on Ellesmere (BSODs/does not work)
S74nk0 Nov 28, 2016
4e46902
differentiate manual and automatic (Idle) starts, fix idle no device …
S74nk0 Nov 29, 2016
7878425
AMD device detection fallback
S74nk0 Dec 1, 2016
eb44530
Add setting to disable multiple instances
S74nk0 Dec 1, 2016
e25c1b2
shrink double format print
S74nk0 Dec 1, 2016
58ab586
bus number checking fix
S74nk0 Dec 1, 2016
881a874
disable ZCash for AMD GPUs with less RAM than 2GB
S74nk0 Dec 1, 2016
8587b87
ignore prev commit changes
S74nk0 Dec 1, 2016
4547318
remove pending suffix
S74nk0 Dec 1, 2016
7189fc9
restore NVIDIA CrytoNight for SM30+
S74nk0 Dec 2, 2016
a31df1b
eqm benchmark parsing update
S74nk0 Dec 2, 2016
fc73dc7
update bins dl-link
S74nk0 Dec 2, 2016
1ee28da
Check AMD Polaris for neoscrypt exception
S74nk0 Dec 2, 2016
fc0bed3
2 critical errors fixed, config path checking, video controller poten…
S74nk0 Dec 2, 2016
d4bb889
version bump
S74nk0 Dec 2, 2016
e821905
change default labels
S74nk0 Dec 2, 2016
7484aa8
bug fixes and feature
S74nk0 Dec 5, 2016
a1f2a7f
revert .NET2.0, TODO zip module
S74nk0 Dec 5, 2016
11df41a
use 7zr.exe for uncompressing, TODO fix unziping progressbar
S74nk0 Dec 5, 2016
b3f8b6f
use copy instead of move for backup
S74nk0 Dec 5, 2016
0a13fa6
update russian translations
S74nk0 Dec 5, 2016
07673ad
increase DaggerHashimoto GPU RAM limit
S74nk0 Dec 5, 2016
9e61ee5
increase timeout, fix NVIDIA driver comparison
S74nk0 Dec 5, 2016
be0e1f6
Add WMI detection
S74nk0 Dec 6, 2016
0e27cd8
charpcompress WIP
S74nk0 Dec 6, 2016
d7733dd
update russian translations
S74nk0 Dec 6, 2016
375d81a
revert back to zip format, faster
S74nk0 Dec 6, 2016
c4a1e47
Merge branch 'sharpcompress'
S74nk0 Dec 6, 2016
e1b91dd
disable sgminer for Polaris GPUs
S74nk0 Dec 7, 2016
b6c3180
minor code changes, cpu timeout increase
S74nk0 Dec 12, 2016
0c0c0c5
remove postfix
S74nk0 Dec 12, 2016
f24ddb2
logging fix, download link update
S74nk0 Dec 12, 2016
275a45b
sharpcompress README, referenced tag version
S74nk0 Dec 12, 2016
79b4265
eqm use 2 threads per device by default, gives best performance
S74nk0 Dec 12, 2016
844eb2a
claymore zcash default intensity value fix
S74nk0 Dec 13, 2016
1243763
separate SM50 and SM52 logic regarding to new eqm update
S74nk0 Dec 25, 2016
1e4543b
update file detection list
S74nk0 Dec 25, 2016
6080c2a
claymore stratum+ssl added
S74nk0 Dec 25, 2016
81de555
version bump, dl link update
S74nk0 Dec 25, 2016
6257a6b
version bump, dl link update
S74nk0 Dec 25, 2016
ecc1145
fix eqm window hiding exception
S74nk0 Dec 26, 2016
2ca6e21
invoke exit benchmark on stop button clicked, fixes event waiting
S74nk0 Jan 3, 2017
9ba3dc5
revert eqm SM versioning exception
S74nk0 Jan 3, 2017
9fc5126
remove eqm_sm52_plus checking
S74nk0 Jan 3, 2017
6c4f378
update dl links
S74nk0 Jan 3, 2017
c983b7e
ver bump
S74nk0 Jan 3, 2017
24742f1
fix restart required for settings
S74nk0 Jan 5, 2017
2d8963a
version bump
S74nk0 Jan 6, 2017
3653936
add sgminer-gm (cryponight support)
S74nk0 Jan 9, 2017
9fe6d1a
Adding OptiminerZcash (WIP)
S74nk0 Jan 9, 2017
91acd37
added more 3rd party miners, OptminerZCash and ClaymoreCryptoNightMiner
S74nk0 Jan 11, 2017
057b9fd
claymore zcash update extra launch params
S74nk0 Jan 11, 2017
096abb7
update 3rd party dl link and bins detection
S74nk0 Jan 11, 2017
b31a573
remove sgminer-gm support (return when compatible)
S74nk0 Jan 11, 2017
188f84d
reodrer 3rd party miner TOS, rename form, fix 3rdparty algorithms whe…
S74nk0 Jan 11, 2017
4ba330f
add option to choose claymore or optminer (default claymore, first 3r…
S74nk0 Jan 11, 2017
9b1117d
add ClaymoreCryptoNight extra params parsing
S74nk0 Jan 11, 2017
9acfe05
add Optiminer extra params to parser update parser to new case
S74nk0 Jan 11, 2017
7e775fc
fix Optiminer device command string generation
S74nk0 Jan 11, 2017
d562e56
fix grouping logic
S74nk0 Jan 11, 2017
83c3337
fix claymore thred time exit issue. fixed time under 60seconds WORKS!…
S74nk0 Jan 11, 2017
ed70759
fix CPU load when benchmarking with sgminer and claymore miners
S74nk0 Jan 12, 2017
b7b0b36
restart claymore if reporting negative speeds
S74nk0 Jan 13, 2017
c51e0cd
check accepted shares for worker, update claymore params, update syst…
S74nk0 Jan 17, 2017
ed656ee
update 3rd party file checker
S74nk0 Jan 17, 2017
b38ab44
AMD algorithm list - sgminer driver exception checking
S74nk0 Jan 17, 2017
64620e7
remove pending
S74nk0 Jan 17, 2017
43bf239
fix local and web stat checking (give miners time before checking) - …
S74nk0 Jan 18, 2017
399eafd
fix local web check, claymore cryptonight optimization param for cert…
S74nk0 Jan 18, 2017
4c95963
ver bump
S74nk0 Jan 18, 2017
11b1ba5
claymore cryptonight -a 4 flag added devices
S74nk0 Jan 18, 2017
2e3f412
increase local and web stats checking (15 minute interval)
S74nk0 Jan 18, 2017
1f81b44
update translations
S74nk0 Jan 18, 2017
cd379b6
fix local and web miner checking (wait for 4 strikes before warning)
S74nk0 Jan 18, 2017
751418f
disable web check feature (until issues are resolved)
S74nk0 Jan 18, 2017
56b8764
add ToS
S74nk0 Jan 19, 2017
18a0ad7
add dagger exceptions
S74nk0 Jan 19, 2017
0e89c5b
update bins dl, enable sgminer-gm
S74nk0 Jan 20, 2017
b21b73a
add miner settings, update suported algos AMD logic
S74nk0 Jan 20, 2017
27a22df
add option to enable params parsing for NVIDIA SM21 and SM3.x
S74nk0 Jan 21, 2017
2125156
update 3rdparty dl link
S74nk0 Jan 23, 2017
edba959
fix path priority, sgminer daggerhashimoto by default, remove dagger …
S74nk0 Jan 23, 2017
60d7c3b
remove uncommented, sgminer dagger defaults
S74nk0 Jan 23, 2017
9edd375
Hawaii CryptoNight separate defaults check
S74nk0 Jan 23, 2017
128a320
ver bump
S74nk0 Jan 23, 2017
a756a57
extra launch params dagger check miner
S74nk0 Jan 23, 2017
295b6eb
miner path return fix
S74nk0 Jan 23, 2017
2e5a86c
fix default settings val
S74nk0 Jan 23, 2017
cfc86d7
comment unused code
S74nk0 Jan 23, 2017
500c086
sgminer benchmark increase wait time
S74nk0 Jan 23, 2017
82e0732
sgminer wait cryptonight restart at least 2seconds
S74nk0 Jan 23, 2017
34f5b98
revert prev commit
S74nk0 Jan 23, 2017
07ec672
fix sgminer daggerhashimoto benchmark parsing
S74nk0 Jan 23, 2017
e1d45d9
AMD Temp control disabled by default
S74nk0 Jan 24, 2017
e4d012a
fix claymore parsing flag, very minor fixes
S74nk0 Jan 27, 2017
1ab19aa
ver bump
S74nk0 Jan 30, 2017
651351b
claymore miners remove log file creation
S74nk0 Jan 31, 2017
e467ea7
Claymore cryptonight ssl support
S74nk0 Feb 3, 2017
ff88a73
added multiminer per algo support (broken WIP)
S74nk0 Feb 3, 2017
9f53de5
multi miner per algo (GUI fixes, WIP)
S74nk0 Feb 3, 2017
d40c4b3
ExtraLaunchParams redo (added internal configs)
S74nk0 Feb 3, 2017
09c61ee
add pascal enum, change miner factory, grouping speed avarager
S74nk0 Feb 4, 2017
01dcb88
NVIDIA Pascal miner support
S74nk0 Feb 4, 2017
9e13099
replace sgminer general, add Pascal for AMD
S74nk0 Feb 4, 2017
4396b24
fix benchmark indicator
S74nk0 Feb 4, 2017
4d5d499
remove API bind port changing when restarting miner
S74nk0 Feb 4, 2017
6be524c
added deterministic and automatic API port settings, remove unused co…
S74nk0 Feb 4, 2017
50ff7f9
fixes
S74nk0 Feb 5, 2017
9bdb346
remove pending
S74nk0 Feb 5, 2017
b3ffd5d
final changes
S74nk0 Feb 5, 2017
64370de
fix claymore CryptoNight extra launch params, add fallback to load mi…
S74nk0 Feb 6, 2017
7b7b5e5
fix default optimization params for sgminer CryptoNight
S74nk0 Feb 6, 2017
c6ec4cf
remove unused code, fix miner exit status chack
S74nk0 Feb 6, 2017
3fb1511
excavator extra launch params added
S74nk0 Feb 6, 2017
2b23ca7
Merge pull request #1 from nicehash/master
Feb 6, 2017
7fa7fcd
Added Spanish translation
Feb 6, 2017
cb1fc60
Fixed some mistakes.
Feb 6, 2017
2f5f4b9
tos update, profit threshold setting
S74nk0 Feb 7, 2017
2e74713
russian lang update
S74nk0 Feb 7, 2017
37f376a
Optiminer host resolve issue fixed
S74nk0 Feb 7, 2017
a9083b1
change ccminer cryptonight default param value
S74nk0 Feb 7, 2017
3eb56d8
Added missing lines from the last update (1.7.4.5)
Feb 7, 2017
05efca5
Update es.lang
Feb 7, 2017
3bd8b2f
Merge pull request #593 from boomtnt46/master
S74nk0 Feb 7, 2017
68de8a5
changes
S74nk0 Feb 7, 2017
dc0c580
Merge branch 'master' of https://github.com/nicehash/NiceHashMiner
S74nk0 Feb 7, 2017
7b971b7
Merge pull request #2 from nicehash/master
Feb 7, 2017
368f429
Fix the lang
Feb 7, 2017
3df24e4
remove sgminer kernel copy
S74nk0 Feb 7, 2017
6214e7d
start minimized no hide windows when hide setting enabled
S74nk0 Feb 9, 2017
2ae366a
added XmrStackCPUMiner support
S74nk0 Feb 9, 2017
cbcdc74
remove nheqminer AMD support, sort by algorithms first
S74nk0 Feb 9, 2017
36142f7
AMD disable by default, remove old sgminer support
S74nk0 Feb 9, 2017
128f148
updates
S74nk0 Feb 13, 2017
b209ad1
AMD,NVIDIA enable sibcoin X11-Gost algorithm
S74nk0 Feb 13, 2017
2657141
remove eqm for CPU, CPU AES mandatory detection
S74nk0 Feb 13, 2017
3155f8d
fix sgminer sibcoin kernel
S74nk0 Feb 13, 2017
027243c
sibcoin sgminer default optimizations
S74nk0 Feb 13, 2017
f886333
Parameter parser set do not ignore defaults
S74nk0 Feb 13, 2017
f1a368e
Parameter parser set do not ignore defaults, fix passed value
S74nk0 Feb 13, 2017
9a1e26c
ver bump, benchmakr logging, algo cleanup
S74nk0 Feb 14, 2017
13d2133
logger init error catching
S74nk0 Feb 14, 2017
ce17099
win form leave event handling fix
S74nk0 Feb 14, 2017
1885055
disable unstable algos for SM6.x
S74nk0 Feb 14, 2017
15265ef
fix benchmark logging
S74nk0 Feb 15, 2017
2ed1ffc
xmr hyperthreading optimization config, revert parser settings
S74nk0 Feb 16, 2017
41f6c4c
speed parse fix, new miner added
S74nk0 Feb 17, 2017
c6cf02a
changes
S74nk0 Feb 17, 2017
fec7da3
fixes
S74nk0 Feb 17, 2017
60f4f91
remove dll checks
S74nk0 Feb 18, 2017
930e1a5
separate ccminer_unstable group
S74nk0 Feb 18, 2017
32ce5d8
rename miner base name
S74nk0 Feb 18, 2017
fb79546
don't half threads for xmr
S74nk0 Feb 20, 2017
ba097d7
fixes (xmr dual cpu, default optimizations, minox GUI fixes,...) adde…
S74nk0 Feb 27, 2017
cd6d723
fix height calculation (GUI BUG)
S74nk0 Feb 27, 2017
c6a4f69
update 3rd party dl link, check ClaymoreDual miner
S74nk0 Feb 27, 2017
b6d366a
sgminer benchmark seconds fix
S74nk0 Feb 28, 2017
997bf42
claymore zec test -asm when benchmarking
S74nk0 Feb 28, 2017
1988262
Fix Claymore default optimization settings
S74nk0 Feb 28, 2017
9767dad
update bins dl link
S74nk0 Feb 28, 2017
5845b2c
add needed space
S74nk0 Feb 28, 2017
8dc28dc
fix warning notice
S74nk0 Mar 1, 2017
f0d15d9
XMR culture invariant parse fix
S74nk0 Mar 1, 2017
f34a7cb
add '--remove-disabled' by default for sgminer
S74nk0 Mar 1, 2017
5c62ff5
double parse extra check
S74nk0 Mar 1, 2017
366e23f
AMD remove NeoScrypt
S74nk0 Mar 1, 2017
0b9c99c
claymore subtract fee from benchmark
S74nk0 Mar 1, 2017
38e3aaa
fixes, claymore dual aditional params
S74nk0 Mar 2, 2017
de5f759
AMD algorithms list change
S74nk0 Mar 2, 2017
eabb403
fix stopwatch, total elapsed checks, fix benchmark infinite loops
S74nk0 Mar 2, 2017
6fcf499
fix benchmark msg
S74nk0 Mar 2, 2017
7486594
AMD dev detection disable pretty print
S74nk0 Mar 2, 2017
02bc7c5
dev detection disable pretty print by default
S74nk0 Mar 3, 2017
af1b015
add convenience parameter for ClaymoreDual, dual mining partly supported
S74nk0 Mar 3, 2017
ea5cea6
ClaymoreDual fix workername, OptiminerZcash wait before API call (fix…
S74nk0 Mar 6, 2017
d459692
disable double warning
S74nk0 Mar 7, 2017
0e8bc51
Merge pull request #599 from boomtnt46/master
S74nk0 Mar 7, 2017
fe6dab0
fix possible sgminer dagger parsing
S74nk0 Mar 7, 2017
3ee4987
Merge branch 'master' of https://github.com/nicehash/NiceHashMiner
S74nk0 Mar 7, 2017
9541546
Get button in context menu
DillonN Mar 5, 2017
9b0fc0a
Added text language (google translate)
DillonN Mar 5, 2017
382fb00
Functioning clear speed
DillonN Mar 5, 2017
6a98056
Benchmark queue fix
DillonN Mar 5, 2017
89558c8
Fixed settings clearing
DillonN Mar 5, 2017
097b857
Added null check
DillonN Mar 5, 2017
9d65c1e
Another null check
DillonN Mar 5, 2017
6b22bd7
Formatting
DillonN Mar 5, 2017
479badd
Changed wording
DillonN Mar 8, 2017
46f8c2c
Merge pull request #709 from DillonN/clear_context
S74nk0 Mar 8, 2017
c18ae1f
remove double warnings (GUI fix)
S74nk0 Mar 8, 2017
e186f87
Merge branch 'master' of https://github.com/nicehash/NiceHashMiner
S74nk0 Mar 8, 2017
97f806c
update NVIDIA driver notice (En)
S74nk0 Mar 9, 2017
067e20e
sgminer check status for enabled GPUs only
S74nk0 Mar 9, 2017
32a9d7a
GUI fixes
S74nk0 Mar 9, 2017
3fabd1d
update ru translation
S74nk0 Mar 9, 2017
b3b9876
ver bump
S74nk0 Mar 10, 2017
91fad46
clamore zcash -asm test reorder
S74nk0 Mar 10, 2017
88f790c
ClaymoreDual update, dl 3rdparty update, fixes
S74nk0 Mar 15, 2017
18bd432
fix auto -asm check, remove unused GUI setting
S74nk0 Mar 15, 2017
ed9e0c3
ver bump, note pre-release
S74nk0 Mar 15, 2017
6202422
change unreadable code
S74nk0 Mar 15, 2017
42f52e2
set sys env vars for specific miner process
S74nk0 Mar 15, 2017
e9567f7
fix, ver bump
S74nk0 Mar 15, 2017
9ebebe6
make ClaymoreDual default
S74nk0 Mar 16, 2017
1fad994
add experimental miner base for unstable miners/algorithms
S74nk0 Mar 16, 2017
8c0fb6d
remove unused, not setting Env vars globaly only per process
S74nk0 Mar 16, 2017
52406fe
dispose unused reference (fixes downoaded zip deletes)
S74nk0 Mar 16, 2017
d01c72f
Merge branch 'ns_experimental'
S74nk0 Mar 16, 2017
2d8d08f
pre-rel ver bump
S74nk0 Mar 16, 2017
7d8ef50
remove pre-release postfix
S74nk0 Mar 16, 2017
92a3893
version bump
S74nk0 Mar 16, 2017
b1c673e
remove eqm, use new excavator instead, cleanup
S74nk0 Mar 17, 2017
4a87d96
Set Default env vars for running user alongside process env vars
S74nk0 Mar 19, 2017
2590bc9
minor postfix ver change
S74nk0 Mar 19, 2017
2913eb5
excavator SM50 default param fix, other minor fixes
S74nk0 Mar 20, 2017
3466add
excavator fix -ct extra launch params handling, set default 0 for -c1…
S74nk0 Mar 23, 2017
6b202a6
excavator SM5.0 default param update
S74nk0 Mar 24, 2017
f1f0f61
nheqminer check GPU compatibility
S74nk0 Mar 24, 2017
61f27ef
pre-rel ver change
S74nk0 Mar 24, 2017
3187eb2
version bump
S74nk0 Mar 24, 2017
fc9443e
nvml.dll copy if newer
S74nk0 Mar 24, 2017
723623d
extra file check
S74nk0 Mar 24, 2017
d24a7c5
fix
S74nk0 Mar 24, 2017
303eb59
fixes
S74nk0 Mar 27, 2017
fe0f8b0
reorder logging
S74nk0 Apr 3, 2017
51c77fe
fix profitability calculation switch
S74nk0 Apr 6, 2017
875d969
update claymore dual binary and add new flag support
S74nk0 Apr 6, 2017
725d29f
updated bins, ver bump, pre-release
S74nk0 Apr 10, 2017
f48d54b
xmr full range test, ht mode added
S74nk0 Apr 10, 2017
c02e13c
version bump, remove pre-release label
S74nk0 Apr 11, 2017
52663df
ver bump, decred miners update
S74nk0 Apr 24, 2017
fadbb6b
change exchange rate API
S74nk0 May 11, 2017
6ee0434
profit calc fix (restore old state when no switch), sma-get fix
S74nk0 May 11, 2017
4934c5a
pre release
S74nk0 May 11, 2017
563d238
use https
S74nk0 May 12, 2017
5fe98dc
Merge pull request #1 from nicehash/master
Alusssssss May 13, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 3rdparty/sharpcompress-0.11/LinqBridge.dll
Binary file not shown.
1 change: 1 addition & 0 deletions 3rdparty/sharpcompress-0.11/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libraries are built against this [tag version](https://github.com/adamhathcock/sharpcompress/tree/0.11)
Binary file added 3rdparty/sharpcompress-0.11/SharpCompress.dll
Binary file not shown.
147 changes: 88 additions & 59 deletions AMDOpenCLDeviceDetection/AMDOpenCLDeviceDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,46 +57,52 @@ bool AMDOpenCLDeviceDetection::QueryDevices() {
else {
for (auto i_pId = 0u; i_pId < platforms.size(); ++i_pId) {
string platformName = StringnNullTerminatorFix(platforms[i_pId].getInfo<CL_PLATFORM_NAME>());
_platformNumbers.emplace(make_pair(platformName, i_pId));
// not the best way but it should work
bool isAMD = platformName.find("AMD", 0) != string::npos;
vector<OpenCLDevice> platformDevs;
auto clDevs = getDevices(platforms, i_pId);
for (auto i_devId = 0u; i_devId < clDevs.size(); ++i_devId) {
OpenCLDevice curDevice;
curDevice.DeviceID = i_devId;
curDevice._CL_DEVICE_NAME = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_NAME>());
switch (clDevs[i_devId].getInfo<CL_DEVICE_TYPE>()) {
case CL_DEVICE_TYPE_CPU:
curDevice._CL_DEVICE_TYPE = "CPU";
break;
case CL_DEVICE_TYPE_GPU:
curDevice._CL_DEVICE_TYPE = "GPU";
break;
case CL_DEVICE_TYPE_ACCELERATOR:
curDevice._CL_DEVICE_TYPE = "ACCELERATOR";
break;
default:
curDevice._CL_DEVICE_TYPE = "DEFAULT";
break;
}

curDevice._CL_DEVICE_GLOBAL_MEM_SIZE = clDevs[i_devId].getInfo<CL_DEVICE_GLOBAL_MEM_SIZE>();
curDevice._CL_DEVICE_VENDOR = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_VENDOR>());
curDevice._CL_DEVICE_VERSION = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_VERSION>());
curDevice._CL_DRIVER_VERSION = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DRIVER_VERSION>());
if (std::find(_platformNames.begin(), _platformNames.end(), platformName) == _platformNames.end()) {
JsonLog current;
_platformNames.push_back(platformName);
// new
current.PlatformName = platformName;
current.PlatformNum = i_pId;

// not the best way but it should work
bool isAMD = platformName.find("AMD", 0) != string::npos;
auto clDevs = getDevices(platforms, i_pId);
for (auto i_devId = 0u; i_devId < clDevs.size(); ++i_devId) {
OpenCLDevice curDevice;
curDevice.DeviceID = i_devId;
curDevice._CL_DEVICE_NAME = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_NAME>());
switch (clDevs[i_devId].getInfo<CL_DEVICE_TYPE>()) {
case CL_DEVICE_TYPE_CPU:
curDevice._CL_DEVICE_TYPE = "CPU";
break;
case CL_DEVICE_TYPE_GPU:
curDevice._CL_DEVICE_TYPE = "GPU";
break;
case CL_DEVICE_TYPE_ACCELERATOR:
curDevice._CL_DEVICE_TYPE = "ACCELERATOR";
break;
default:
curDevice._CL_DEVICE_TYPE = "DEFAULT";
break;
}

// AMD topology get Bus No
if (isAMD) {
cl_device_topology_amd topology = clDevs[i_devId].getInfo<CL_DEVICE_TOPOLOGY_AMD>();
if (topology.raw.type == CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD) {
curDevice.AMD_BUS_ID = (int)topology.pcie.bus;
curDevice._CL_DEVICE_GLOBAL_MEM_SIZE = clDevs[i_devId].getInfo<CL_DEVICE_GLOBAL_MEM_SIZE>();
curDevice._CL_DEVICE_VENDOR = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_VENDOR>());
curDevice._CL_DEVICE_VERSION = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DEVICE_VERSION>());
curDevice._CL_DRIVER_VERSION = StringnNullTerminatorFix(clDevs[i_devId].getInfo<CL_DRIVER_VERSION>());

// AMD topology get Bus No
if (isAMD) {
cl_device_topology_amd topology = clDevs[i_devId].getInfo<CL_DEVICE_TOPOLOGY_AMD>();
if (topology.raw.type == CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD) {
curDevice.AMD_BUS_ID = (int)topology.pcie.bus;
}
}
}

platformDevs.push_back(curDevice);
current.Devices.push_back(curDevice);
}
_devicesPlatformsDevices.push_back(current);
}
_devicesPerPlatform.emplace(make_pair(platformName, platformDevs));
}
}
}
Expand All @@ -113,28 +119,18 @@ bool AMDOpenCLDeviceDetection::QueryDevices() {

// this function is hardcoded and horrable
void AMDOpenCLDeviceDetection::PrintDevicesJson() {
cout << "{" << endl;
cout << "[" << endl;

// platforms array scope
{
cout << "\t\"OCLPlatforms\" : {" << endl;
int platformsComma = _platformNumbers.size();
for (const auto &plat_name_num : _platformNumbers) {
cout << "\t\t\"" + plat_name_num.first + "\" : "
<< plat_name_num.second << COMMA(platformsComma)
<< endl;
}
cout << "\t}," << endl;
}
// device per platform array scope
{
int devPlatformsComma = _devicesPerPlatform.size();
cout << "\t\"OCLPlatformDevices\" : {" << endl;
for (const auto &plat_name_devs : _devicesPerPlatform) {
cout << "\t\t\"" + plat_name_devs.first + "\" : [" << endl;
int devPlatformsComma = _devicesPlatformsDevices.size();
for (const auto &jsonLog : _devicesPlatformsDevices) {
cout << "\t{" << endl;
cout << "\t\t\"PlatformName\": \"" << jsonLog.PlatformName << "\"" << "," << endl;
cout << "\t\t\"PlatformNum\": " << jsonLog.PlatformNum << "," << endl;
cout << "\t\t\"Devices\" : [" << endl;
// device print
int devComma = plat_name_devs.second.size();
for (const auto &dev : plat_name_devs.second) {
int devComma = jsonLog.Devices.size();
for (const auto &dev : jsonLog.Devices) {
cout << "\t\t\t{" << endl;
cout << "\t\t\t\t\"" << "DeviceID" << "\" : " << dev.DeviceID << "," << endl; // num
cout << "\t\t\t\t\"" << "AMD_BUS_ID" << "\" : " << dev.AMD_BUS_ID << "," << endl; // num
Expand All @@ -146,10 +142,43 @@ void AMDOpenCLDeviceDetection::PrintDevicesJson() {
cout << "\t\t\t\t\"" << "_CL_DRIVER_VERSION" << "\" : \"" << dev._CL_DRIVER_VERSION << "\"" << endl;
cout << "\t\t\t}" << COMMA(devComma) << endl;
}
cout << "\t\t]" << COMMA(devPlatformsComma) << endl;
cout << "\t\t]" << endl;
cout << "\t}" << COMMA(devPlatformsComma) << endl;
}
cout << "\t}" << endl;
}

cout << "}" << endl;
}
cout << "]" << endl;
}


void AMDOpenCLDeviceDetection::PrintDevicesJsonDirty() {
cout << "[";

{
int devPlatformsComma = _devicesPlatformsDevices.size();
for (const auto &jsonLog : _devicesPlatformsDevices) {
cout << "{";
cout << "\"PlatformName\": \"" << jsonLog.PlatformName << "\"" << ",";
cout << "\"PlatformNum\": " << jsonLog.PlatformNum << ",";
cout << "\"Devices\" : [";
// device print
int devComma = jsonLog.Devices.size();
for (const auto &dev : jsonLog.Devices) {
cout << "{";
cout << "\"" << "DeviceID" << "\" : " << dev.DeviceID << ","; // num
cout << "\"" << "AMD_BUS_ID" << "\" : " << dev.AMD_BUS_ID << ","; // num
cout << "\"" << "_CL_DEVICE_NAME" << "\" : \"" << dev._CL_DEVICE_NAME << "\",";
cout << "\"" << "_CL_DEVICE_TYPE" << "\" : \"" << dev._CL_DEVICE_TYPE << "\",";
cout << "\"" << "_CL_DEVICE_GLOBAL_MEM_SIZE" << "\" : " << dev._CL_DEVICE_GLOBAL_MEM_SIZE << ","; // num
cout << "\"" << "_CL_DEVICE_VENDOR" << "\" : \"" << dev._CL_DEVICE_VENDOR << "\",";
cout << "\"" << "_CL_DEVICE_VERSION" << "\" : \"" << dev._CL_DEVICE_VERSION << "\",";
cout << "\"" << "_CL_DRIVER_VERSION" << "\" : \"" << dev._CL_DRIVER_VERSION << "\"";
cout << "}" << COMMA(devComma);
}
cout << "]";
cout << "}" << COMMA(devPlatformsComma);
}
}

cout << "]" << endl;
}
13 changes: 11 additions & 2 deletions AMDOpenCLDeviceDetection/AMDOpenCLDeviceDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#define __CL_ENABLE_EXCEPTIONS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#define CL_VERSION_1_2
//#define CL_USE_DEPRECATED_OPENCL_1_1_APIS

#include "cl_ext.hpp"

Expand All @@ -12,21 +14,28 @@

#include "OpenCLDevice.h"

struct JsonLog {
std::string PlatformName;
int PlatformNum;
std::vector<OpenCLDevice> Devices;
};

class AMDOpenCLDeviceDetection {
public:
AMDOpenCLDeviceDetection();
~AMDOpenCLDeviceDetection();

bool QueryDevices();
void PrintDevicesJson();
void PrintDevicesJsonDirty();

private:

static std::vector<cl::Device> getDevices(std::vector<cl::Platform> const& _platforms, unsigned _platformId);
static std::vector<cl::Platform> getPlatforms();

std::map<std::string, std::vector<OpenCLDevice>> _devicesPerPlatform;
std::map<std::string, int> _platformNumbers;
std::vector<std::string> _platformNames;
std::vector<JsonLog> _devicesPlatformsDevices;

static std::string StringnNullTerminatorFix(const std::string& str);
};
83 changes: 83 additions & 0 deletions AMDOpenCLDeviceDetection/AMDOpenCLDeviceDetection.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand All @@ -22,31 +30,56 @@
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
Expand All @@ -67,6 +100,29 @@
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>.;$(AMDAPPSDKROOT)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OpenCL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(AMDAPPSDKROOT)\lib\x86\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -94,6 +150,33 @@ copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Micro
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>.;$(AMDAPPSDKROOT)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(AMDAPPSDKROOT)\lib\x86\</AdditionalLibraryDirectories>
<AdditionalDependencies>OpenCL.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down
9 changes: 7 additions & 2 deletions AMDOpenCLDeviceDetection/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#include "AMDOpenCLDeviceDetection.h"

int main() {
int main(int argc, char* argv[]) {
AMDOpenCLDeviceDetection AMDOpenCLDeviceDetection;
if (AMDOpenCLDeviceDetection.QueryDevices()) {
AMDOpenCLDeviceDetection.PrintDevicesJson();
if (argc < 2) {
AMDOpenCLDeviceDetection.PrintDevicesJsonDirty();
}
else {
AMDOpenCLDeviceDetection.PrintDevicesJson();
}
}
return 0;
}
Expand Down
Loading