A method for data communication in a virtualized environment in which multiple user virtual machines share a graphics processing unit, the method comprising performing the following steps in at least one of the multiple user virtual machines: receiving, by a graphics driver, a driver function call request sent by a graphics processing interface, wherein the driver function call request is sent by the graphics processing interface after receiving a system function call request sent by a graphics processing program, the system function call request is used to call a write function of the graphics processing interface, the driver function call request is used to call a write function of the graphics driver, an entry address of the write function of the graphics processing interface is stored in a function stack; determining, by the graphics driver, the entry address of the write function of the graphics processing interface according to an entry address of the write function of the graphics driver and a quantity of layers of the function stack, wherein the quantity of layers of the function stack is determined according to a call location of a test program and a location of a software interrupt that has been added to the write function of the graphics driver, and reading, from the entry address of the write function of the graphics processing interface, an offset and a length that are of a vertex buffer of the graphics processing program, to determine a data area that is modified by the graphics processing program and is in the vertex buffer, where the modified data area is data necessary for graphics rendering; and sending, by the graphics driver to a rendering server, data in the data area corresponding to the offset and the length that are of the vertex buffer, so that the rendering server invokes the graphics processing unit to perform instruction rendering. receiving, by a graphics driver, a driver function call request sent by a graphics processing interface, wherein the driver function call request is sent by the graphics processing interface after receiving a system function call request sent by a graphics processing program, the system function call request is used to call a write function of the graphics processing interface, the driver function call request is used to call a write function of the graphics driver, an entry address of the write function of the graphics processing interface is stored in a function stack; determining, by the graphics driver, the entry address of the write function of the graphics processing interface according to an entry address of the write function of the graphics driver and a quantity of layers of the function stack, wherein the quantity of layers of the function stack is determined according to a call location of a test program and a location of a software interrupt that has been added to the write function of the graphics driver, and reading, from the entry address of the write function of the graphics processing interface, an offset and a length that are of a vertex buffer of the graphics processing program, to determine a data area that is modified by the graphics processing program and is in the vertex buffer, where the modified data area is data necessary for graphics rendering; and sending, by the graphics driver to a rendering server, data in the data area corresponding to the offset and the length that are of the vertex buffer, so that the rendering server invokes the graphics processing unit to perform instruction rendering.