Project

General

Profile

Bug #315761

CUDA_DEVICE variable is ignored

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

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
Due date:
% Done:

0%


Description

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.

History

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

CUDA_DEVICE affect only the Driver-Based Profiler, see http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
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:
http://devblogs.nvidia.com/parallelforall/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/

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:
http://halmd.org/usage/multi-gpu.html

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

  • Status changed from Resolved to Closed

Also available in: Atom PDF