HPMC User Guide v 1.00
© 2026 Bassem W. Jamaleddine
Install the NVIDIA GPU on your HPMC. Once slotted in the PCIe, you should be able to see it in the /proc/driver/nvidia.
08:32 root@HPMC: ~ # tree /proc/driver/nvidia
08:32 root@HPMC: ~ # tree /proc/driver/nvidia
/proc/driver/nvidia
├── gpus
│ └── 0000:65:00.0
│ ├── information
│ └── registry
├── params
├── patches
│ └── README
├── registry
├── version
└── warnings
└── README
4 directories, 7 files
The GPU can also be seen in the list of PCI.
08:34 root@HPMC: ~ # lspci -s 65:00.0 -v
08:34 root@HPMC: ~ # lspci -s 65:00.0 -v
65:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1) (prog-if 00 [VGA controller])
Subsystem: NVIDIA Corporation Device 1132
Flags: bus master, fast devsel, latency 0, IRQ 51, NUMA node 0
Memory at d7000000 (32-bit, non-prefetchable) [size=16M]
Memory at c0000000 (64-bit, prefetchable) [size=256M]
Memory at d0000000 (64-bit, prefetchable) [size=32M]
I/O ports at b000 [size=128]
[virtual] Expansion ROM at d8000000 [disabled] [size=512K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Legacy Endpoint, MSI 00
Capabilities: [100] Virtual Channel
Capabilities: [250] Latency Tolerance Reporting
Capabilities: [258] L1 PM Substates
Capabilities: [128] Power Budgeting <?>
Capabilities: [420] Advanced Error Reporting
Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
Capabilities: [900] #19
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
To find its memory mapping, we will issue the following commands.
08:41 root@HPMC: ~ # cat /proc/iomem
grep '0000:65:00.0'
08:41 root@HPMC: ~ # cat /proc/iomem | grep '0000:65:00.0'
c0000000-cfffffff : 0000:65:00.0
d0000000-d1ffffff : 0000:65:00.0
d7000000-d7ffffff : 0000:65:00.0
d8000000-d807ffff : 0000:65:00.0
08:41 root@HPMC: ~ # cat /proc/vmallocinfo | grep phys=d0000000
08:41 root@HPMC: ~ # cat /proc/vmallocinfo | grep phys=d0000000 0xffffc9000c000000-0xffffc9000d001000 16781312 os_map_kernel_space.part.6+0x105/0x130 [nvidia] phys=d0000000 ioremap 08:41 root@HPMC: ~ # cat /proc/vmallocinfo | grep phys=d7000000 0xffffc9000a000000-0xffffc9000b001000 16781312 os_map_kernel_space.part.6+0xf5/0x130 [nvidia] phys=d7000000 ioremap
To print information about the GPU.
08:42 root@HPMC: ~ # cat /proc/driver/nvidia/gpus/*/information
08:42 root@HPMC: ~ # cat /proc/driver/nvidia/gpus/*/information Model: GeForce GTX TITAN X IRQ: 51 GPU UUID: GPU-41a35506-3d8a-4c76-9f36-55cfff039724 Video BIOS: 84.00.1f.00.01 Bus Type: PCIe DMA Size: 40 bits DMA Mask: 0xffffffffff Bus Location: 0000:65:00.0 Device Minor: 0
Now that the GPU is available on the HPMC, it is time to do some system configuration so to render it usable for our CUDA programming.
This section is not included in the SAMPLE PREVIEW.
# cat ccube/st/thpath.sh
export PATH=/cuda/torch/install/bin:$PATH export LD_LIBRARY_PATH=/cuda/torch/install/lib:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=/cuda/torch/install/lib:$DYLD_LIBRARY_PATH export PATH=/cuda/torch/install/bin:$PATH export LD_LIBRARY_PATH=/cuda/torch/install/lib:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=/cuda/torch/install/lib:$DYLD_LIBRARY_PATH
■ Adding a Widget to the Group of NVIDIA CUDA Examples
We would like to add some icons to the desktop to validate the functionality of the GPU. Let's add a widget to the desktop showing the group of NVIDIA examples. Such a widget is shown in Figure 4.1.4.
Now that we installed the CUDA and the examples, we will map these applications to /cuda directory by running the cuda-examples-mapper script.
1. #!/usr/bin/perl 2. 3. use strict; 4. 5. # rather relative path using sym link to simply switch versions 6. # /usr/local/cuda is linked to whatever ver, eg. /usr/local/cuda-9.2 7. my $source = '/usr/local/cuda/samples'; 8. my $target1 = '/cud0/CuExamples'; 9. my $target2 = '/cud0/CuExamples/comp'; 10. 11. `mkdir -p $target1`; 12. `mkdir -p $target2`; 13. 14. my @dirs = qw(0_Simple 1_Utilities 2_Graphics 3_Imaging 4_Finance 5_Simulations 6_Advanced 7_CUDALibraries); 15. 16. my $i = 0; 17. foreach my $dir (sort @dirs) { 18. my @x = glob($source . '/' . $dir.'/*'); 19. my $basedir = $source . '/' . $dir; 20. print "$dir\n"; 21. foreach (@x) { 22. my @p = split(/\//,$_); 23. my $fn = $i . '_' . $p[$#p]; 24. if ($i =~ /(0|1|4|6|7)/) { 25. $fn = "cux" . $fn; 26. $fn .= '.sh'; 27. my $binfile = "$_/$p[$#p]"; 28. next unless -e $binfile; 29. next unless -x $binfile; 30. open(F,">$target2/$fn"); 31. print F "#!/bin/ksh\n(source /etc/ccube/st/cupath.sh;cd $basedir;$_/$p[$#p] \"\${@:1}\")\n"; 32. close F; 33. `chown hpcusr.hpcusr $target2/$fn`; 34. `chmod 755 $target2/$fn`; 35. } 36. else { 37. $fn = "cus" . $fn; 38. my $binfile = "$_/$p[$#p]"; 39. next unless -e $binfile; 40. next unless -x $binfile; 41. open(F,">$target1/$fn"); 42. print F "#!/bin/ksh 43. (source /etc/ccube/st/cupath.sh;cd $basedir;$_/$p[$#p] \"\${@:1}\") 44. "; 45. close F; 46. `chown hpcusr.hpcusr $target1/$fn`; 47. `chmod 755 $target1/$fn`; 48. } 49. } 50. $i++; 51. }
This script is run only once, after installing CUDA examples. If a new version of CUDA examples is released, we simply change the version in the script, and run it once.
After running the script, you can explore with the examples on the command prompt:
# cus
hit the TAB to display all cus*
cus2_bindlessTexture cus2_volumeFiltering cus3_convolutionFFT2D cus3_dwtHaar1D cus3_postProcessGL cus5_fluidsGL cus2_Mandelbrot cus2_volumeRender cus3_convolutionSeparable cus3_dxtc cus3_recursiveGaussian cus5_nbody cus2_marchingCubes cus3_bicubicTexture cus3_convolutionTexture cus3_histogram cus3_simpleCUDA2GL cus5_oceanFFT cus2_simpleGL cus3_bilateralFilter cus3_cudaDecodeGL cus3_HSOpticalFlow cus3_SobelFilter cus5_particles cus2_simpleTexture3D cus3_boxFilter cus3_dct8x8 cus3_imageDenoising cus3_stereoDisparity cus5_smokeParticles
Of course you can enter any one of these listed above to run the CUDA example it represents.
To know where these examples reside on your file system, use the which command on one of them:
# which cus3_convolutionTexture
/cuda9/CuExamples/cus3_convolutionTexture
We will add a widget to the desktop to display all these examples. Since the examples are in /cuda9/CuExamples. Open the file manager, select the folder CuExamples, and drag it to the top right corner of the desktop, as shown in Figure 4.1.3. Now you can run any one of the examples by clicking on it. You can run as many as you want, even the same one. The next chapter shows how to monitor the resources consumed by these examples.
■ Adding a NVIDIA Applications to the Panel
We can add various applications by displaying their corresponding icons in the bottom of the panel. The simplest way to add these icons, unlock the bottom panel and add each application. It is also possible to add these icons manually, for example, the following shows the the "NVIDIA X Server Settings" as being defined in nvidia-settings.desktop. Your system may be saving these desktop definition files in different branch relative to the share/applications/ sub-directory.
# cat /root/.local/share/flatpak/exports/share/applications/nvidia-settings.desktop
cat /root/.local/share/flatpak/exports/share/applications/nvidia-settings.desktop [Desktop Entry] Type=Application Encoding=UTF-8 Name=NVIDIA X Server Settings Comment=Configure NVIDIA X Server Settings Exec=/usr/bin/nvidia-settings Icon=/usr/share/doc/NVIDIA_GLX-1.0/nvidia-settings.png Categories=Settings;HardwareSettings;
To add an icon to the panel bottom bar, from main start menu, simply go to the application icon (in the menu), right click on it, and select "Add to panel (+widget)". Figure 4.1.5 shows how we added seven icons for frequently used applications.
■ About your HPMC CUDA Device
Let's conclude this chapter with about your GPU device.
This section is not included in the SAMPLE PREVIEW.
To make sure that your GPU is ready to serve CUDA programming capability, just invoke the randomFog program at the prompt. Figure shows the randomFog. In case the randomFog failed to execute then refer to Appendix Troubleshooting the CUDA GPU.
■ Conway's Game of Life on GPU using CUDA
We will add the "Game of Life" and run it on the GPU. Download the "Conway's Game of Life" and extract it on your HPMC. The following Makefile defines the compilation of software into a CUDA executable: gol.
CC=g++
NVCC=/usr/local/cuda/bin/nvcc
FLAGS=
HEADERS=$(wildcard *.h)
OBJ=$(HEADERS:.h=.o)
gol: main.cu $(OBJ)
$(NVCC) $(FLAGS) -o $@ main.cu $(OBJ) -lglut -lGL -lGLU
# pull in dependency info for *existing* .o files
-include $(OBJ:.o=.d)
# compile and generate dependency info
%.o: %.cu %.h
$(NVCC) $(FLAGS) -c $*.cu -o $*.o
$(CC) -MM $*.cu > $*.d
clean:
rm -f gol *.o *.d
The following shows the seeding files for the startup of gol.
Figure 4.1.8 shows running game of file on the HPMC computer.