环境信息
服务器: NE5260M5
CPU型号: Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
GPU型号: vGPU GRID T4-4Q(显存4G)
虚机配置: 绑核大页 8C16G,数据盘100G,系统盘200G
游戏: 英雄联盟,画质中等
部署问题 Windows虚机核数未完全被使用 未配置CPU拓扑信息的虚机,CPU拓扑关系如下:
1 2 3 4 5 6 <cpu mode ='host-passthrough' check ='none' > <topology sockets ='8' cores ='1' threads ='1' /> <numa > <cell id ='0' cpus ='0-7' memory ='16777216' unit ='KiB' memAccess ='shared' /> </numa > </cpu >
CPU线程数 = Sockets * Cores * Threads
由于win10系统socket最大只能使用2核,即最大只能到sockets='2'
,其余需分配给cores
与threads
。即需配置如下:
1 2 3 4 5 6 7 <cpu mode ='host-passthrough' check ='none' > <topology sockets ='2' cores ='2' threads ='2' /> <feature policy ='disable' name ='hypervisor' /> <numa > <cell id ='0' cpus ='0-7' memory ='16777216' unit ='KiB' memAccess ='shared' /> </numa > </cpu >
对应的OpenStack Flavor元数据信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 # 设置vm的cpu toplogy。 max limit 类型的设置也可以通过image 属性来设置. $ nova flavor-key FLAVOR-NAME set hw:cpu_sockets=FLAVOR-SOCKETS $ nova flavor-key FLAVOR-NAME set hw:cpu_cores=FLAVOR-CORES $ nova flavor-key FLAVOR-NAME set hw:cpu_threads=FLAVOR-THREADS $ nova flavor-key FLAVOR-NAME set hw:cpu_max_sockets=FLAVOR-SOCKETS $ nova flavor-key FLAVOR-NAME set hw:cpu_max_cores=FLAVOR-CORES $ nova flavor-key FLAVOR-NAME set hw:cpu_max_threads=FLAVOR-THREADS # FLAVOR-NAME 模板的名称 # sockets x cores x threads = 总vcpu数 # sockets # cores # threads
游戏检测运行环境为虚机
该问题,需要禁用掉虚机内的虚拟化特性,具体xml代码段如下:
1 2 3 4 5 6 7 <kvm > <hidden state ='on' /> </kvm > <feature policy ='disable' name ='hypervisor' />
参考范例如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 <features > <acpi /> <apic /> <kvm > <hidden state ='on' /> </kvm > </features > <cpu mode ='host-passthrough' check ='none' > <topology sockets ='2' cores ='2' threads ='2' /> <feature policy ='disable' name ='hypervisor' /> <numa > <cell id ='0' cpus ='0-7' memory ='33554432' unit ='KiB' memAccess ='shared' /> </numa > </cpu >
对应的OpenStack Image元数据信息如下:
1 openstack image create --disk-format qcow2 --file cirros.qcow2 --property img_hide_hypervisor_id=true game-cirros
游戏无法初始化图形设备
windows+R键,输入dxdiag
,运行DirectX诊断工具,发现视频加速功能未启动。
桌面右键,点击NVIDIA控制面板
,查看当前能力,发现如下图:
出现该问题的原因在于,微软默认的mstsc
无法调用GPU硬件,需要使用专业工具如:向日葵等软件 ,即可正常调用GPU。效果图如下:
参考文档