Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GPU-Virtual-Service/gpu-remoting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Flexible GPU Virtualization in Cloud (FlexGV)

75 changes: 75 additions & 0 deletions GPU-Virtual-Service/gpu-remoting/include/chunkStructure.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#ifndef CHUNK_STRUCTURE_H
#define CHUNK_STRUCTURE_H

#include "constVar.h"
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <stdint.h>

typedef struct {
char *name;
size_t paramSize;
size_t paramNum;
uint16_t *paramOffsets;
uint16_t *paramSizes;
void *host_fun;
} KernelInfo_t; // used to store kernel parmeters from client fatCubin

struct KernelPtx_t {
std::string name;
std::string body;

KernelPtx_t(const char* n, size_t name_len, const char* b, size_t body_len)
: name(n, name_len), body(b, body_len) {}
}; // used to store kernel body from PTX codes

struct LdParamInfo_t {
bool isUsed;
size_t index;
size_t offset;

LdParamInfo_t(size_t idx, size_t off) : isUsed(false), index(idx), offset(off) {}
};

struct BatchInfo_t {
uint8_t curType;
size_t curBatchSize;
};

struct HostBuffer_t {
uint8_t* hostPtr;
size_t size;
};

struct TensorInfo_t {
void* devPtr;
size_t size;
};

struct Block_t{
uint64_t start;
uint64_t devPtr = 0;
size_t size = 0;
bool valid = false;
bool essential = false;
};

struct Handle_t {
uint64_t handlePtr = 0;
enum API_REQUEST_CODE_SET type;
bool valid = false;
uint64_t stream = 0;
};

struct Sync_t {
boost::mutex mutex;
boost::condition_variable cv;
};

// struct GpuInform{
// int GpuId;
// char IpAddr [IP_STRING_LEN];
// int Port;
// };

#endif //CHUNK_STRUCTURE_H
112 changes: 112 additions & 0 deletions GPU-Virtual-Service/gpu-remoting/include/configure.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#ifndef BASICDEDUP_CONFIGURE_h
#define BASICDEDUP_CONFIGURE_h

#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/atomic.hpp>
#include <boost/lockfree/queue.hpp>
#include <boost/interprocess/file_mapping.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/interprocess/exceptions.hpp>
#include <boost/regex.hpp>
#include <boost/intrusive/list.hpp>
#include <sys/epoll.h>
#include "define.h"
#include "constVar.h"
#include "chunkStructure.h"
using namespace std;

class Configure {
private:
string serverIp_;
uint16_t serverPort_;

uint64_t clientID_;
bool isClient_;
size_t reqGPUnum_;
size_t priority_;
string proxyIp_;
uint16_t proxyPort_;

string dpcIp_;
uint16_t dpcPort_;

string monIp_;
uint16_t monPort_;

size_t DDPreqGPUnum_;

string model_;
size_t batchSize_;


void ReadConf(std::string path);

public:
Configure(std::string path, bool isClient = false);

~Configure();

inline const string& GetServerIp() const noexcept {
return serverIp_;
}

inline uint16_t GetServerPort() {
return serverPort_;
}

inline uint64_t GetClientID() {
return clientID_;
}

inline size_t GetReqGPUnum() {
if (DDPreqGPUnum_ > 1) {
return DDPreqGPUnum_;
}
return reqGPUnum_;
}

inline size_t GetPriority() {
return priority_;
}

inline const string& GetProxyIp() const noexcept {
return proxyIp_;
}

inline uint16_t GetProxyPort() {
return proxyPort_;
}

inline const string& GetDpcIp() const noexcept {
return dpcIp_;
}

inline uint16_t GetDpcPort() {
return dpcPort_;
}

inline const string& GetMonIp() const noexcept {
return monIp_;
}

inline uint16_t GetMonPort() {
return monPort_;
}

inline size_t GetDDPreqGPUnum() {
return DDPreqGPUnum_;
}

inline const string& GetModel() const noexcept {
return model_;
}

inline size_t GetBatchSize() {
return batchSize_;
}


};

#endif
Loading
Loading