@@ -763,17 +763,11 @@ static UCS_CLASS_INIT_FUNC(uct_rc_gdaki_iface_t, uct_md_h tl_md,
763763 return status ;
764764 }
765765
766- status = UCT_CUDADRV_FUNC_LOG_ERR (
767- cuDevicePrimaryCtxRetain (& self -> cuda_ctx , self -> cuda_dev ));
766+ status = uct_cuda_ctx_primary_push (self -> cuda_dev , 0 , UCS_LOG_LEVEL_ERROR );
768767 if (status != UCS_OK ) {
769768 return status ;
770769 }
771770
772- status = UCT_CUDADRV_FUNC_LOG_ERR (cuCtxPushCurrent (self -> cuda_ctx ));
773- if (status != UCS_OK ) {
774- goto err_ctx_release ;
775- }
776-
777771 status = uct_rc_gdaki_alloc (sizeof (uint64_t ), sizeof (uint64_t ),
778772 (void * * )& self -> atomic_buff , & self -> atomic_raw );
779773 if (status != UCS_OK ) {
@@ -797,19 +791,17 @@ static UCS_CLASS_INIT_FUNC(uct_rc_gdaki_iface_t, uct_md_h tl_md,
797791err_lock :
798792 ibv_dereg_mr (self -> atomic_mr );
799793err_atomic :
800- cuMemFree (self -> atomic_raw );
794+ ( void ) UCT_CUDADRV_FUNC_LOG_WARN ( cuMemFree (self -> atomic_raw ) );
801795err_ctx :
802- (void )UCT_CUDADRV_FUNC_LOG_WARN (cuCtxPopCurrent (NULL ));
803- err_ctx_release :
804- (void )UCT_CUDADRV_FUNC_LOG_WARN (cuDevicePrimaryCtxRelease (self -> cuda_dev ));
796+ uct_cuda_ctx_primary_pop_and_release (self -> cuda_dev );
805797 return status ;
806798}
807799
808800static UCS_CLASS_CLEANUP_FUNC (uct_rc_gdaki_iface_t )
809801{
810802 pthread_mutex_destroy (& self -> ep_init_lock );
811803 ibv_dereg_mr (self -> atomic_mr );
812- cuMemFree (self -> atomic_raw );
804+ ( void ) UCT_CUDADRV_FUNC_LOG_WARN ( cuMemFree (self -> atomic_raw ) );
813805 (void )UCT_CUDADRV_FUNC_LOG_WARN (cuDevicePrimaryCtxRelease (self -> cuda_dev ));
814806}
815807
0 commit comments