-
Notifications
You must be signed in to change notification settings - Fork 6
/
troubleshooting.html
422 lines (333 loc) · 27.5 KB
/
troubleshooting.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta name="msapplication-config" content="/browserconfig.xml"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" type="image/png" href="/apple-touch-icon.png"/>
<link rel="manifest" type="application/manifest+json" href="/site.webmanifest"/>
<link rel="mask-icon" type="image/svg+xml" href="/mask-icon.svg" color="#990000"/>
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<title>Drake: Troubleshooting common problems</title>
<meta
name="description"
content="Drake ("dragon" in Middle English) is a C++ toolbox started by the Robot
Locomotion Group at the MIT Computer Science and Artificial Intelligence
Lab (CSAIL). The development team has now grown significantly, with core
development led by the Toyota Research Institute. It is a collection of
tools for analyzing the dynamics of our robots and building control
systems for them, with a heavy emphasis on optimization-based design/
analysis.
"/>
<!--
The "Work Sans" font is licensed under the SIL Open Font License (OFL). For
more information, see:
- https://fonts.google.com/specimen/Work+Sans?preview.text_type=custom#about
- https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
-->
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Work+Sans:wght@300;400;600;700;800&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="/third_party/github-styling/github-markdown.css"/>
<link rel="stylesheet" href="/third_party/dracula/syntax.css"/>
<link rel="stylesheet" href="/third_party/pylons/pylons.css"/>
<link rel="stylesheet" href="/assets/css/main.css"/>
</head>
<body>
<header class="site-header">
<div class="site-header-inner contain">
<a href="/" class="drake-logo">
<img src="/images/drake-logo-white.svg">
</a>
<div class="menu-mobile-toggle">
<span></span>
</div>
<nav class="site-menu">
<ul>
<li class="site-menu-item site-menu-item-main">
<a href="/" class="site-menu-item">Home</a>
</li>
<li class="site-menu-item site-menu-item-main">
<a href="/installation.html" class="site-menu-item">Installation</a>
</li>
<li class="site-menu-item site-menu-item-main">
<a href="/gallery.html" class="site-menu-item">Gallery</a>
</li>
<li class="site-menu-item site-menu-item-main">
API Documentation
<div class="sub">
<a href="/doxygen_cxx/index.html" class="site-menu-item">C++</a>
<a href="/pydrake/index.html" class="site-menu-item">Python</a>
</div>
</li>
<li class="site-menu-item site-menu-item-main">
Resources
<div class="sub">
<a href="/getting_help.html" class="site-menu-item">Getting Help</a>
<a href="https://deepnote.com/workspace/Drake-0b3b2c53-a7ad-441b-80f8-bf8350752305/project/Tutorials-2b4fc509-aef2-417d-a40d-6071dfed9199/%2Findex.ipynb" class="site-menu-item">Tutorials</a>
<a href="/python_bindings.html" class="site-menu-item">Python Bindings</a>
<a href="/developers.html" class="site-menu-item">For Developers</a>
<a href="/credits.html" class="site-menu-item">Credits</a>
</div>
</li>
<li class="search">
<div class="search-icon">
<!-- This is an inline SVG image of a magnifying glass. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 374.9 374.84">
<path d="M235 270a148.74 148.74 0 1 1 35-35l97.74 97.74a24.37 24.37 0 0 1 0 34.58l-.4.4a24.47 24.47 0 0 1-34.58 0L235 270Zm-86.22-7.47A113.75 113.75 0 1 0 35 148.75 113.75 113.75 0 0 0 148.75 262.5Z"/>
</svg>
</div>
<div class="search-bar">
<form id="search_form" action="https://google.com/search" method="get">
<input type="text" name="q" placeholder="Search all of Drake…" />
<input type="hidden" name="q" value="site:drake.mit.edu OR site:underactuated.csail.mit.edu OR site:manipulation.csail.mit.edu" />
</form>
<div class="search-close">
<!-- This is an inline SVG image of an "X". -->
<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 373.61 373.57">
<path d="M219.71 186.77 366.71 40a23.43 23.43 0 1 0-33.13-33.13l-146.77 147-146.77-147A23.43 23.43 0 0 0 6.9 40l147 146.77-147 146.77a23.43 23.43 0 1 0 33.14 33.13l146.77-147 146.77 147a23.43 23.43 0 1 0 33.13-33.13Z"/>
</svg>
</div>
</div>
<ul id="results-container"></ul>
</li>
<li class="github-link">
<a href="https://github.com/RobotLocomotion/drake" class="site-menu-item">GitHub <img src="/third_party/images/GitHub-Mark-Light-64px.png" /></a>
</li>
</ul>
</nav>
</div>
</header>
<div class="page">
<div class="content">
<div class="drake-page">
<header class="drake-page-header">
<div class="contain">
<h1>Troubleshooting common problems</h1>
</div>
</header>
<section class="padding">
<div class="contain grid grid-1-2col-nav-and-body">
<!--
N.B. The page is responsible for including the front + end matter.
See "Caveats" in drake/doc/README.txt.
-->
<!--
See "Caveats" in drake/doc/README.txt.
-->
<div class="sub-nav">
<div class="sticky">
<h5>Table of Contents</h5>
<ul id="markdown-toc">
<li><a href="#multibodyplant" id="markdown-toc-multibodyplant">MultibodyPlant</a> <ul>
<li><a href="#mbp-unconnected-query-object-port" id="markdown-toc-mbp-unconnected-query-object-port">Unconnected QueryObject port</a></li>
</ul>
</li>
<li><a href="#system-framework" id="markdown-toc-system-framework">System Framework</a> <ul>
<li><a href="#framework-context-system-mismatch" id="markdown-toc-framework-context-system-mismatch">Context-System mismatch</a></li>
</ul>
</li>
<li><a href="#pypi-pip" id="markdown-toc-pypi-pip">PyPI (pip)</a> <ul>
<li><a href="#pip-no-candidate" id="markdown-toc-pip-no-candidate">No candidate version for this platform</a></li>
</ul>
</li>
<li><a href="#build-problems" id="markdown-toc-build-problems">Build problems</a> <ul>
<li><a href="#build-oom" id="markdown-toc-build-oom">Out of memory</a></li>
</ul>
</li>
</ul>
</div>
</div>
<article class="markdown-body">
<p>This page contains a collection of tips and tricks for resolving common
problems.</p>
<h1 id="multibodyplant">MultibodyPlant</h1>
<h2 id="mbp-unconnected-query-object-port">Unconnected QueryObject port</h2>
<p>The error message will include the message, “The provided context doesn’t show a
connection for the plant’s query input port.”</p>
<p><code class="language-plaintext highlighter-rouge">MultibodyPlant</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_multibody_plant.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.multibody.plant.html#pydrake.multibody.plant.MultibodyPlant">Python</a>)
requires a connection to <code class="language-plaintext highlighter-rouge">SceneGraph</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1geometry_1_1_scene_graph.html">C++</a>,
<a href="https://drake.mit.edu/pydrake/pydrake.geometry.html#pydrake.geometry.SceneGraph_">Python</a>) in order to evaluate contact via its <code class="language-plaintext highlighter-rouge">QueryObject</code>
(<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1geometry_1_1_query_object.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.geometry.html#pydrake.geometry.QueryObject_">Python</a>). Attempts to evaluate output
ports that expose or depend on contact results (the geometric data and/or forces
that arise from the contact between bodies’ collision geometries) will fail.
Evaluating the time derivatives (e.g., when running a continuous simulation)
will likewise fail.</p>
<p>The connection can be reported as missing for several reasons:</p>
<ol>
<li>Was a <code class="language-plaintext highlighter-rouge">SceneGraph</code> instance created and connected?
<ul>
<li>The simplest solution is to use <code class="language-plaintext highlighter-rouge">AddMultibodyPlantSceneGraph()</code>
(<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_multibody_plant.html#aac66563a5f3eb9e2041bd4fa8d438827">C++</a>,
<a href="https://drake.mit.edu/pydrake/pydrake.multibody.plant.html#pydrake.multibody.plant.AddMultibodyPlantSceneGraph">Python</a>). It will construct and connect
the plant and scene graph together for you.</li>
</ul>
</li>
<li>Did you provide the right context?
<ul>
<li>You’ve created and connected the systems in a <code class="language-plaintext highlighter-rouge">Diagram</code>
(<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_diagram.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.Diagram">Python</a>) and allocated a <code class="language-plaintext highlighter-rouge">Context</code>
(<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_context.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.Context">Python</a>) for the <code class="language-plaintext highlighter-rouge">Diagram</code>.</li>
<li>Make sure you extract the <code class="language-plaintext highlighter-rouge">MultibodyPlant</code>’s context from the <code class="language-plaintext highlighter-rouge">Diagram</code>’s
<code class="language-plaintext highlighter-rouge">Context</code>. Do not allocate a <code class="language-plaintext highlighter-rouge">Context</code> directly from the plant. Use
<code class="language-plaintext highlighter-rouge">System::GetMyContextFromRoot()</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html#ae7fa91d2b2102457ced3361207724e52">C++</a>,
<a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.System_.System_[float].GetMyMutableContextFromRoot">Python</a>) to acquire the plant’s <code class="language-plaintext highlighter-rouge">Context</code> from the
<code class="language-plaintext highlighter-rouge">Diagram</code>’s context; this will preserve all of the necessary connections.
E.g.,</li>
</ul>
<div class="language-py highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="n">builder</span> <span class="o">=</span> <span class="n">DiagramBuilder</span><span class="p">()</span>
<span class="c1"># Build plant and scene graph and automatically connect them.
</span> <span class="n">plant</span><span class="p">,</span> <span class="n">scene_graph</span> <span class="o">=</span> <span class="n">AddMultibodyPlantSceneGraph</span><span class="p">(</span>
<span class="n">builder</span><span class="o">=</span><span class="n">builder</span><span class="p">,</span> <span class="n">time_step</span><span class="o">=</span><span class="mf">1e-3</span><span class="p">)</span>
<span class="p">...</span>
<span class="n">diagram</span> <span class="o">=</span> <span class="n">builder</span><span class="p">.</span><span class="n">Build</span><span class="p">()</span>
<span class="c1"># WRONG. This will create a Context for the plant only (no connected
</span> <span class="c1"># SceneGraph).
</span> <span class="n">xdot</span> <span class="o">=</span> <span class="n">plant</span><span class="p">.</span><span class="n">EvalTimeDerivatives</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="n">plant</span><span class="p">.</span><span class="n">CreateDefaultContext</span><span class="p">())</span>
<span class="n">context</span> <span class="o">=</span> <span class="n">diagram</span><span class="p">.</span><span class="n">CreateDefaultContext</span><span class="p">()</span>
<span class="c1"># Extract the plant's context from the diagram's to invoke plant methods.
</span> <span class="n">plant_context</span> <span class="o">=</span> <span class="n">plant</span><span class="p">.</span><span class="n">GetMyContextFromRoot</span><span class="p">(</span><span class="n">root_context</span><span class="o">=</span><span class="n">context</span><span class="p">)</span>
<span class="n">xdot</span> <span class="o">=</span> <span class="n">plant</span><span class="p">.</span><span class="n">EvalTimeDerivatives</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="n">plant_context</span><span class="p">)</span>
</code></pre></div> </div>
</li>
</ol>
<h1 id="system-framework">System Framework</h1>
<h2 id="framework-context-system-mismatch">Context-System mismatch</h2>
<p>The error message will include one of the following:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">A function call on a FooSystem system named '::_::foo' was passed the root
Diagram's Context instead of the appropriate subsystem context.</code></li>
<li><code class="language-plaintext highlighter-rouge">A function call on the root Diagram was passed a subcontext associated with
its subsystem named '::_::foo' instead of the root context.</code></li>
<li><code class="language-plaintext highlighter-rouge">A function call on a BarSystem named '::_::bar' was passed the Context of
a system named '::_::foo' instead of the appropriate subsystem Context.</code></li>
</ul>
<!-- TODO(SeanCurtis-TRI): This overview of Systems and Contexts would be
better in a doxygen module and just referenced here. Ping Russ to see if his
textbook covers this material and if we can/should steal it. -->
<h4>Contexts and Systems: An Overview</h4>
<p>For every <code class="language-plaintext highlighter-rouge">System</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.System">Python</a>) there is a
corresponding <code class="language-plaintext highlighter-rouge">Context</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_context.html">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.Context">Python</a>). The <code class="language-plaintext highlighter-rouge">System</code>
and <code class="language-plaintext highlighter-rouge">Context</code> work together. The <code class="language-plaintext highlighter-rouge">Context</code> holds the data values and the
<code class="language-plaintext highlighter-rouge">System</code> defines the operations on that data.</p>
<p>For example, a <code class="language-plaintext highlighter-rouge">MultibodyPlant</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_multibody_plant.html">C++</a>,
<a href="https://drake.mit.edu/pydrake/pydrake.multibody.plant.html#pydrake.multibody.plant.MultibodyPlant">Python</a>) is such a system. We can use an instance of a
<code class="language-plaintext highlighter-rouge">MultibodyPlant</code> to create one or more <code class="language-plaintext highlighter-rouge">Context</code>s. Each <code class="language-plaintext highlighter-rouge">Context</code> contains the
continuous and discrete state values for the plant’s model. These <code class="language-plaintext highlighter-rouge">Context</code>s
can be configured to represent the model in different configurations. However,
if we want to evaluate some mechanical property (e.g., composite inertia of a
robotic arm), we invoke a method on the plant, passing one of the contexts.</p>
<p>We can combine multiple <code class="language-plaintext highlighter-rouge">System</code>s into a <code class="language-plaintext highlighter-rouge">Diagram</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_diagram.html">C++</a>,
<a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.Diagram">Python</a>). The <code class="language-plaintext highlighter-rouge">System</code>s within a <code class="language-plaintext highlighter-rouge">Diagram</code> will typically have their
ports connected – this is how the <code class="language-plaintext highlighter-rouge">System</code>s work together.</p>
<p><code class="language-plaintext highlighter-rouge">Context</code>s similarly form a parallel hierarchical structure. The <code class="language-plaintext highlighter-rouge">Context</code>
associated with a <code class="language-plaintext highlighter-rouge">Diagram</code> is the combination of all of the <code class="language-plaintext highlighter-rouge">Context</code>s
associated with the <code class="language-plaintext highlighter-rouge">System</code>s inside that <code class="language-plaintext highlighter-rouge">Diagram</code>. The port connections
between <code class="language-plaintext highlighter-rouge">System</code>s in the <code class="language-plaintext highlighter-rouge">Diagram</code> are mirrored in the <code class="language-plaintext highlighter-rouge">Diagram</code>’s <code class="language-plaintext highlighter-rouge">Context</code>.</p>
<h4>Why did I get this error and how do I get rid of it?</h4>
<p>Many <code class="language-plaintext highlighter-rouge">System</code> APIs require a <code class="language-plaintext highlighter-rouge">Context</code>. It is important to pass the <em>right</em>
<code class="language-plaintext highlighter-rouge">Context</code> into the API. What’s the difference between a “right” and “wrong”
<code class="language-plaintext highlighter-rouge">Context</code>?</p>
<ul>
<li>The right <code class="language-plaintext highlighter-rouge">Context</code> was allocated by the <code class="language-plaintext highlighter-rouge">System</code> being evaluated.</li>
<li>If the <code class="language-plaintext highlighter-rouge">System</code> is part of a <code class="language-plaintext highlighter-rouge">Diagram</code>, then the <code class="language-plaintext highlighter-rouge">Context</code> provided should
be a reference pointing inside the <code class="language-plaintext highlighter-rouge">Diagram</code>s <code class="language-plaintext highlighter-rouge">Context</code> (see below for how
to do this).</li>
</ul>
<p>The most common error is to pass the <code class="language-plaintext highlighter-rouge">Diagram</code>’s <code class="language-plaintext highlighter-rouge">Context</code> into a constituent
<code class="language-plaintext highlighter-rouge">System</code>’s API. We’ll illustrate this using a <code class="language-plaintext highlighter-rouge">Diagram</code> with a <code class="language-plaintext highlighter-rouge">MultibodyPlant</code>.
The solution is to use either <code class="language-plaintext highlighter-rouge">GetMyContextFromRoot()</code>
(<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html#ae7fa91d2b2102457ced3361207724e52">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.System_.System_[float].GetMyMutableContextFromRoot">Python</a>) or
<code class="language-plaintext highlighter-rouge">GetMyMutableContextFromRoot()</code> (<a href="https://drake.mit.edu/doxygen_cxx/classdrake_1_1systems_1_1_system.html#ae7fa91d2b2102457ced3361207724e52">C++</a>, <a href="https://drake.mit.edu/pydrake/pydrake.systems.framework.html#pydrake.systems.framework.System_.System_[float].GetMyMutableContextFromRoot">Python</a>) as appropriate to extract a particular
<code class="language-plaintext highlighter-rouge">System</code>’s <code class="language-plaintext highlighter-rouge">Context</code> from its <code class="language-plaintext highlighter-rouge">Diagram</code>’s <code class="language-plaintext highlighter-rouge">Context</code>.</p>
<div class="language-py highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="n">builder</span> <span class="o">=</span> <span class="n">DiagramBuilder</span><span class="p">()</span>
<span class="n">plant</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">AddMultibodyPlantSceneGraph</span><span class="p">(</span><span class="n">builder</span><span class="o">=</span><span class="n">builder</span><span class="p">,</span> <span class="n">time_step</span><span class="o">=</span><span class="mf">1e-3</span><span class="p">)</span>
<span class="p">...</span> <span class="c1"># Populate the plant with interesting stuff.
</span> <span class="n">diagram</span> <span class="o">=</span> <span class="n">builder</span><span class="p">.</span><span class="n">Build</span><span class="p">()</span>
<span class="c1"># Create a Context for diagram.
</span> <span class="n">root_context</span> <span class="o">=</span> <span class="n">diagram</span><span class="p">.</span><span class="n">CreateDefaultContext</span><span class="p">()</span>
<span class="n">my_body</span> <span class="o">=</span> <span class="n">plant</span><span class="p">.</span><span class="n">GetBodyByName</span><span class="p">(</span><span class="s">"my_body"</span><span class="p">)</span>
<span class="n">X_WB</span> <span class="o">=</span> <span class="n">RigidTransform</span><span class="p">(...)</span> <span class="c1"># Define a pose for the body.
</span> <span class="c1"># Error! plant has been given diagram's context.
</span> <span class="n">plant</span><span class="p">.</span><span class="n">SetFreeBodyPose</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="n">root_context</span><span class="p">,</span> <span class="n">body</span><span class="o">=</span><span class="n">base</span><span class="p">,</span> <span class="n">X_WB</span><span class="o">=</span><span class="n">X_WB_desired</span><span class="p">)</span>
<span class="c1"># Get the Context for plant from diagram's context.
</span> <span class="n">plant_context</span> <span class="o">=</span> <span class="n">plant</span><span class="p">.</span><span class="n">GetMyContextFromRoot</span><span class="p">(</span><span class="n">root_context</span><span class="o">=</span><span class="n">root_context</span><span class="p">)</span>
<span class="c1"># Successful operation; the provided context belongs to plant.
</span> <span class="n">plant</span><span class="p">.</span><span class="n">SetFreeBodyPose</span><span class="p">(</span><span class="n">context</span><span class="o">=</span><span class="n">plant_context</span><span class="p">,</span> <span class="n">body</span><span class="o">=</span><span class="n">base</span><span class="p">,</span> <span class="n">X_WB</span><span class="o">=</span><span class="n">X_WB_desired</span><span class="p">)</span>
</code></pre></div> </div>
<p>See the notes on <a href="https://drake.mit.edu/doxygen_cxx/group__system__compatibility.html">System Compatibility</a> for further discussion.</p>
<h1 id="pypi-pip">PyPI (pip)</h1>
<h2 id="pip-no-candidate">No candidate version for this platform</h2>
<!-- Even though this is only relevant to past versions of Drake that are no
longer supported, we'll keep this text around to help users of those older
versions. -->
<p>When installing Drake from PyPI on older platforms such as Ubuntu Focal, you may
receive the error “no candidate version for this platform”. This is caused by
older versions of <code class="language-plaintext highlighter-rouge">pip</code> which do not recognize the <code class="language-plaintext highlighter-rouge">manylinux</code> platform used by
Drake. This is remedied by installing a newer version of <code class="language-plaintext highlighter-rouge">pip</code>.</p>
<p>Use of a Python virtual environment may be required in order to get a newer
version of <code class="language-plaintext highlighter-rouge">pip</code>, e.g.:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 <span class="nt">-m</span> venv <span class="nb">env
env</span>/bin/pip <span class="nb">install</span> <span class="nt">--upgrade</span> pip
<span class="nb">env</span>/bin/pip <span class="nb">install </span>drake
<span class="nb">source env</span>/bin/activate
</code></pre></div> </div>
<h1 id="build-problems">Build problems</h1>
<h2 id="build-oom">Out of memory</h2>
<p>When compiling Drake from source, the build might run out of memory. The error
message will include the message, “cc: fatal error: Killed signal terminated
program cc1plus”.</p>
<p>By default, the Drake build will try use all available CPU and RAM resources on
the machine. Sometimes, when there is not enough RAM per CPU, the build might
crash because it tried to run a compiler process on every vCPU and together
those compilation jobs consumed more RAM than was available.</p>
<p>In this case, you’ll need to add a bazel configuration dotfile to your home
directory. Create a text file at <code class="language-plaintext highlighter-rouge">$HOME/.bazelrc</code> with this content:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>build --jobs=HOST_CPUS*0.4
</code></pre></div> </div>
<p>This instructs the build system to use only 40% of the available vCPUs. You may
tune the fraction up or down to balance build speed vs resource crashes. You may
also specify an exact number like <code class="language-plaintext highlighter-rouge">build --jobs=2</code> instead of a fraction.</p>
<p>The dotfile will affect any Bazel builds that you run. If you prefer to change
only the Drake build instead of all Bazel builds, you may place the dotfile in
the Drake source tree at <code class="language-plaintext highlighter-rouge">drake/user.bazelrc</code> instead of your home directory.</p>
<p>Note that the concurrency level passed to <code class="language-plaintext highlighter-rouge">make</code> (e.g., <code class="language-plaintext highlighter-rouge">make -j 2</code>) does not
propagate through to affect the concurrency of most of Drake’s build steps; you
need to configure the dotfile in order to control the build concurrency.</p>
<!-- Links to the various Drake doxygen pages.
Order determined by directory structure first and names second.
-->
<!-- modules -->
<!-- drake/geometry -->
<!-- drake/multibody/plant -->
<!-- drake/systems/framework -->
</article>
</div>
</section>
</div>
<footer class="site-footer padding">
<div class="contain">
<a href="/" class="drake-logo">
<img src="/images/drake-logo.svg">
</a>
<div class="footer-menu">
<ul>
<li>
<a href="/doxygen_cxx/index.html" class="site-menu-item">C++</a>
</li>
<li>
<a href="/pydrake/index.html" class="site-menu-item">Python</a>
</li>
<li class="github-link">
<a href="https://github.com/RobotLocomotion/drake" class="site-menu-item">GitHub <img src="/third_party/images/GitHub-Mark-64px.png" /></a>
</li>
</ul>
</div>
</div>
<!-- TODO(eric.cousineau): Consider placing copyright here. -->
</footer>
</div>
</div>
<script src="/assets/js/mobile.js"></script>
<!-- Search -->
<script src="/assets/js/search.js"></script>
</body>
</html>