Bug #315761

CUDA_DEVICE variable is ignored

Added by Felix Höfling over 3 years ago. Updated about 1 month ago.

Target version:
Start date:
Due date:
% Done:



The selection of a compute device via CUDA_DEVICE is ignored (at least for a given system configuration: 2 Kepler-GPUs and CUDA 5.5). halmd::device::device() always creates a context in device #0. The selection works if the invocation of HALMD is prefixed by nvlock.

Note that in halmd/utility/gpu/device.cpp context creation occurs indirectly via a call to cuda::thread::synchronize(), which resolves to cudaThreadSynchronize().

[The only other CUDA call in device() that cames before is cudaDriverGetVersion().]

Associated revisions

Revision 6416 (diff)
Added by felix.h.fling about 1 month ago

doc (multi-gpu): add note that `nvlock` is broken

mention CUDA_VISIBLE_DEVICES as a workaround.

This commit refs #315761.


#1 Updated by Nicolas Höft about 3 years ago

CUDA_DEVICE affect only the Driver-Based Profiler, see
In general, one should use CUDA_VISIBLE_DEVICES

#2 Updated by Felix Höfling about 3 years ago

Thanks, it didn't know about CUDA_VISIBLE_DEVICES. It must have been
introduced in some recent CUDA release. At least the following Pro Tip is
just from January this year:

Before closing the ticket we should try that it actually works with and
without nvlock.

#3 Updated by Felix Höfling about 3 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0

On top of the checks, we may also add a hint to the docs:

#4 Updated by Felix Höfling about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF