xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2022: test_cuda_context_gil.3.py

File test_cuda_context_gil.3.py, 858 bytes (added by Antoine Martin, 2 years ago)

increase timer frequency so we can verify the change more clearly

Line 
1#!/usr/bin/env python
2# This file is part of Xpra.
3# Copyright (C) 2019 Antoine Martin <antoine@xpra.org>
4# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
5# later version. See the file COPYING for details.
6
7import time
8#now = time.time
9from xpra.os_util import monotonic_time as now
10
11def print_thread():
12    while True:
13        print("* %.3f" % now())
14        time.sleep(0.01)
15
16from threading import Thread
17t = Thread(target=print_thread)
18t.daemon = True
19t.start()
20
21time.sleep(0.005)
22
23print("* %.3f loading pycuda" % now())
24from pycuda import driver
25print("* %.3f driver init" % now())
26driver.init()
27print("* %.3f initializing device" % now())
28device = driver.Device(0)
29print("* %.3f device=%s" % (now(), device,))
30context = device.make_context()
31print("* %.3f context=%s" % (now(), context,))
32print("all done")
33context.detach()