def test_success_00008_2_gpu_vfb(self): srv = vsapi.Server(0) scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) scr0.setFBProperty('resolution', [1024, 768]) scr0.setGPU(gpu0) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) scr1.setFBProperty('resolution', [1024, 768]) scr1.setGPU(gpu1) srv.addScreen(scr1) self.genValidConfigFile(srv)
def test_success_00009_2_gpu_single_scanout(self): srv = vsapi.Server(0) scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') scr0.setGPU(gpu0) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065') scr1.setGPU(gpu1) srv.addScreen(scr1) self.genValidConfigFile(srv)
def test_success_00000_1_gpu_vfb(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) scr.setFBProperty('resolution', [1024, 768]) scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00001_1_gpu_1scanout(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(2) # Quadro NVS 420 gpu.setScanout(3, 'HP LP2065') # Configure scanout 3 scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00007_1_gpu_two_vfb(self): # One server, one GPU, but two virtual screens # on the same GPU srv = vsapi.Server(0) gpu = vsapi.GPU(0) scr0 = vsapi.Screen(0) scr0.setFBProperty('resolution', [1024, 768]) scr0.setGPU(gpu) srv.addScreen(scr0) scr1 = vsapi.Screen(1) scr1.setFBProperty('resolution', [1024, 768]) scr1.setGPU(gpu) srv.addScreen(scr1) self.genValidConfigFile(srv)
def test_success_00011_2_gpu_single_scanout_1x2(self): srv = vsapi.Server(0) scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') scr0.setGPU(gpu0) scr0.setFBProperty('position', [0, 0]) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065') scr1.setFBProperty('position', [0, 1200]) scr1.setGPU(gpu1) srv.addScreen(scr1) self.genValidConfigFile(srv)
def test_success_00006_1_gpu_2scanout_1x2_vert_overlap(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) gpu.setScanout(0, 'HP LP2065') gpu.setScanout(1, 'HP LP2065', outputX=0, outputY=1190) scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00005_1_gpu_2scanout_2x1_horiz_overalap(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) gpu.setScanout(0, 'HP LP2065') gpu.setScanout(1, 'HP LP2065', outputX=1590, outputY=0) scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00002_1_gpu_2scanout_nvs420_dp(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(2) # NVS 420 gpu.setScanout(2, 'HP LP2065') gpu.setScanout(3, 'HP LP2065') scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00002_1_gpu_2scanout(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) gpu.setScanout(0, 'HP LP2065') gpu.setScanout(1, 'HP LP2065') scr.setGPU(gpu) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00012_2_gpu_single_scanout_2x1_xinerama(self): srv = vsapi.Server(0) scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') scr0.setGPU(gpu0) scr0.setFBProperty('position', [0, 0]) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065') scr1.setFBProperty('position', [1600, 0]) scr1.setGPU(gpu1) srv.addScreen(scr1) srv.combineScreens(True) self.genValidConfigFile(srv)
def test_success_00018_2_gpu_sli(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') gpu1 = vsapi.GPU(1) scr.setGPUs([gpu0, gpu1]) sli = vsapi.SLI(0) scr.setGPUCombiner(sli) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00015_2_gpu_3x1_xinerama(self): srv = vsapi.Server(0) # 2 screens on first GPU, 1 on the second GPU # all placed in a horizontal layout scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') gpu0.setScanout(1, 'HP LP2065', outputX=1600, outputY=0) scr0.setGPU(gpu0) scr0.setFBProperty('position', [0, 0]) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065') scr1.setFBProperty('position', [1600 * 2, 0]) scr1.setGPU(gpu1) srv.addScreen(scr1) srv.combineScreens(True) self.genValidConfigFile(srv)
def test_success_00022_2_gpu_sli_mosaic_2x1(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065', outputX=1600, outputY=0) scr.setGPUs([gpu0, gpu1]) sli = vsapi.SLI(0) sli.setMode("mosaic") scr.setGPUCombiner(sli) srv.addScreen(scr) self.genValidConfigFile(srv)
def test_success_00016_2_gpu_2x2_xinerama(self): srv = vsapi.Server(0) # 2 screens on first GPU, 2 on the second GPU # placed one below the other scr0 = vsapi.Screen(0) gpu0 = vsapi.GPU(0) gpu0.setScanout(0, 'HP LP2065') gpu0.setScanout(1, 'HP LP2065', outputX=1600, outputY=0) scr0.setGPU(gpu0) scr0.setFBProperty('position', [0, 0]) srv.addScreen(scr0) scr1 = vsapi.Screen(1) gpu1 = vsapi.GPU(1) gpu1.setScanout(0, 'HP LP2065') gpu1.setScanout(1, 'HP LP2065', outputX=1600, outputY=0) scr1.setFBProperty('position', [0, 1200]) scr1.setGPU(gpu1) srv.addScreen(scr1) srv.combineScreens(True) self.genValidConfigFile(srv)
def test_failure_00001_1_gpu_1scanout(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) gpu.setScanout( 3, 'HP LP2065' ) # Configure scanout. This would fail since the 5800 does not have the third scanout scr.setGPU(gpu) srv.addScreen(scr) try: print 'Trying to setup invalid port index 3 for scanout' self.genValidConfigFile(srv) self.fail("Succeeded to setup scanout 3 - this should have failed") except: # If we come here, there is failure -which is right print "Failed to generate config- the correct result right"
def test_failure_00002_1_gpu_1scanout(self): srv = vsapi.Server(0) scr = vsapi.Screen(0) gpu = vsapi.GPU(0) # configure 3 scanouts - this should also fail gpu.setScanout(0, 'HP LP2065') gpu.setScanout(1, 'HP LP2065') gpu.setScanout(2, 'HP LP2065') scr.setGPU(gpu) srv.addScreen(scr) try: print 'Trying to setup three scanouts on the GPU' self.genValidConfigFile(srv) self.fail( "Succeeded to setup three scanouts - this should have failed") except: # If we come here, there is failure -which is right print "Failed to generate config - the correct result right"
modeAlias = defaultMode[ 'alias'] # Unique identifier corresponding to this mode, e.g. 1600x1200_60 modeWidth = defaultMode['width'] # Width (in pixels) of this mode modeHeight = defaultMode['height'] # Height (in pixels) of this mode print print "Using display device '%s', display mode '%s'." % (ddName, modeAlias) print "Each GPU output will run at %dx%d@%sHz" % (modeWidth, modeHeight, defaultMode['refresh']) # Screen 0 drives two monitors side by side at default resolution, # from ports 1 and 2 of the allocated GPU # (one DVI-I & one DisplayPort) # # Only one X screen is used, so the application can directly span the two displays # scr = vsapi.Screen(0) gpu.setScanout(port_index=1, display_device=dispDevice, outputX=0) gpu.setScanout(port_index=2, display_device=dispDevice, outputX=modeWidth) scr.setGPU(gpu) srv.addScreen(scr) # Propagate server configuration to the SSM alloc.setupViz(ra) # Start the server print print "Starting X server..." alloc.startViz(ra) srvDISPLAY = srv.getDISPLAY() srvHost = srv.getHostName()
# You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import vsapi # Connect to the SSM ra = vsapi.ResourceAccess() # Allocate a GPU and a Server on the same node alloc = ra.allocate([[vsapi.GPU(), vsapi.Server()]]) res = alloc.getResources() gpu = res[0][0] srv = res[0][1] screen = vsapi.Screen(0) # Setup the X screen if gpu.getAllowNoScanOut(): gpu.clearScanouts() screen.setFBProperty('resolution', [1280, 1024]) else: if len(gpu.getScanouts()) == 0: sc = gpu.getScanoutCaps() gpu.setScanout(0, 'HP LP2065', sc[0][0]) # X screen controls the allocated GPU screen.setGPU(gpu) # Configure the screen on our allocated server srv.addScreen(screen)
# Get information corresponding to an LP2065 monitor # NOTE: on success, we'll get a list with 1 element, and we # use the first element dispDevice = ra.getTemplates(vsapi.DisplayDevice(ddName))[0] # Get default mode & its properties defaultMode = dispDevice.getDefaultMode() # get the default display mode for this device modeAlias = defaultMode['alias'] # Unique identifier corresponding to this mode, e.g. 1600x1200_60 modeWidth = defaultMode['width'] # Width (in pixels) of this mode modeHeight = defaultMode['height'] # Height (in pixels) of this mode print print "Using display device '%s', display mode '%s'."%(ddName, modeAlias) print "Each GPU output will run at %dx%d@%sHz"%(modeWidth, modeHeight, defaultMode['refresh']) # Screen 0 drives a LP2065 monitor at default resolution, from port 0 of GPU0 scr0 = vsapi.Screen(0) scr0.setFBProperty('position',[0,0]) gpu0_0 = deepcopy(gpu0) # Make a copy of the GPU so that we can assign display devices gpu0_0.setScanout(port_index=0, display_device=ddName) scr0.setGPU(gpu0_0) srv.addScreen(scr0) # Screen 1 drives a LP2065 monitor at default resolution, from port 1 of GPU0 scr1 = vsapi.Screen(1) scr1.setFBProperty('position',[modeWidth,0]) gpu0_1 = deepcopy(gpu0) gpu0_1.setScanout(port_index=1, display_device=ddName) scr1.setGPU(gpu0_1) srv.addScreen(scr1) # Screen 2 drives a LP2065 monitor at default resolution, from port 0 of GPU1
gpu0 = vsapi.GPU(0) gpu0.setScanout(0, "HP LP2065") # LP2065 connected to port 0 # If you need the other output, comment out the following line # This will configure the #gpu0.setScanout(1, "LP2065", outputX=1600) # Create & configure the second GPU on the system. gpu1 = vsapi.GPU(1) gpu1.setScanout(0, "HP LP2065") # LP2065 connected to port 0 # If you need the other output, comment out the following line # This will configure the #gpu1.setScanout(1, "LP2065", outputX=1600) # Create an X screen, and assign the first GPU # to drive this screen scr0 = vsapi.Screen(0) scr0.setFBProperty('position',[0,0]) scr0.setGPU(gpu0) # Create another X screen, and assign the second GPU # to drive this screen scr1 = vsapi.Screen(1) scr1.setFBProperty('position',[0,1200]) # Screen 1 below screen 0 scr1.setGPU(gpu1) # Create a server, and all screens to it srv = vsapi.Server() srv.addScreen(scr0) srv.addScreen(scr1) #Uncomment the following line to enable Xinerama #srv.combineScreens(True)
res = alloc.getResources() srv = res[0][0] gpu = res[0][1] scrList = [] gpuList = [] gpuNames = [] gpuResults = {} print 'Running %d copies of SPECViewPerf 9 on a single GPU' % (nCopies) for screenIndex in range(nCopies): name = '%s/GPU-%d/Instance %d' % (gpu.getHostName(), gpu.getIndex(), screenIndex) gpuResults[name] = [] gpuNames.append(name) print '\t%s' % (name) screen = vsapi.Screen(screenIndex) # Configure an independent screen for each benchamrk # may not work on GeForce cards. gpu.clearScanouts() screen.setFBProperty('resolution', [1280, 1024]) # X screen controls the allocated GPU screen.setGPU(gpu) # Configure the screen on our allocated server srv.addScreen(screen) gpuList.append(gpu) scrList.append(screen)