Skip to content

Instantly share code, notes, and snippets.

View mlfz's full-sized avatar

Mathieu Zhang mlfz

View GitHub Profile
@mlfz
mlfz / configure_cuda_p70.md
Created October 30, 2018 01:57 — forked from alexlee-gk/configure_cuda_p70.md
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

test_20_M3D0002_25cb91324c30d94ce74ba7784df9b1d9_Varian_21iX_Millennium120_6mv_SnS_Static (test_functional.TestFunctional) ... 2013-04-30 16:23:30,626 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /_plan/newSince/1367364148.345
2013-04-30 16:23:30,687 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /auth/login
2013-04-30 16:23:58,400 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /_plan/newSince/1367364148.345
2013-04-30 16:23:58,450 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /auth/login
2013-04-30 16:24:28,374 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /_plan/newSince/1367364148.345
2013-04-30 16:24:28,401 INFO pid:12005,139879331297024 mms.user_activity_log:040:log_activity Mobius3D: - 127.0.0.1 /auth/login
2013-04-30 16:24:58,376 INFO pid:12005,13987
File "/home/mlfzhang/m3d_ro/lib/python2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py", line 1689, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/mlfzhang/m3d_ro/lib/python2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/home/mlfzhang/m3d_ro/lib/python2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/mlfzhang/m3d_ro/lib/python2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/home/mlfzhang/m3d_ro/lib/python2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
Traceback (most recent call last):
File "/home/mlfzhang/Projects/mobius_ro/mms/worker/task/base.py", line 132, in _fork
self.performTask()
File "/home/mlfzhang/Projects/mobius_ro/mms/worker/task/datagen.py", line 483, in performTask
self._saveTargetCoverageState(rtss, computedDoseInCt_field, externalDoseInCt_field, target_num2name_dict, referenceDose_gy)
File "/home/mlfzhang/Projects/mobius_ro/mms/worker/task/datagen.py", line 165, in _saveTargetCoverageState
display_str == "{} pixels near CT slice {}".format(int(minPixels_int), index)
NameError: global name 'display_str' is not defined
2012-11-20 15:40:27,520 INFO pid:15572,140062788724480 mms.worker.task.base:197:saveState Target http://localhost:5984/mlfzdev_ro_tanker__started_2012_11_20_15_25_43_883145_1dfee1113d6b762c1e665496c530ba8a saving state {'task': 'mms.worker.task.datagen.CombineComputedAndExternal', 'request': u'started_2012-11-20_15.25.43.883145_1dfee1113d6b762c1e665496c530ba8a', 'keep': 'request', 'time': [1353454827.5205
$ find mms/hardware/config/ -print0 | xargs -0 grep '^[^A-Z]*\(Min\|Max\).*Difference'
mms/hardware/config/Siemens__Primus/machine.pinnacle: MaxOverallLeafDifference = 30;
mms/hardware/config/Siemens__Artiste/machine.pinnacle: MaxOverallLeafDifference = 20;
mms/hardware/config/Varian__21iX/machine.pinnacle: MaxOverallLeafDifference = 15.0;
mms/hardware/config/Varian__21iX/machine.pinnacle: MaxAdjacentLeafDifference = 15.0;
mms/hardware/config/Varian__TrueBeam1/machine.pinnacle: MaxOverallLeafDifference = 15.0;
mms/hardware/config/Varian__Rowdy Radhe/machine.pinnacle: MaxOverallLeafDifference = 15.0;
mms/hardware/config/Varian__Rowdy Radhe/machine.pinnacle: MaxAdjacentLeafDifference = 15.0;
mms/hardware/config/Siemens__Oncor/machine.pinnacle: MaxOverallLeafDifference = 30;
mms/hardware/config/MLC/Elekta 80.json: "MaxAdjacentLeafDifference": 22,
Traceback (most recent call last):
File "/home/mlfzhang/Projects/mobius/mms/worker/task/base.py", line 132, in _fork
self.performTask()
File "/home/mlfzhang/Projects/mobius/mms/worker/task/datagen.py", line 483, in performTask
self._saveTargetCoverageState(rtss, computedDoseInCt_field, externalDoseInCt_field, target_num2name_dict, referenceDose_gy)
File "/home/mlfzhang/Projects/mobius/mms/worker/task/datagen.py", line 161, in _saveTargetCoverageState
index = np.argwhere(segment_array == seg_index)[0][0] + rtstruct.cropSlice_tup[0].start
NameError: global name 'np' is not defined
2012-11-20 15:16:07,045 INFO pid:15472,139827758024448 mms.worker.task.base:197:saveState Target http://localhost:5984/mlfzdev_tanker__started_2012_11_20_14_14_27_093330_a1fedbda866ce557cce982796c772736 saving state {'task': 'mms.worker.task.datagen.CombineComputedAndExternal', 'request': u'started_2012-11-20_14.14.27.093330_a1fedbda866ce557cce982796c772736', 'keep': 'request', 'time': [1353453367.04498, '2012-11
### Siemens Primus 18MV ###
ipdb> np.interp(10, xvals, result[50,50,:])
0.6095818281173706
ipdb> refgeom.effectiveFieldSize_cm
10.0
ipdb> machine.outputFactors[energy].dosePerMu_cgy * refgeom.measuredOutputFactor
0.930037
### Varian 21iX 18MV ###
ipdb> np.interp(10, xvals, result[50,50,:])
In [18]: mach1.name
Out[18]: u'21iX'
In [19]: refgeom1 = mach1.findReferenceGeometry([p for p in mach1.outputFactors[18].geometries if p.wedgeName == mach1.wedge_dict[0].Name and p.wedgeAngle == 60])
In [20]: refgeom1.measuredOutputFactor
Out[20]: 0.728
In [29]: mach2.name
Out[29]: u'Primus'
2012-11-16 15:01:45,170 INFO pid:15701,139899261024000 mms.worker.task.base:107:_fork Forking for: mms.worker.task.smtp.EmailCheckResults started_2012-11-16_14.58.01.132127_912cc0d6c12806ce77688
4c8f510c1d1 [u'pdf_data', u'dvhLimit_data', u'planInfo_dict', u'deliverable_data', u'targetCoverage_data', u'gamma_data'], 1353106905.17 sec
2012-11-16 15:01:45,174 ERROR pid:16594,139899261024000 mms.worker.task.base:142:_fork performTask
Traceback (most recent call last):
File "/home/mlfzhang/Projects/mobius_ro/mms/worker/task/base.py", line 132, in _fork
self.performTask()
File "/home/mlfzhang/Projects/mobius_ro/mms/worker/task/smtp.py", line 24, in performTask
smtp_client = mms.util.smtp.SMTPClient(self.parent)
File "/home/mlfzhang/Projects/mobius_ro/mms/util/smtp.py", line 33, in __init__
if not config_obj.config('smtp_server') or not config_obj.config('smtp_port'):