Skip to content

Commit 0efde8c

Browse files
authored
Merge pull request #6 from A2R-Lab/older-gpu-compatibility
fixed compatibility issues with older GPUs
2 parents c556b19 + e8ba84f commit 0efde8c

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ Numerical experiments and the open-source solver from the paper ["MPCGPU: Real-T
66

77
```
88
git clone https://github.com/A2R-Lab/MPCGPU
9+
cd MPCGPU
910
git submodule update --init --recursive
1011
make build_qdldl
1112
make examples
1213
mkdir -p tmp/results
14+
```
15+
Either install the qdldl shared library by running ```cd qdldl/build && make install``` or modify the ```LD_LIBRARY_PATH``` environment variable to include the path to ```MPCGPU/qdldl/build/out```.
16+
17+
```
1318
./examples/pcg.exe
1419
./examples/qdldl.exe
1520
```
1621

17-
The track_iiwa_pcg file outlines how you could setup a tracking problem with underlying linear system solver as pcg.
18-
19-
The track_iiwa_qdldl file outlines how you could setup a tracking problem with underlying linear system solver as qdldl.
20-
2122
### Setting parameters
2223

2324
You can set a bunch of parameters in `include/setting.cuh` file. You can also modify these by passing them as

include/common/merit.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
template <typename T>
1010
size_t get_merit_smem_size(uint32_t state_size, uint32_t control_size)
1111
{
12-
return sizeof(T) * ((4 * state_size + 2 * control_size ) + grid::EE_POS_SHARED_MEM_COUNT + max((2 * state_size + control_size), state_size + gato_plant::forwardDynamics_TempMemSize_Shared()));
12+
return sizeof(T) * (6 + (2 * state_size + control_size ) +
13+
((int) 1.5 * state_size) + gato_plant::forwardDynamics_TempMemSize_Shared());
1314
}
1415

1516
// cost compute for line search

include/dynamics/iiwa/iiwa_eepos_grid.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace grid {
9898
const int NUM_EES = 1;
9999
const int ID_DYNAMIC_SHARED_MEM_COUNT = 770;
100100
const int MINV_DYNAMIC_SHARED_MEM_COUNT = 1395;
101-
const int FD_DYNAMIC_SHARED_MEM_COUNT = 1444;
101+
const int FD_DYNAMIC_SHARED_MEM_COUNT = 1724;
102102
const int ID_DU_DYNAMIC_SHARED_MEM_COUNT = 2450;
103103
const int FD_DU_DYNAMIC_SHARED_MEM_COUNT = 2450;
104104
const int ID_DU_MAX_SHARED_MEM_COUNT = 2695;

include/mpcsim.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ std::tuple<std::vector<toplevel_return_type>, std::vector<linsys_t>, linsys_t> s
254254

255255

256256
#if LIVE_PRINT_PATH
257-
grid::end_effector_positions_kernel<T><<<1,128>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
257+
grid::end_effector_positions_kernel<T><<<1,128,144*sizeof(T)>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
258258
gpuErrchk(cudaMemcpy(h_eePos, d_eePos, 6*sizeof(T), cudaMemcpyDeviceToHost));
259259
for (uint32_t i = 0; i < 6; i++){
260260
std::cout << h_eePos[i] << (i < 5 ? " " : "\n");
@@ -297,7 +297,7 @@ std::tuple<std::vector<toplevel_return_type>, std::vector<linsys_t>, linsys_t> s
297297
if (!shifted && time_since_timestep > shift_threshold){
298298

299299
// record tracking error
300-
grid::end_effector_positions_kernel<T><<<1,128>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
300+
grid::end_effector_positions_kernel<T><<<1,128,144*sizeof(T)>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
301301
gpuErrchk(cudaMemcpy(h_eePos, d_eePos, 6*sizeof(T), cudaMemcpyDeviceToHost));
302302
gpuErrchk(cudaMemcpy(h_eePos_goal, d_eePos_goal, 6*sizeof(T), cudaMemcpyDeviceToHost));
303303
cur_tracking_error = 0.0;
@@ -401,7 +401,7 @@ std::tuple<std::vector<toplevel_return_type>, std::vector<linsys_t>, linsys_t> s
401401
#endif
402402

403403

404-
grid::end_effector_positions_kernel<T><<<1,128>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
404+
grid::end_effector_positions_kernel<T><<<1,128,144*sizeof(T)>>>(d_eePos, d_xs, grid::NUM_JOINTS, (grid::robotModel<T> *) d_dynmem, 1);
405405
gpuErrchk(cudaMemcpy(h_eePos, d_eePos, 6*sizeof(T), cudaMemcpyDeviceToHost));
406406
gpuErrchk(cudaMemcpy(h_eePos_goal, d_eePos_goal, 6*sizeof(T), cudaMemcpyDeviceToHost));
407407
cur_tracking_error = 0.0;

0 commit comments

Comments
 (0)