Before using the GPU passthrough feature, ensure that requirements in Preparations have been met completely and correctly. Below is detailed operational procedures for setting up GPU passthrough:
ROM is a configuration file used for passing through pGPUs. The ROM file you upload is updated to the pGPU that the specification specifies.
ZStack Cloud provides built-in basic ROM files, which can satisfy the majority of passthrough needs. Additionally, you can obtain other ROM files you need on the official site of the GPU supplier and then upload them.
On the main menu of ZStack Cloud, choose . Select the pGPU that you need and click . A pop-up menu appears and you can upload ROM file herein.
In the management interface of VM Instance, select the name of one existing VM instance and enter its details page. Choose Configuration info on the top row. Find pGPU Device on this page and click Attach.
Select one or more stopped VM instances in the management interface of VM Instance, and click . Then you have two options to choose, that is, attach GPU specification or attach GPU device.
Obtain the driver and CUDA toolkit compatible with the GPU device.
lsmod | grep nouveau
to check whether the Nouveau driver has been installed. If the output data suggests the Nouveau driver has been installed, you can perform the following operations to disable it. If no output is displayed, just skip this procedure.# touch /etc/modprobe.d/nvidia-installer-disable-nouveau.conf # Create a file and save the two lines below into it blacklist nouveau options nouveau modeset=0
# yum install gcc kernel-devel-$(uname -r) kernel-headers-$(uname -r) # Reconstruct initramfs image # cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak # dracut /boot/initramfs-$(uname -r).img $(uname -r) --force # Only reboot the VM in the text mode # systemctl set-default multi-user.target # init 3 # reboot # lsmod | grep nouveau # After the VM instance is rebooted, check whether the nouveau driver is used or not
# chmod +x NVIDIA-Linux-x86_64-346.47.run # Configure executable permissions # ./NVIDIA-Linux-x86_64-346.47.run # Execute the driver script
After you run the commands, the driver package will begin to unpack and you can follow the installation instructions. During the installation, some warnings may appear. Confirm these warnings in sequence as they do not have any real impact. If some errors occur, please refer to the table below to check the environment.Error Message | Solution |
---|---|
ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option. | You need to have all of the kernel source files (including kernel, kernel-headers, and kernel-devel) installed and ensure that they are of the same version |
ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the ow to correctly disable the Nouveau kernel driver. | You have to disable the Nouveau kernel driver |
ERROR: Failed to find dkms on the system! ERROR: Failed to install the kernel module through DKMS. No kernel module was installed; please try installing again without DKMS, or check the DKMS logs for more information. | You need to install DKMS, which helps maintain out-of-tree drivers by automatically regenerating new modules when the kernel version changes |
ERROR: Unable to load the kernel module 'nvidia.ko'. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release. | Just run the commands ./NVIDIA-Linux-x86_64-384.98.run --kernel-source-path=/usr/src/kernels/3.10.0-XXX.x86_64/ -k $(uname -r) |
# lspci |grep NVIDIA # nvidia-smi
# chmod +x cuda_8.0.61_375.26_linux.run # Configure executable permissions # ./cuda_8.0.61_375.26_linux.run # Execute the driver script
vim /root/.bashrc
command and save the content below to the same file:#gpu driver export CUDA_HOME=/usr/local/cuda-8.0 export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib:${LD_LIBRARY_PATH}"
# source ~/.bashrc # cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery # make # ./deviceQuery
# Create a mount point. mkdir /mnt/cdrom # Mount the CD-ROM image. mount /dev/cdrom /mnt/cdrom # Install GuestTools. cd /mnt/cdrom/ bash ./zs-tools-install.sh # Unmount the CD-ROM image(Optional) cd ~ umount /mnt/cdrom
selinux
. Otherwise, the QGA feature may be affected.Back to Top
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for using ZStack products and services.