用户工具

站点工具


en:pwstudio:centos_gpu

Installing the PWstudio GPU version on CentOS 7.9

Applies to: CentOS 7.9
Includes: NVIDIA GPU driver, Docker, nvidia-container-toolkit

Before you start, we strongly recommend reading Read this before installing PWstudio first, especially the notes about “copy-paste” and “the command prompt is not part of the command” — you'll need both throughout this page. If you don't yet know how to use a tool to log in to a server / upload files, read the MobaXterm beginner tutorial first.

Every installer package mentioned on this page (drivers, Docker offline packages, etc.) is provided as a plain web link. You'll need to download it with a browser onto your own computer first, then upload it to the server with MobaXterm (or a similar tool), before you can use it in the commands below.


1. System setup

1.1 Disable the firewall

Run the two commands below. The first stops the firewall immediately; the second prevents it from starting automatically at boot (so it doesn't get turned back on after your next reboot):

sudo systemctl stop firewalld
sudo systemctl disable firewalld

These two commands normally produce no output at all — as long as there's no error, they succeeded.

2. Install the NVIDIA GPU driver

If your machine already has the NVIDIA driver installed (e.g. your administrator already set it up), you can skip ahead to section 2.6 below and run nvidia-smi to check. If you can see GPU information, the driver is already installed and you can skip this entire “2. Install the NVIDIA GPU driver” chapter, going straight to “3. Install Docker”.

2.1 Confirm the system can detect the NVIDIA GPU

lspci | grep -i nvidia

This command lists every NVIDIA hardware device the system has detected.

  • If there's output: you'll typically see one or more lines like 01:00.0 VGA compatible controller: NVIDIA Corporation …, which means an NVIDIA GPU is indeed installed and has been detected at the hardware level — you can continue with the driver installation.
  • If there's no output at all (the command returns straight to the prompt with nothing shown): the system did not detect an NVIDIA GPU. This could mean the card isn't seated properly, or the machine simply doesn't have a GPU. In this case, contact your administrator to confirm the hardware before continuing — don't proceed with the GPU driver install (you might consider the CPU version instead).
  • If you see “lspci: command not found”, the lspci tool itself isn't installed yet. Run sudo yum install -y pciutils to install it, then run the command above again.

2.2 Install dependencies

sudo yum install -y gcc kernel-devel-$(uname -r) kernel-headers-$(uname -r)

The $(uname -r) here is part of the command — it gets automatically substituted with your current kernel version and does not need to be manually changed to anything else (e.g. your own username). Just copy and paste the entire line exactly as it is — don't copy only part of it, and don't drop the dollar sign or parentheses.

If this step reports that it can't find a package repository or can't reach the network (e.g. an error like “Could not retrieve mirrorlist”), that's because CentOS 7's official repositories are no longer maintained — this is a common issue. See q103: Switching mirrors on CentOS 7.9 for the fix, then run this step again afterward.

2.3 Disable the built-in nouveau driver

CentOS ships with an open-source nouveau graphics driver by default, which conflicts with the official NVIDIA driver, so it needs to be disabled first. Running the command below creates a configuration file:

sudo tee /etc/modprobe.d/blacklist-nouveau.conf << 'EOF'
blacklist nouveau
options nouveau modeset=0
EOF

After running this, the two lines blacklist nouveau and options nouveau modeset=0 will be printed to the screen exactly as they are. This is normal (because tee both displays the content and writes it to the file at the same time) — it's not an error.

Rebuild the initramfs image and switch to text-mode boot (run the commands in order):

sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
sudo dracut /boot/initramfs-$(uname -r).img $(uname -r)
sudo systemctl set-default multi-user.target
sudo reboot

The last command, sudo reboot, immediately reboots the server — this is expected and necessary (it's what makes disabling nouveau take effect). Your terminal connection will drop after this — that's normal, don't worry. Wait 1-2 minutes for the server to finish rebooting, then log back in with MobaXterm (or whatever tool you're using), and continue with step 2.4 below.

2.4 Download and install the driver

Download the appropriate driver file from NVIDIA's official site (e.g. NVIDIA-Linux-x86_64-550.76.run)
or use the link below

Link: http://223.70.160.60:9999/qflow/NVIDIA-Linux-x86_64-550.76.run
Username: pwmat
Password: SimplyTheBest

The link above needs to be opened in a browser with the username/password to download the file. Once downloaded, use MobaXterm (or WinSCP, etc.) to upload this .run file to the server (e.g. into the home directory you land in after logging back in). See section 4, “Uploading / downloading files,” in the MobaXterm tutorial: uploading and downloading files for how.

Once uploaded, run the installer on the server's terminal (make sure the filename matches the driver file you actually downloaded):

sudo sh NVIDIA-Linux-x86_64-550.76.run --ui=none --no-questions --accept-license --no-opengl-files

During installation the terminal will scroll through some install messages — this normally finishes in anywhere from tens of seconds to a couple of minutes. Once you're back at the prompt with no error, the install succeeded. If you hit an error partway through, copy the full error message and search it with an AI tool, or leave a comment on Installation Q&A / Answers / Search / Discussion.

2.5 Reboot the system

sudo reboot

As before, the terminal will disconnect after this — that's normal. Wait 1-2 minutes, then log back in to the server.

2.6 Verify the driver installation

After logging back in, run:

nvidia-smi

Note that nvidia-smi has a hyphen in the middle and no space — typing it as “nvidia - smi” or “nvidia smi” will produce a “command not found” error, so we recommend copying and pasting this line directly.

  • If you see a table containing the GPU model (e.g. GeForce RTX 3090), the driver version (Driver Version), the CUDA version (CUDA Version), etc., congratulations — the driver was installed successfully, and you can move on to the next step with confidence.
  • If you see “nvidia-smi: command not found”, the driver install didn't succeed. Go back to 2.4 and check whether the install process reported an error, or search the specific error message with an AI tool.

3. Install Docker

If Docker is already installed on your machine, run docker –version first — if you see a version number (e.g. Docker version 27.x.x), it's already installed, so this chapter can be skipped, and you can go straight to “4. Install nvidia-container-toolkit”.

For CentOS 7.9, we recommend installing via the offline RPM package to avoid network dependency issues (since CentOS 7's official repositories are no longer maintained, installing directly over the network tends to fail).

3.1 Download the offline RPM package and upload it to the server

Link: http://223.70.160.60:9999/qflow/docker7.tar
Username: pwmat
Password: SimplyTheBest

Open the link above in a browser, enter the username/password, and download docker7.tar to your own computer. Then use MobaXterm to upload it to the server (we recommend uploading it to your current home directory to make the next step easier).

3.2 Install Docker

Once uploaded, go back to the terminal and run the following commands in order (for example, cd docker7 depends on the directory extracted by the previous tar -xvf command):

tar -xvf docker7.tar
cd docker7
sudo yum install -y *.rpm

The first command extracts the archive you just uploaded, creating a docker7 folder in the current directory; the second command goes into that folder; the third installs every .rpm package inside it. During installation you'll see a lot of package names scroll by — that's normal, as long as it finishes without a red error message.

3.3 Start Docker and enable it at boot

sudo systemctl start docker
sudo systemctl enable docker

The first command starts the Docker service; the second sets it to start automatically at boot (so you won't have to start it manually every time the server reboots). These two commands usually produce no output, or just a message like “Created symlink…” — that's normal.

3.4 Verify the installation

sudo docker run --rm swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/hello-world:latest

This pulls a tiny test image from a registry and runs it. If you see text starting with “Hello from Docker!” like below, Docker was installed successfully and is working correctly:

Hello from Docker!
This message shows that your installation appears to be working correctly.
...

If this step fails (e.g. it can't connect to the Docker daemon), first check whether the two commands in 3.3 ran successfully.

3.5 (Optional) Allow a non-root user to run Docker

This step lets your regular login user run docker commands afterward without needing sudo every time. If you don't mind typing sudo each time, you can skip this step.

sudo usermod -aG docker $USER

$USER here is a system variable that gets automatically substituted with your currently logged-in username — you don't need to manually change it to your own username, just copy and paste it as-is.

Note: you need to log out and back in (or restart your session) for this to take effect. In other words, after running this command, exit the terminal (type exit or just close the window) and log back in to the server for the setting to actually apply.

4. Install nvidia-container-toolkit

In simple terms, nvidia-container-toolkit is what lets Docker containers “see and use” the NVIDIA GPU on the host machine. Without it, Docker containers can't directly use a GPU driver you've already installed.

We recommend installing via the offline RPM package (CentOS 7's official repositories offer limited support).

4.1 Download the offline package and upload it to the server

Link: http://223.70.160.60:9999/qflow/nvidia-container7.tgz
Username: pwmat
Password: SimplyTheBest

As before, download this file with a browser first, then upload it to the server with MobaXterm.

A note about directories: the nvidia-container7.tgz downloaded here and the docker7.tar downloaded in 3.1 are two completely independent, unrelated archives. Extracting them produces two separate folders, docker7 and nvidia-container7, which are siblings, side by side (both under your home directory) — neither contains the other. We recommend uploading this new file to the same home directory; there's no need to go into the docker7 folder to do anything.

4.2 Install

tar -zxvf nvidia-container7.tgz
cd nvidia-container7
sudo yum install -y *.rpm

Similar to installing Docker earlier: the first command extracts the archive, the second enters the extracted directory, and the third installs all the rpm packages inside it.

4.3 Configure the Docker runtime

sudo nvidia-ctk runtime configure --runtime=docker

This step only needs to be run once (as does restarting the Docker service in 4.4 below) — you don't need to redo it every time you use Docker, or every time you boot up. This step permanently writes the GPU runtime configuration into Docker's config file; once it's set, it stays in effect unless you reinstall the OS or reinstall Docker.

4.4 Restart the Docker service

sudo systemctl restart docker

This applies the configuration from the previous step by restarting the Docker service (not the whole server — just the Docker software itself, which takes a few seconds and doesn't affect other programs).

4.5 Verify the installation

sudo docker run --rm --gpus all \
 swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/nvidia/cuda:12.4.0-base-ubuntu22.04 \
 nvidia-smi

This starts a container and runs nvidia-smi inside it. If you see the same kind of table with the GPU model, driver version, and CUDA version (similar to what you saw on the host machine in step 2.6), the Docker container can now access and use the GPU correctly — nvidia-container-toolkit was installed successfully.

If this step fails (e.g. saying the GPU is not visible, or “unknown flag: –gpus”), it usually means one of the earlier steps wasn't done correctly. Check, in order: whether the driver is installed (2.6), whether Docker is installed (3.4), and whether you've completed 4.1-4.4 in this chapter.


5. Install the PWstudio GPU version

At this point, the NVIDIA GPU driver, Docker, and nvidia-container-toolkit — the three pieces of base environment — are all installed. Next you need to continue installing PWstudio itself. Click the link below to jump to the next step, starting from “Install the server.py service on the host machine”: Go to "Install the server.py service on the host machine", and follow the guide through to the end.

en/pwstudio/centos_gpu.txt · 最后更改: 2026/08/03 15:37 由 127.0.0.1