@@ -62,8 +62,10 @@ func TestDocker_Nvidia(t *testing.T) {
62
62
// Assert that we can run nvidia-smi in the inner container.
63
63
assertInnerNvidiaSMI (ctx , t , ctID )
64
64
65
- // Make sure dnf still works.
66
- out , err := execContainerCmd (ctx , t , ctID , "docker" , "exec" , "workspace_cvm" , "dnf" , "list" )
65
+ // Make sure dnf still works. This checks for a regression due to
66
+ // gpuExtraRegex matching `libglib.so` in the outer container.
67
+ // This had a dependency on `libpcre.so.3` which would cause dnf to fail.
68
+ out , err := execContainerCmd (ctx , t , ctID , "docker" , "exec" , "workspace_cvm" , "dnf" )
67
69
if ! assert .NoError (t , err , "failed to run dnf in the inner container" ) {
68
70
t .Logf ("dnf output:\n %s" , strings .TrimSpace (out ))
69
71
}
@@ -113,6 +115,29 @@ func TestDocker_Nvidia(t *testing.T) {
113
115
assertInnerFiles (ctx , t , ctID , "/usr/lib/x86_64-linux-gnu/libnv*" , ofs ... )
114
116
assertInnerNvidiaSMI (ctx , t , ctID )
115
117
})
118
+
119
+ t .Run ("CUDASample" , func (t * testing.T ) {
120
+ t .Parallel ()
121
+
122
+ ctx , cancel := context .WithCancel (context .Background ())
123
+ t .Cleanup (cancel )
124
+
125
+ // Start the envbox container.
126
+ ctID := startEnvboxCmd (ctx , t , integrationtest .CUDASampleImage , "root" ,
127
+ "-v" , "/usr/lib/x86_64-linux-gnu:/var/coder/usr/lib" ,
128
+ "--env" , "CODER_ADD_GPU=true" ,
129
+ "--env" , "CODER_USR_LIB_DIR=/var/coder/usr/lib" ,
130
+ "--runtime=nvidia" ,
131
+ "--gpus=all" ,
132
+ )
133
+
134
+ // Assert that we can run nvidia-smi in the inner container.
135
+ assertInnerNvidiaSMI (ctx , t , ctID )
136
+
137
+ // Assert that /tmp/vectorAdd runs successfully in the inner container.
138
+ _ , err := execContainerCmd (ctx , t , ctID , "docker" , "exec" , "workspace_cvm" , "/tmp/vectorAdd" )
139
+ require .NoError (t , err , "failed to run /tmp/vectorAdd in the inner container" )
140
+ })
116
141
}
117
142
118
143
// dockerRuntimes returns the list of container runtimes available on the host.
0 commit comments