|
2 | 2 |
|
3 | 3 | <%= ERB.new(File.read('../common_files/work_directory_change.sh.erb'), eoutvar: 'child').result(binding) %> |
4 | 4 |
|
5 | | -# Ensure that the user's configured login shell is used |
6 | | -export SHELL="$(getent passwd $USER | cut -d: -f7)" |
| 5 | +# Benchmark info |
| 6 | +echo "TIMING - Starting main script at: $(date)" |
7 | 7 |
|
8 | | -if [ ${SLURM_GPUS_ON_NODE:-0} -gt 0 ]; then |
9 | | - gpu_bus_id=$(nvidia-smi --query-gpu=gpu_bus_id --format=csv,noheader) |
10 | | - # to lowercase |
11 | | - gpu_bus_id=${gpu_bus_id,,} |
12 | | - # Need to strip off first 4 zeros |
13 | | - dri_device=$(ls -d /sys/bus/pci/devices/${gpu_bus_id:4}/drm/card*) |
14 | | - export VGL_DISPLAY=/dev/dri/${dri_device##*/} |
15 | | - export VGL_LOGO=1 # for testing |
16 | | - echo "Setting VGL_DISPLAY to $VGL_DISPLAY" |
17 | | -else |
18 | | - export VGL_DISPLAY=$DISPLAY |
19 | | -fi |
| 8 | +# Set VGL_DISPLAY to a GPU card if available, otherwise to Mesa llvmpipe |
| 9 | +<%= ERB.new(File.read('../common_files/oodegl.sh.erb'), eoutvar: 'child').result(binding) %> |
| 10 | + |
| 11 | +<%- unless context.global_prerun.empty? -%> |
| 12 | +<%= context.global_prerun.gsub("\r", "") %> |
| 13 | +<%- end -%> |
20 | 14 |
|
21 | 15 | # Start up desktop |
22 | 16 | echo "Launching desktop '<%= context.desktop %>'..." |
23 | | -source "<%= session.staged_root.join("desktops", "#{context.desktop}.sh") %>" |
| 17 | +<%= ERB.new(File.read("../common_files/desktops/#{context.desktop}.sh.erb"), eoutvar: 'child').result(binding) %> |
| 18 | + |
24 | 19 | echo "Desktop '<%= context.desktop %>' ended with $? status..." |
0 commit comments