|
|
@@ -524,6 +524,7 @@ static std::shared_ptr<socket_t> get_socket(const std::string & endpoint) {
|
|
|
std::string host;
|
|
|
int port;
|
|
|
if (!parse_endpoint(endpoint, host, port)) {
|
|
|
+ GGML_LOG_ERROR("Failed to parse endpoint: %s\n", endpoint.c_str());
|
|
|
return nullptr;
|
|
|
}
|
|
|
#ifdef _WIN32
|
|
|
@@ -2053,6 +2054,10 @@ ggml_backend_reg_t ggml_backend_rpc_reg(void) {
|
|
|
|
|
|
static uint32_t ggml_backend_rpc_get_device_count(const char * endpoint) {
|
|
|
auto sock = get_socket(endpoint);
|
|
|
+ if (sock == nullptr) {
|
|
|
+ GGML_LOG_ERROR("Failed to connect to %s\n", endpoint);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
rpc_msg_device_count_rsp response;
|
|
|
bool status = send_rpc_cmd(sock, RPC_CMD_DEVICE_COUNT, nullptr, 0, &response, sizeof(response));
|
|
|
RPC_STATUS_ASSERT(status);
|