Skip to content

Fixed the --device command line option to actually work

Rainer Schwemmer requested to merge rainer_device_select_fix into master

Fixed the --device command line option to actually work. cuda_set_device only sets the device for the thread it is called in. It is currently called only in the main thread. When the stream threads are launched, they do NOT inherit this setting and will fall back to device 0. This discrepancy prevents the mechanism from working (Im guessing the streams get the device props of the main thread, but the thread actually runs with a different device). I have now added the same cuda_set_device code in the execute part of every stream thread and the correct device is selected now and Allen continues working. Additionally, i found that in the new multi RTX2080 setup we built, the CUDA_VISIBLE_DEVICES environment variable causes some strange effects that prevent the cards from running at their max TDP and performance is terrible. Setting it from inside allen addresses this problem too.

Edited by Rainer Schwemmer

Merge request reports