TraceGPUInteraction print format error
Doug Simon
doug.simon at oracle.com
Tue Apr 22 08:35:58 UTC 2014
I’ll push this fix - thanks for catching it.
On Apr 21, 2014, at 11:14 PM, Eric Caspole <eric.caspole at amd.com> wrote:
> Hi everybody,
> There seems to be a little mistake in gpu.cpp where the "total initialized" is printing the pointer as an int and not the intended field. What's more, I think it would be better to print the count after the other work so it is clear how many devices are available.
> Thanks,
> Eric
>
>
> Currently:
>
> $ nice ./mx.sh --vm server --vmbuild product unittest -server -ea -esa -XX:+TraceGPUInteraction hsail.test.IntAddTest
> Found supported nVidia device [vendor=0x10de, device=0x1189]
> [CUDA] Ptx::Ptx::initialize
> [CUDA] Success: library linkage
> CUDA driver initialization: Success
> [CUDA] Number of compute-capable devices found: 1
> [CUDA] Got the handle of first compute-device
> [CUDA] Device 0 supports cuda compute capability 3.0
> [CUDA] Device 0 has Unified Addressing support
> [CUDA] Using GeForce GTX 670
> [CUDA] Success: Created context for device: 0
> [GPU] registered initialization of PTX (total initialized: 249372352)
> [HSAIL] library is /tmp/okraresource.dir_449166205788333768/libokra_x86_64.so
> [GPU] registered initialization of HSAIL (total initialized: 249372352)
> [CUDA] Ptx::get_execute_kernel_from_vm_address
> JUnit version 4.11
> .[HSAIL] heap=0x00007f2e08019f80
> [HSAIL] base=0x05a00000, capacity=210763776
> External method:com.oracle.graal.compiler.hsail.test.IntAddTest.run([I[I[II)V
> installCode0: ExternalCompilationResult
>
>
> With my fix:
> ]$ ./mx.sh --vm server --vmbuild debug unittest -server -ea -esa -XX:+TraceGPUInteraction -Dcom.amd.sumatra.offload.immediate=true hsail.test.IntAddTest
> Found supported nVidia device [vendor=0x10de, device=0x1189]
> [CUDA] Ptx::Ptx::initialize
> [CUDA] Success: library linkage
> CUDA driver initialization: Success
> [CUDA] Number of compute-capable devices found: 1
> [CUDA] Got the handle of first compute-device
> [CUDA] Device 0 supports cuda compute capability 3.0
> [CUDA] Device 0 has Unified Addressing support
> [CUDA] Using GeForce GTX 670
> [CUDA] Success: Created context for device: 0
> [GPU] registered initialization of PTX (total initialized: 1)
> [HSAIL] library is /tmp/okraresource.dir_5849361204469827640/libokra_x86_64.so
> [GPU] registered initialization of HSAIL (total initialized: 2)
> [CUDA] Ptx::get_execute_kernel_from_vm_address
> JUnit version 4.11
> .[HSAIL] heap=0x00007fc61c01f978
> [HSAIL] base=0x05a00000, capacity=216530944
> External method:com.oracle.graal.compiler.hsail.test.IntAddTest.run([I[I[II)V
>
>
> Here is my suggested fix:
>
> $ hg diff src/share/vm/runtime/gpu.cpp
> diff -r 9ff9f6643986 src/share/vm/runtime/gpu.cpp
> --- a/src/share/vm/runtime/gpu.cpp Sat Apr 19 12:48:19 2014 +0200
> +++ b/src/share/vm/runtime/gpu.cpp Mon Apr 21 17:07:53 2014 -0400
> @@ -32,10 +32,10 @@
> void Gpu::initialized_gpu(Gpu* gpu) {
> // GPUs are always initialized on the same thread so no need for locking
> guarantee(_initialized_gpus_count < MAX_GPUS, "oob");
> + _initialized_gpus[_initialized_gpus_count++] = gpu;
> if (TraceGPUInteraction) {
> - tty->print_cr("[GPU] registered initialization of %s (total initialized: %d)", gpu->name(), _initialized_gpus);
> + tty->print_cr("[GPU] registered initialization of %s (total initialized: %d)", gpu->name(), _initialized_gpus_count);
> }
> - _initialized_gpus[_initialized_gpus_count++] = gpu;
> }
>
> void Gpu::safepoint_event(SafepointEvent event) {
More information about the graal-dev
mailing list