我的机器上安装了 2 个 Nvidia GTX1080 专用 GPU 和 1 个 Intel 集成 GPU。我只想将 nvidia GPU 用于科学计算。即使我将显示器插入主板,Xorg 服务器也会使用其中一个 nvidia GPU 并分配近 700 MB 的内存。
我如何强制 Xorg 服务器仅使用 Intel GPU?
lspci | grep 'VGA'
输出:
00:02.0 VGA compatible controller: Intel Corporation Device 5912 (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev a1)
nvidia-smi
输出:
Tue Jan 2 15:24:18 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.98 Driver Version: 384.98 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 Off | N/A |
| 32% 59C P5 16W / 180W | 1322MiB / 8114MiB | 4% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 1080 Off | 00000000:02:00.0 Off | N/A |
| 33% 60C P2 56W / 180W | 7858MiB / 8114MiB | 27% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 12818 G /usr/lib/xorg/Xorg 638MiB |
| 0 13476 G compiz 278MiB |
| 0 14230 G ...-token=A9CF4CD99B5947DB32E9E4B117997A68 404MiB |
| 1 25764 C python 7847MiB |
+-----------------------------------------------------------------------------+
答案1
- 在 NVIDIA X 服务器设置中将 PRIME 配置文件更改为 Intel(省电模式)
- 登出 / 登录
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-8.0/lib64:/usr/lib/nvidia-xxx
将(我的是 nvidia-384)添加到 ~/.bashrc 文件- 运行 nvidia-smi
如果它不起作用,请确保在 UEFI 设置中禁用安全启动。