From fc422c92b4230c46eea5644226a11f09bcba8561 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Tue, 22 Oct 2024 21:28:12 +0000 Subject: [PATCH] cuda --- cuda/Makefile.am | 52 ++++++++++++++++++----------------------------- xprof/xprof.rb.in | 2 +- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/cuda/Makefile.am b/cuda/Makefile.am index d8093bc7..6a326a50 100644 --- a/cuda/Makefile.am +++ b/cuda/Makefile.am @@ -280,46 +280,34 @@ libcudarttracepoints_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/i libcudarttracepoints_la_CFLAGS = $(LTTNG_UST_CFLAGS) libcudarttracepoints_la_LDFLAGS = $(LTTNG_UST_LIBS) -lib_LTLIBRARIES = libTracerCUDA.la libTracerCUDART.la libCUDAInterval.la +cudadir = $(pkglibdir)/cuda +cuda_LTLIBRARIES = libcuda.la -nodist_libTracerCUDA_la_SOURCES = \ +cudartdir = $(pkglibdir)/cudart +cudart_LTLIBRARIES = libcudart.la + +bt2dir = $(pkglibdir)/bt2 +bt2_LTLIBRARIES = libCUDAInterval.la + +nodist_libcuda_la_SOURCES = \ $(CUDA_PROBES_INCL) \ tracer_cuda.c -libTracerCUDA_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./ -libTracerCUDA_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS) -libTracerCUDA_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la -libTracerCUDA_la_LDFLAGS += -version-info 1:0:0 -libTracerCUDA_la_LIBADD = libcudatracepoints.la +libcuda_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./ +libcuda_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS) +libcuda_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la +libcuda_la_LDFLAGS += -version-info 1:0:0 +libcuda_la_LIBADD = libcudatracepoints.la -nodist_libTracerCUDART_la_SOURCES = \ +nodist_libcudart_la_SOURCES = \ $(CUDART_PROBES_INCL) \ tracer_cudart.c -libTracerCUDART_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./ -libTracerCUDART_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS) -libTracerCUDART_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la -libTracerCUDART_la_LDFLAGS += -version-number 12:1:55 -Wl,--version-script,tracer_cudart.map -libTracerCUDART_la_LIBADD = libcudarttracepoints.la - -install-exec-hook: - $(MKDIR_P) $(DESTDIR)$(pkglibdir)/cudart - $(MKDIR_P) $(DESTDIR)$(pkglibdir)/cuda - $(LN_S) -f $(DESTDIR)$(libdir)/libTracerCUDART.so.12.1.55 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 - $(LN_S) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so - $(LN_S) -f $(DESTDIR)$(libdir)/libTracerCUDA.so.1.0.0 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 - $(LN_S) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so - $(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2 - $(LN) -f $(DESTDIR)$(libdir)/libCUDAInterval.so $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so - - -uninstall-hook: - $(RM) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so - $(RM) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so - -rmdir $(DESTDIR)$(pkglibdir)/cudart - -rmdir $(DESTDIR)$(pkglibdir)/cuda - $(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so - -rmdir $(DESTDIR)$(pkglibdir)/bt2 +libcudart_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./ +libcudart_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS) +libcudart_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la +libcudart_la_LDFLAGS += -version-number 12:1:55 -Wl,--version-script,tracer_cudart.map +libcudart_la_LIBADD = libcudarttracepoints.la tmplibdir = $(libdir)/tmp install-data-hook: diff --git a/xprof/xprof.rb.in b/xprof/xprof.rb.in index 7a124723..21a6fb7f 100755 --- a/xprof/xprof.rb.in +++ b/xprof/xprof.rb.in @@ -382,7 +382,7 @@ def env_tracers [%w[opencl cl libOpenCL] + [File.join(LIBDIR,'libTracerOpenCL.so')], %w[ze ze libze_loader] + [File.join(PKGLIBDIR,'ze','libze_loader.so')], - %w[cuda cuda libcud] + [File.join(LIBDIR,'libTracerCUDA.so')], + %w[cuda cuda libcud] + [File.join(PKGLIBDIR,'cuda','libcuda.so')], %w[hip hip libamdhip64] + [File.join(LIBDIR,'libTracerHIP.so')], %w[mpi mpi libmpi] + [File.join(LIBDIR,'libTracerMPI.so')]].each do |name, bt_name, lib, libtracer| # Backend requested, skip omp. It will be handled in a custom case bellow