Blog
"GPU Pass-Through Project: The Beginning"
September 24, 2024
Being naturally curious, in my spare time I enjoy learning new or interesting concepts within the world of information technology. This summer I happened upon one of the most exciting concepts to date: bare-metal GPU pass-through within a VM. Now, before I continue, I think it is important to clarify what I mean by such a phrase. A “GPU” is shorthand for “Graphical Processing Unit” which is the device responsible or generating and transmitting images from your computer to your monitor or output device. In overly simplified terms, a “VM” or virtual machine functions as a computer (or “guest”) running on top of another computer (or “host”). For example, you could be running a GNU/Linux guest on top of a Windows 11 host for testing purposes. In my case, I wanted to see if it was possible to run Debian GNU/Linux as a host operating system and run Microsoft Windows 11 as a guest while being able to utilize the full power of a dedicated graphics card from within a virtual machine.
Prior to exploring this project I needed to establish some foundations to support this endeavor. For example, I verified that my host operating system was indeed a 64-bit system. This is crucial as 64-bit operating systems can access greater than four gigabytes (4GB) of RAM. Also, running two operating systems concurrently would consequently require greater RAM than simply running the minimum amount for a single operating system. Thankfully, I have thirty-two gigabytes (32GB) of RAM for such a task. Along those same lines I needed a central processing unit (CPU) capable of juggling two machines at once. In my case, I am using a six-core processor and can dedicate the majority of said cores entirely to my virtual machine for the purposes of gaming. Since I do not currently have multiple storage drives my storage requirements needed to be considered as well. In my case, I am using a one terabyte (1TB) M.2 NVME drive for both the host and guest systems.
With my processor, RAM and storage needs in mind I needed to figure out how to install Microsoft Windows 11 within a virtual machine. By visiting Microsoft’s official website I found a clean ISO disk image of the Windows 11 installer for use in setting up this machine. While I do, in fact, have a detachable disk drive for my PC I opted instead to “mount” or utilize the ISO directly within the operating system as if it were burned to a physical disk. Doing this saved a considerable amount of time as the machine did not have to read an optical disk in order to read and write data to my dedicated storage. Lastly, I needed to do some research as to how to obtain fast performing and resolution graphics within the confines of a virtual machine. This necessitated dedicated graphics over integrated graphics, as the software I wanted to use needed to specify a graphics card solely for the host machine and one for the guest machine.
Given all of this information, I now could proceed with configuring the virtual machine. This proved to not only be a challenge but intellectually rewarding as well. That tale, however, is best told at a later date.